How tharanitharan-m/prepwise works
Project type and purpose
• This is a full-stack web application called “PrepWise,” built with Next.js for both the frontend and backend.
• It provides AI-powered mock interviews with real-time voice interaction, secure authentication, and persistent storage of interview data and feedback.
File structure
• app/…: Next.js 13 “app router” directory, containing:
• (auth) routes for sign-in and sign-up
• (root) protected user area with interview listing, custom interview creation, interview sessions, and feedback pages
• app/api/vapi routes for VAPI voice endpoints (custom-interview and generate)
• components/: reusable React UI components and custom Shadcn UI wrappers
• lib/actions and lib/utils: client-side and server-side helper functions for authentication, interview management, and general utilities
• firebase/: modules to initialize Firebase Admin (server) and Client SDKs
• types/ and constants/: shared TypeScript definitions and application constants
• public/: static assets (covers)
• Configuration files: next.config.ts, tsconfig.json, eslint.config.mjs, postcss.config.mjs
README for additional insights
• Frontend: Next.js, React, Tailwind CSS, Shadcn UI, React Hook Form, Zod
• Backend: Next.js API Routes, Firebase Auth & Firestore, VAPI Voice API, Google Gemini AI
• Deployment target: Vercel
a. Main components
• Client Browser / Web App (Next.js React pages & components)
• Next.js Server (SSR/Edge functions handling API routes)
• Firebase Authentication & Firestore (Auth, user data, interviews, feedback)
• VAPI Voice API (real-time audio streaming and transcription)
• Google Gemini AI (question generation and transcript analysis)
• Vercel (hosting and CDN)
b. Component interactions
1. User interacts with the React UI in the browser.
2. Authentication requests → Next.js API → Firebase Auth.
3. On “Generate Interview”: UI POST → /api/vapi/custom-interview → server calls Google Gemini AI, stores interview template in Firestore.
4. Starting a live interview: UI connects via WebSocket or fetch to /api/vapi/generate → VAPI Voice API streams audio, server proxies requests, responses transcribed in real time.
5. Interview transcript returned to server → /api/vapi/generate calls Google Gemini AI for feedback → feedback saved to Firestore.
6. UI fetches interview data and feedback from Firestore via Next.js data fetching.
c. Architectural patterns & principles
• Separation of concerns: UI layer (pages + components) vs. business logic (lib/actions) vs. data layer (Fire-store + SDK wrappers)
• Edge functions / serverless API patterns via Next.js API Routes
• Modular component design (Shadcn UI + custom components)
• Real-time streaming integration with external voice API
d. Key technologies
• Next.js 13 App Router
• React & Shadcn UI
• Tailwind CSS
• Firebase Auth & Firestore
• VAPI Voice API & @vapi/ai-web
• Google Gemini AI
• React Hook Form + Zod for form validation