How chetan1930/ai-interview works
PrepAI is a Next.js interview-preparation and resume-analysis application. Its main workflow collects a job description or role, generates tailored preparation material, and presents it for study; separate flows support mock interviews, chat imports, and resume feedback. Authentication and API-key management support these features, while session history is exposed through API routes and MongoDB models. The README describes locally persisted browser state, but sampled code also includes database-backed session APIs. Some UI-to-API links are documented broadly rather than shown in sampled route calls.
Main entry points: ai.ts AI Generation · sessions/route.ts Session API · mongodb.ts MongoDB Connector · keys/route.ts Key Management API
Components 26
Interview Preparation
- JD Preparation
app/(app)/interview-prep/page.tsx - Role Preparation
app/(app)/interview-prep/page.tsx - Prep Results
components/interview/interview-results.tsx - Dashboard
app/(app)/dashboard/page.tsx
Practice and Imports
- Mock Interview
app/(app)/voice-interview/page.tsx - Chat Import
app/(app)/chat-import/page.tsx - Chat Messages
components/chat/chat-message.tsx - Voice Recorder
components/voice/voice-recorder.tsx
Resume Analysis
- Resume Analyzer
app/(app)/resume-analyzer/page.tsx - Resume Upload
components/resume/resume-upload.tsx - Resume Results
components/resume/analysis-results.tsx
Accounts and Settings
- Login and Signup
app/login/page.tsx - Auth Context
contexts/auth.tsx - Auth API
app/api/auth/signup/route.ts - API Key Settings
app/(app)/settings/page.tsx - Key Management API
app/api/keys/route.ts
AI and Data
- Session API
app/api/sessions/route.ts - Session Records
lib/models/Session.ts - AI Generation
lib/ai.ts - Prompt Builders
lib/prompts.ts - Provider Keys
lib/models/ApiKey.ts - MongoDB Connector
lib/mongodb.ts
Other components
- Candidate
- Google Gemini
- OpenAI
- Anthropic
Connections 31
- Candidate → JD Preparation: enters JD
README.md - Candidate → Role Preparation: enters role
README.md - JD Preparation → AI Generation: requests generation
README.md - Role Preparation → AI Generation: requests generation
README.md - AI Generation → Prep Results: returns prep
- Candidate → Mock Interview: starts practice
README.md - Mock Interview → Chat Messages: renders messages
app/(app)/voice-interview/page.tsx - Mock Interview → Voice Recorder: uses recorder
app/(app)/voice-interview/page.tsx - Candidate → Chat Import: imports conversation
app/(app)/chat-import/page.tsx - Chat Import → Session API: loads recent imports
app/(app)/chat-import/page.tsx - Candidate → Resume Analyzer: analyzes resume
README.md - Resume Analyzer → Resume Upload: accepts resume
- Resume Analyzer → AI Generation: requests analysis
README.md - AI Generation → Resume Results: returns analysis
- Candidate → Login and Signup: signs in
app/login/page.tsx - Login and Signup → Auth Context: calls auth
app/login/page.tsx - Auth API → MongoDB Connector: connects database
app/api/auth/signup/route.ts - Auth API → Auth Context: serves auth requests
- Candidate → API Key Settings: manages keys
- Key Management API → MongoDB Connector: connects database
app/api/keys/route.ts - Key Management API → Provider Keys: reads and writes
app/api/keys/route.ts - Key Management API → AI Generation: provides key records
- AI Generation → Provider Keys: loads user keys
lib/ai.ts - AI Generation → MongoDB Connector: connects for keys
lib/ai.ts - Session API → MongoDB Connector: connects database
app/api/sessions/route.ts - Session API → Session Records: reads and writes
app/api/sessions/route.ts - Dashboard → Session API: shows recent sessions
- AI Generation → Prompt Builders: builds prompts
lib/ai.ts - AI Generation → Google Gemini: generates content
lib/ai.ts - AI Generation → OpenAI: generates content
lib/ai.ts - AI Generation → Anthropic: generates content
lib/ai.ts