# yashh0225/job-prep-platform architecture

> Architecture diagram of the GitHub repository yashh0225/job-prep-platform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yashh0225/job-prep-platform
- Repository: https://github.com/yashh0225/job-prep-platform

## Overview

1. **Overall shape**
   - This is a two-tier job-prep platform: a **React/Vite SPA** in `client/` and an **Express/MongoDB API** in `server/`.
   - The frontend owns the user experience and route transitions; the backend owns authentication, AI workflows, persistence, and history.

2. **Frontend shell and navigation**
   - `client/src/App.jsx` and `client/src/main.jsx` are the SPA entry points.
   - Pages are organized by product flow: **Landing, Login, Register, VerifyOTP, AuthCallback, Dashboard, ResumeAnalyzer, RoadmapGenerator, RoadmapView, MockSetup, MockInterview, MockResult, History**.
   - `ProtectedRoute.jsx` indicates that most product features are gated behind authentication.

3. **Frontend state and cross-cutting UI**
   - `AuthContext.jsx` centralizes signed-in state and user/session handling.
   - `ToastContext.jsx` handles user-facing notifications.
   - Shared UI components such as `Navbar`, `Sidebar`, and `SkillGauge` support the app shell and progress visualization.

4. **Frontend feature components**
   - `FileUpload.jsx` is the main entry point for resume/doc ingestion.
   - `AudioRecorder.jsx` supports voice-based interview responses.
   - `CodeEditor.jsx` supports coding/DSA interview questions.
   - These components map directly to the platform’s core workflows: resume analysis and multi-format mock interviews.

5. **Frontend-to-backend communication**
   - `client/src/services/api.js` is the main HTTP boundary from the SPA to the API.
   - The frontend is configured for deployment separately (`client/vercel.json`), and the runtime target backend is injected via environment variables like `VITE_API_URL`.

6. **Backend application structure**
   - `server/server.js` is the API entry point.
   - Express routes are split by domain:
     - `routes/auth.js`
     - `routes/analysis.js`
     - `routes/roadmap.js`
     - `routes/interview.js`
   - This suggests a clear domain boundary between identity, AI analysis, learning plans, and interview sessions.

7. **Authentication subsystem**
   - Authentication is a mix of **JWT**, **Google OAuth**, and **OTP email verification**.
   - `config/passport.js` handles Google OAuth integration.
   - `middleware/auth.js` protects API routes that require a valid session/token.
   - `models/User.js` persists accounts and auth-related user state.
   - `services/email.js` supports OTP delivery and verification flows.

8. **AI-powered resume analysis**
   - `routes/analysis.js` likely orchestrates resume vs job-description evaluation.
   - `services/gemini.js` is the AI integration point; the README identifies **Google Gemini 2.5 Flash** as the model provider.
   - `models/AnalysisSession.js` stores the output/history of analysis runs, so results can be revisited later.

9. **Roadmap generation and tracking**
   - `routes/roadmap.js` and `models/Roadmap.js` form the study-plan subsystem.
   - The flow is: user context + AI generation -> persisted roadmap -> view/update in the UI (`RoadmapGenerator`, `RoadmapView`).
   - This subsystem is distinct from interview evaluation: it produces a longer-lived learning plan rather than a one-off assessment.

10. **Mock interview subsystem**
   - `routes/interview.js` and `models/MockInterview.js` power the interview experience and its saved results.
   - The frontend supports multiple interaction modes: **coding/DSA**, **technical text/audio**, **HR/behavioral text/audio**, and **CS fundamentals MCQ/descriptive**.
   - `MockSetup` configures the session, `MockInterview` runs it, and `MockResult` shows scoring and recommendation output.

11. **Persistence and data flow**
   - MongoDB is the system of record, accessed through Mongoose models in `server/models/`.
   - Core persisted entities are **users**, **analysis sessions**, **roadmaps**, and **mock interview sessions**.
   - The main data flow is: **user input in React → API request → Express route → auth/validation → AI/service call → MongoDB write/read → results returned to UI**.

12. **Infrastructure and deployment**
   - The backend is containerized with `server/Dockerfile`, which matters for Render-style deployment.
   - The README describes a split deployment model: **Vercel for the frontend** and **Render for the backend**.
   - `CLIENT_URL` and other environment variables are used to bind the two halves together securely across origins.

13. **What to show in an architecture diagram**
   - Draw three main boundaries: **browser SPA**, **API server**, and **MongoDB/externals**.
   - Inside the API boundary, separate **Auth**, **AI/Analysis**, **Roadmaps**, and **Interview Evaluation**.
   - External services to show explicitly: **Google Gemini** for AI, **Google OAuth** for login, and **email delivery** for OTP verification.

Main entry points: [`client/src/App.jsx`](https://github.com/yashh0225/job-prep-platform/blob/main/client/src/App.jsx) (Routes), [`server/server.js`](https://github.com/yashh0225/job-prep-platform/blob/main/server/server.js) (Server entry), [`server/routes/auth.js`](https://github.com/yashh0225/job-prep-platform/blob/main/server/routes/auth.js) (Auth API), [`client/src/services/api.js`](https://github.com/yashh0225/job-prep-platform/blob/main/client/src/services/api.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser SPA"]
  node_client_entry["App shell<br/>React/Vite entry<br/>[main.jsx]"]
  node_client_app["Routes<br/>SPA router<br/>[App.jsx]"]
  node_client_auth(("Auth state<br/>context<br/>[AuthContext.jsx]"))
  node_client_toast(("Toasts<br/>context<br/>[ToastContext.jsx]"))
  node_client_guard{{"Protected route<br/>route guard<br/>[ProtectedRoute.jsx]"}}
  node_client_shell["Shell UI<br/>layout components<br/>[Navbar.jsx]"]
  node_client_upload["Resume upload<br/>input component<br/>[FileUpload.jsx]"]
  node_client_voice(("Voice input<br/>interview input<br/>[AudioRecorder.jsx]"))
  node_client_code["Code editor<br/>interview input<br/>[CodeEditor.jsx]"]
  node_client_api["API client<br/>HTTP boundary<br/>[api.js]"]
end

subgraph group_server["API Server"]
  node_server_entry["Server entry<br/>Express bootstrap<br/>[server.js]"]
  node_server_auth["Auth API<br/>route domain<br/>[auth.js]"]
  node_server_analysis["Analysis API<br/>route domain<br/>[analysis.js]"]
  node_server_roadmap["Roadmap API<br/>route domain<br/>[roadmap.js]"]
  node_server_interview["Interview API<br/>route domain<br/>[interview.js]"]
  node_server_models[("Mongo models<br/>persistence layer<br/>[User.js]")]
  node_server_gemini{{"Gemini service<br/>AI integration<br/>[gemini.js]"}}
  node_server_email{{"Email service<br/>delivery service<br/>[email.js]"}}
  node_server_passport{{"Google OAuth<br/>auth strategy<br/>[passport.js]"}}
  node_server_authmw{{"Auth middleware<br/>[auth.js]"}}
end

subgraph group_externals["External Services"]
  node_db[("MongoDB<br/>database")]
  node_gemini_ext{{"Google Gemini<br/>external AI"}}
  node_oauth_ext{{"Google OAuth<br/>external identity"}}
  node_email_ext{{"Email provider<br/>external delivery"}}
end

node_client_entry -->|"bootstraps"| node_client_app
node_client_app -->|"reads session"| node_client_auth
node_client_app -->|"protects"| node_client_guard
node_client_app -->|"renders shell"| node_client_shell
node_client_app -->|"resume flow"| node_client_upload
node_client_app -->|"interview flow"| node_client_voice
node_client_app -->|"interview flow"| node_client_code
node_client_app -->|"notifies"| node_client_toast
node_client_api -->|"requests"| node_server_entry
node_server_entry -->|"mounts"| node_server_auth
node_server_entry -->|"mounts"| node_server_analysis
node_server_entry -->|"mounts"| node_server_roadmap
node_server_entry -->|"mounts"| node_server_interview
node_server_auth -->|"uses"| node_server_authmw
node_server_auth -->|"delegates OAuth"| node_server_passport
node_server_auth -->|"sends OTP"| node_server_email
node_server_analysis -->|"calls AI"| node_server_gemini
node_server_roadmap -->|"calls AI"| node_server_gemini
node_server_interview -->|"calls AI"| node_server_gemini
node_server_analysis -->|"reads/writes"| node_server_models
node_server_roadmap -->|"reads/writes"| node_server_models
node_server_interview -->|"reads/writes"| node_server_models
node_server_auth -->|"reads/writes"| node_server_models
node_server_models -->|"persists to"| node_db
node_server_gemini -->|"depends on"| node_gemini_ext
node_server_passport -->|"delegates to"| node_oauth_ext
node_server_email -->|"delivers via"| node_email_ext
node_client_auth -->|"auth headers"| node_client_api
node_client_upload -->|"submits file"| node_client_api
node_client_voice -->|"submits audio"| node_client_api
node_client_code -->|"submits code"| node_client_api

click node_client_entry "https://github.com/yashh0225/job-prep-platform/blob/main/client/src/main.jsx"
click node_client_app "https://github.com/yashh0225/job-prep-platform/blob/main/client/src/App.jsx"
click node_client_auth "https://github.com/yashh0225/job-prep-platform/blob/main/client/src/context/AuthContext.jsx"
click node_client_toast "https://github.com/yashh0225/job-prep-platform/blob/main/client/src/context/ToastContext.jsx"
click node_client_guard "https://github.com/yashh0225/job-prep-platform/blob/main/client/src/components/ProtectedRoute.jsx"
click node_client_shell "https://github.com/yashh0225/job-prep-platform/blob/main/client/src/components/Navbar.jsx"
click node_client_upload "https://github.com/yashh0225/job-prep-platform/blob/main/client/src/components/FileUpload.jsx"
click node_client_voice "https://github.com/yashh0225/job-prep-platform/blob/main/client/src/components/AudioRecorder.jsx"
click node_client_code "https://github.com/yashh0225/job-prep-platform/blob/main/client/src/components/CodeEditor.jsx"
click node_client_api "https://github.com/yashh0225/job-prep-platform/blob/main/client/src/services/api.js"
click node_server_entry "https://github.com/yashh0225/job-prep-platform/blob/main/server/server.js"
click node_server_auth "https://github.com/yashh0225/job-prep-platform/blob/main/server/routes/auth.js"
click node_server_analysis "https://github.com/yashh0225/job-prep-platform/blob/main/server/routes/analysis.js"
click node_server_roadmap "https://github.com/yashh0225/job-prep-platform/blob/main/server/routes/roadmap.js"
click node_server_interview "https://github.com/yashh0225/job-prep-platform/blob/main/server/routes/interview.js"
click node_server_models "https://github.com/yashh0225/job-prep-platform/blob/main/server/models/User.js"
click node_server_gemini "https://github.com/yashh0225/job-prep-platform/blob/main/server/services/gemini.js"
click node_server_email "https://github.com/yashh0225/job-prep-platform/blob/main/server/services/email.js"
click node_server_passport "https://github.com/yashh0225/job-prep-platform/blob/main/server/config/passport.js"
click node_server_authmw "https://github.com/yashh0225/job-prep-platform/blob/main/server/middleware/auth.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_client_entry,node_client_app,node_client_auth,node_client_toast,node_client_guard,node_client_shell,node_client_upload,node_client_voice,node_client_code,node_client_api toneBlue
class node_server_entry,node_server_auth,node_server_analysis,node_server_roadmap,node_server_interview,node_server_models,node_server_gemini,node_server_email,node_server_passport,node_server_authmw toneAmber
class node_db,node_gemini_ext,node_oauth_ext,node_email_ext toneMint
```

## Components

### Browser SPA

React/Vite frontend for user flows and authenticated product screens.

- [App shell](https://github.com/yashh0225/job-prep-platform/blob/main/client/src/main.jsx): React/Vite entry · SPA bootstrap and top-level routing. · `client/src/main.jsx`
- [Routes](https://github.com/yashh0225/job-prep-platform/blob/main/client/src/App.jsx): SPA router · Coordinates landing, auth, dashboard, and product pages. · `client/src/App.jsx`
- [Auth state](https://github.com/yashh0225/job-prep-platform/blob/main/client/src/context/AuthContext.jsx): context · Signed-in session and user state shared across the app. · `client/src/context/AuthContext.jsx`
- [Toasts](https://github.com/yashh0225/job-prep-platform/blob/main/client/src/context/ToastContext.jsx): context · User-facing notifications and transient feedback. · `client/src/context/ToastContext.jsx`
- [Protected route](https://github.com/yashh0225/job-prep-platform/blob/main/client/src/components/ProtectedRoute.jsx): route guard · Blocks access to authenticated product flows. · `client/src/components/ProtectedRoute.jsx`
- [Shell UI](https://github.com/yashh0225/job-prep-platform/blob/main/client/src/components/Navbar.jsx): layout components · Shared navigation and progress UI for the authenticated experience. · `client/src/components/Navbar.jsx`
- [Resume upload](https://github.com/yashh0225/job-prep-platform/blob/main/client/src/components/FileUpload.jsx): input component · Ingests resume or document files for analysis workflows. · `client/src/components/FileUpload.jsx`
- [Voice input](https://github.com/yashh0225/job-prep-platform/blob/main/client/src/components/AudioRecorder.jsx): interview input · Captures spoken interview answers. · `client/src/components/AudioRecorder.jsx`
- [Code editor](https://github.com/yashh0225/job-prep-platform/blob/main/client/src/components/CodeEditor.jsx): interview input · Supports coding and DSA-style interview responses. · `client/src/components/CodeEditor.jsx`
- [API client](https://github.com/yashh0225/job-prep-platform/blob/main/client/src/services/api.js): HTTP boundary · Main frontend service layer for backend requests. · `client/src/services/api.js`

### API Server

Express backend for auth, AI workflows, and persisted user data.

- [Server entry](https://github.com/yashh0225/job-prep-platform/blob/main/server/server.js): Express bootstrap · Starts the API and wires routes and middleware. · `server/server.js`
- [Auth API](https://github.com/yashh0225/job-prep-platform/blob/main/server/routes/auth.js): route domain · Login, registration, OAuth, OTP, and session validation. · `server/routes/auth.js`
- [Analysis API](https://github.com/yashh0225/job-prep-platform/blob/main/server/routes/analysis.js): route domain · Resume and job-description analysis workflows. · `server/routes/analysis.js`
- [Roadmap API](https://github.com/yashh0225/job-prep-platform/blob/main/server/routes/roadmap.js): route domain · Generates and serves learning plans. · `server/routes/roadmap.js`
- [Interview API](https://github.com/yashh0225/job-prep-platform/blob/main/server/routes/interview.js): route domain · Runs mock interview sessions and stores outcomes. · `server/routes/interview.js`
- [Mongo models](https://github.com/yashh0225/job-prep-platform/blob/main/server/models/User.js): persistence layer · Mongoose models for users, analysis sessions, roadmaps, and interviews. · `server/models/User.js`
- [Gemini service](https://github.com/yashh0225/job-prep-platform/blob/main/server/services/gemini.js): AI integration · Google Gemini-powered generation and scoring logic. · `server/services/gemini.js`
- [Email service](https://github.com/yashh0225/job-prep-platform/blob/main/server/services/email.js): delivery service · Sends OTP and verification emails. · `server/services/email.js`
- [Google OAuth](https://github.com/yashh0225/job-prep-platform/blob/main/server/config/passport.js): auth strategy · Passport integration for Google sign-in. · `server/config/passport.js`
- [Auth middleware](https://github.com/yashh0225/job-prep-platform/blob/main/server/middleware/auth.js): middleware · Protects API routes that require valid auth. · `server/middleware/auth.js`

### External Services

Third-party and infrastructure dependencies used by the app.

- **MongoDB**: database · System of record for user accounts and saved product artifacts.
- **Google Gemini**: external AI · LLM provider used for analysis, roadmap, and interview generation.
- **Google OAuth**: external identity · Third-party identity provider for social login.
- **Email provider**: external delivery · Outbound email infrastructure for OTP delivery.

## Connections

- App shell → Routes: bootstraps · Initializes the SPA and renders route structure.
- Routes → Auth state: reads session · Uses auth state to decide which flows are available.
- Routes → Protected route: protects · Wraps authenticated pages behind access checks.
- Routes → Shell UI: renders shell · Provides shared navigation and layout on product screens.
- Routes → Resume upload: resume flow · Routes to the analysis entry point.
- Routes → Voice input: interview flow · Supports spoken interview answers.
- Routes → Code editor: interview flow · Supports coding interview answers.
- Routes → Toasts: notifies · Surfaces success and error feedback.
- API client → Server entry: requests · Frontend API calls target the backend entry point.
- Server entry → Auth API: mounts · Registers authentication routes.
- Server entry → Analysis API: mounts · Registers analysis routes.
- Server entry → Roadmap API: mounts · Registers roadmap routes.
- Server entry → Interview API: mounts · Registers interview routes.
- Auth API → Auth middleware: uses · Protects authenticated auth endpoints where needed.
- Auth API → Google OAuth: delegates OAuth · Uses Passport for Google sign-in.
- Auth API → Email service: sends OTP · Triggers verification email delivery.
- Analysis API → Gemini service: calls AI · Generates or evaluates resume analysis outputs.
- Roadmap API → Gemini service: calls AI · Builds personalized learning plans.
- Interview API → Gemini service: calls AI · Produces questions, scoring, or recommendations.
- Analysis API → Mongo models: reads/writes · Persists analysis sessions and history.
- Roadmap API → Mongo models: reads/writes · Stores roadmap plans for later viewing.
- Interview API → Mongo models: reads/writes · Stores mock interview sessions and results.
- Auth API → Mongo models: reads/writes · Persists user accounts and auth state.
- Mongo models → MongoDB: persists to · All core entities are stored in MongoDB.
- Gemini service → Google Gemini: depends on · Uses Google Gemini as the model provider.
- Google OAuth → Google OAuth: delegates to · Authenticates users through Google.
- Email service → Email provider: delivers via · Sends OTP messages through external email infrastructure.
- Auth state → API client: auth headers · Session state informs authenticated requests.
- Resume upload → API client: submits file · Uploads resume content to analysis endpoints.
- Voice input → API client: submits audio · Sends recorded interview responses.
- Code editor → API client: submits code · Sends code interview responses.
