How satwiksai18/interview-practice-partner works
Project type and purpose
• This is a full-stack web application:
• A Next.js + TailwindCSS frontend (“ai_interviewer” folder)
• A FASTAPI (Python) backend with WebSocket and OpenAI integration (“backend” folder)
• Purpose: Provide AI-powered mock interviews, question generation, answer evaluation, and analytics.
File structure (inferred from README)
• Top-level directories:
• ai_interviewer: Next.js app serving UI, handles routing, state, and connects over HTTP/WebSocket
• backend: FASTAPI application exposing REST endpoints and WebSocket routes, integrates with LLM and database
• Key configuration/deployment files:
• ai_interviewer/package.json, next.config.js, tailwind.config.js
• backend/requirements.txt or package.json (for server.js), Dockerfile (if present)
• Patterns: client-server separation, real-time channel (WebSocket) alongside RESTful API
Extract insights from README
• Tech stack overview confirms separation of UI, API, real-time stream, and AI service
• Features hint at a database for storing user sessions, performance metrics, and analytics
Main components & their roles
a. Frontend (Next.js + TailwindCSS)
• Renders interview UI, dashboards, user auth, styling
• Communicates via HTTP (question lists, historical data, analytics)
• Opens WebSocket for real-time Q&A sessions
b. Backend (FASTAPI + WebSockets)
• REST API: CRUD for sessions, user profiles, analytics
• WebSocket endpoint: two-way streaming for dynamic follow-ups
• Controller for invoking OpenAI LLM endpoints
c. Database (e.g., PostgreSQL/MongoDB)
• Stores interview sessions, user answers, scores, performance history
d. External AI Service (OpenAI API)
• Generates questions, evaluates responses, produces feedback
e. (Optional) Authentication Service / Cache / Message Broker
• JWT auth, Redis cache for session state or pub/sub if scaling WebSocket
Relationships & data flow
• Browser → HTTP REST → Backend → Database
• Browser ↔ WebSocket → Backend → OpenAI API
• Backend → OpenAI → Backend → Database (stores results)
• Backend → HTTP REST → Frontend (analytics data)
Architectural patterns & design principles
• Clear separation of concerns: UI, API, AI integration, persistence
• Real-time event-driven communication (WebSockets)
• Stateless API servers with external state (DB, cache)
• Modular code organization: Next.js pages/components, FASTAPI routers/services
3) To the right: “OpenAI API” cloud
• UI → REST → API → DB → API → UI
• UI ↔ WebSocket ↔ API → OpenAI → API → DB