How qaimmehdi/prepza works
Project Type and Purpose
• This is a full-stack web application (“PREPZA”) for AI-powered mock interviews (technical & HR), voice/text interaction, real-time feedback, and performance tracking.
• Frontend: React + TypeScript + Tailwind CSS + Shadcn/ui + Web Speech API.
• Backend: Spring Boot (Java 17) REST API with Spring Security, JWT auth, Spring Data JPA, MySQL.
• AI integration: Google Gemini API for question generation and feedback.
File Structure Analysis
• Top‐level build/config: package.json, pom.xml, vite.config.ts, tsconfig.json, tailwind.config.ts.
• Frontend source (src/):
• Pages (src/pages/… .tsx) – React Router views (Index, InterviewPage, Login, Signup, etc.)
• Components (src/components/…): UI building blocks (Navbar, Footer, AuthContext, interview widgets, shadcn/ui primitives).
• Hooks (src/hooks/…): Custom React hooks for mobile detection, interview session logic, toasts.
• lib/utils.ts: shared utilities.
• firebase.ts: Firebase client config (if used).
• Backend source (src/main/java/com/yourcompany/interviewplatform/…):
• config: AuditingConfig, SecurityConfig, WebConfig.
• controller: AuthController, SessionController (REST endpoints).
• service: AuthService, SessionService (business logic, interacts with AIService).
• ai: AIService (calls Google Gemini).
• repository: Spring Data JPA repositories for User, InterviewSession, QuestionAnswer.
• model/dto: domain entities & request/response objects.
• security: JwtTokenProvider.
• Resources: application.properties/yml for DB, JWT, Gemini.
• target/: compiled backend artifacts.
• test-session-api.html, test-speech.html: demo/test pages for API and speech.
Key README Insights
• Emphasizes JWT-based auth, transcript & TTS, two interview modes, session persistence, AI prompt engineering.
• Lists major technologies and features, clarifies external dependencies (MySQL, Gemini API).
a. Main Components
• Frontend SPA (React)
– UI Layer: Pages & Components
– State Management: AuthContext, custom hooks
– Voice Engine: Web Speech API (Speech-to-Text, Text-to-Speech)
• Backend REST API (Spring Boot)
– AuthController (login/signup, JWT issuance)
– SessionController (start/end session, answer submission)
– AIService (calls Gemini API)
– Services & Repositories
• Database (MySQL via Spring Data JPA)
• External Services
– Google Gemini API (AI question/feedback)
– (Optional) Firebase (if used for analytics/auth)
b. Relationships & Data Flows
1. User interacts with React UI (voice/text).
2. UI calls AuthController endpoints → JWT token.
3. UI stores JWT, invokes SessionController with JWT in Authorization header.
4. SessionController → SessionService → AIService calls Gemini API → returns questions/feedback.
5. SessionService persists InterviewSession and QuestionAnswer via repositories.
6. UI displays AI responses & real-time feedback; persists session progress.
c. Architectural Patterns
• Layered architecture for backend (Controller → Service → Repository).
• Component-based UI architecture in frontend.
• Context & custom hooks for state management.
• JWT stateless authentication.
• API integration with external AI service.
d. Technology Highlights
• React + TypeScript + Tailwind + Shadcn/ui
• Web Speech API for voice
• Spring Boot + Security + Data JPA + JWT
• MySQL persistence
• Google Gemini API for NLP tasks