# hetshah24-06/ai-interview-prep architecture

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

- Interactive diagram: https://gitdiagram.com/hetshah24-06/ai-interview-prep
- Repository: https://github.com/hetshah24-06/ai-interview-prep
- Video tour (about a minute): https://gitdiagram.com/hetshah24-06/ai-interview-prep/video

## Overview

Interview Master supports account-based interview preparation: a user signs in, submits a job description and resume or self-description, receives a structured interview report, and can review reports or download a tailored resume PDF. The graph follows the sampled frontend routing and request handling into backend controllers, AI generation, and persistence. README-documented Gemini and PDF-rendering capabilities are included; unsampled cross-service wiring is marked optional or left out where the excerpts do not establish it.

Main entry points: [`Backend/src/routes/auth.routes.js`](https://github.com/hetshah24-06/ai-interview-prep/blob/main/Backend/src/routes/auth.routes.js) (Auth routes), [`Backend/src/routes/interview.routes.js`](https://github.com/hetshah24-06/ai-interview-prep/blob/main/Backend/src/routes/interview.routes.js) (Interview routes), [`Frontend/src/App.jsx`](https://github.com/hetshah24-06/ai-interview-prep/blob/main/Frontend/src/App.jsx) (Application shell), [`Frontend/src/app.routes.jsx`](https://github.com/hetshah24-06/ai-interview-prep/blob/main/Frontend/src/app.routes.jsx) (Page routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Application shell<br/>[App.jsx]"]
  node_routing["Page routing<br/>[app.routes.jsx]"]
  node_login["Login and register"]
  node_auth_hook["Auth actions<br/>[useAuth.js]"]
  node_auth_context["Session state<br/>[auth.context.jsx]"]
  node_auth_api["Auth API client<br/>[auth.api.js]"]
  node_home["Report submission<br/>[Home.jsx]"]
  node_report_view["Report viewer<br/>[Interview.jsx]"]
  node_interview_hook["Report actions<br/>[useInterview.js]"]
  node_interview_context["Report state"]
  node_interview_api["Interview API client<br/>[interview.api.js]"]
end

subgraph group_identity["Identity and access"]
  node_auth_routes["Auth routes<br/>[auth.routes.js]"]
  node_auth_controller["Account operations<br/>[auth.controller.js]"]
  node_auth_middleware["Session validation<br/>[auth.middleware.js]"]
  node_rate_limit["Login rate limit"]
end

subgraph group_interview["Interview preparation"]
  node_interview_routes["Interview routes"]
  node_upload["Resume upload<br/>[file.middleware.js]"]
  node_interview_controller["Report operations"]
  node_ai_service["AI generation<br/>[ai.service.js]"]
end

subgraph group_runtime["Backend runtime and state"]
  node_server["HTTP application<br/>[app.js]"]
  node_user_store[("User records<br/>[user.model.js]")]
  node_blacklist_store[("Token blacklist<br/>[blacklist.model.js]")]
  node_report_store[("Interview reports")]
end

node_user(("Candidate"))
node_gemini["Gemini"]
node_pdf_renderer["PDF renderer"]

node_user -->|"uses"| node_app
node_app -->|"mounts"| node_routing
node_app -->|"provides"| node_auth_context
node_app -->|"provides"| node_interview_context
node_routing -->|"routes to"| node_login
node_routing -->|"routes to"| node_home
node_routing -->|"routes to"| node_report_view
node_login -->|"uses"| node_auth_hook
node_auth_hook -->|"reads and updates"| node_auth_context
node_auth_hook -->|"calls"| node_auth_api
node_auth_context -->|"restores session via"| node_auth_api
node_home -->|"uses"| node_interview_hook
node_report_view -->|"uses"| node_interview_hook
node_interview_hook -->|"reads and updates"| node_interview_context
node_interview_hook -->|"calls"| node_interview_api
node_auth_api -.->|"requests auth endpoints"| node_auth_routes
node_interview_api -.->|"requests report endpoints"| node_interview_routes
node_server -->|"mounts"| node_auth_routes
node_server -->|"mounts"| node_interview_routes
node_auth_routes -->|"dispatches to"| node_auth_controller
node_auth_routes -->|"checks sessions"| node_auth_middleware
node_auth_routes -->|"limits login"| node_rate_limit
node_auth_controller -->|"reads and writes"| node_user_store
node_auth_controller -->|"blacklists token"| node_blacklist_store
node_auth_middleware -->|"checks token"| node_blacklist_store
node_interview_routes -->|"checks sessions"| node_auth_middleware
node_interview_routes -->|"accepts resume via"| node_upload
node_interview_routes -->|"dispatches to"| node_interview_controller
node_interview_controller -->|"generates report or PDF"| node_ai_service
node_interview_controller -->|"reads and writes"| node_report_store
node_interview_controller -->|"extracts uploaded PDF text"| node_upload
node_ai_service -->|"requests structured output"| node_gemini
node_ai_service -->|"renders resume PDF"| node_pdf_renderer

click node_app "https://github.com/hetshah24-06/ai-interview-prep/blob/main/Frontend/src/App.jsx"
click node_routing "https://github.com/hetshah24-06/ai-interview-prep/blob/main/Frontend/src/app.routes.jsx"
click node_login "https://github.com/hetshah24-06/ai-interview-prep/tree/main/Frontend/src/features/auth/pages"
click node_auth_hook "https://github.com/hetshah24-06/ai-interview-prep/blob/main/Frontend/src/features/auth/hooks/useAuth.js"
click node_auth_context "https://github.com/hetshah24-06/ai-interview-prep/blob/main/Frontend/src/features/auth/auth.context.jsx"
click node_auth_api "https://github.com/hetshah24-06/ai-interview-prep/blob/main/Frontend/src/features/auth/services/auth.api.js"
click node_home "https://github.com/hetshah24-06/ai-interview-prep/blob/main/Frontend/src/features/interview/pages/Home.jsx"
click node_report_view "https://github.com/hetshah24-06/ai-interview-prep/blob/main/Frontend/src/features/interview/pages/Interview.jsx"
click node_interview_hook "https://github.com/hetshah24-06/ai-interview-prep/blob/main/Frontend/src/features/interview/hooks/useInterview.js"
click node_interview_context "https://github.com/hetshah24-06/ai-interview-prep/blob/main/Frontend/src/features/interview/interview.context.jsx"
click node_interview_api "https://github.com/hetshah24-06/ai-interview-prep/blob/main/Frontend/src/features/interview/services/interview.api.js"
click node_server "https://github.com/hetshah24-06/ai-interview-prep/blob/main/Backend/src/app.js"
click node_auth_routes "https://github.com/hetshah24-06/ai-interview-prep/blob/main/Backend/src/routes/auth.routes.js"
click node_auth_controller "https://github.com/hetshah24-06/ai-interview-prep/blob/main/Backend/src/controllers/auth.controller.js"
click node_auth_middleware "https://github.com/hetshah24-06/ai-interview-prep/blob/main/Backend/src/middlewares/auth.middleware.js"
click node_rate_limit "https://github.com/hetshah24-06/ai-interview-prep/blob/main/Backend/src/middlewares/rateLimit.middleware.js"
click node_user_store "https://github.com/hetshah24-06/ai-interview-prep/blob/main/Backend/src/models/user.model.js"
click node_blacklist_store "https://github.com/hetshah24-06/ai-interview-prep/blob/main/Backend/src/models/blacklist.model.js"
click node_interview_routes "https://github.com/hetshah24-06/ai-interview-prep/blob/main/Backend/src/routes/interview.routes.js"
click node_upload "https://github.com/hetshah24-06/ai-interview-prep/blob/main/Backend/src/middlewares/file.middleware.js"
click node_interview_controller "https://github.com/hetshah24-06/ai-interview-prep/blob/main/Backend/src/controllers/interview.controller.js"
click node_ai_service "https://github.com/hetshah24-06/ai-interview-prep/blob/main/Backend/src/services/ai.service.js"
click node_report_store "https://github.com/hetshah24-06/ai-interview-prep/blob/main/Backend/src/models/interviewReport.model.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_app,node_routing,node_login,node_auth_hook,node_auth_context,node_auth_api,node_home,node_report_view,node_interview_hook,node_interview_context,node_interview_api toneBlue
class node_auth_routes,node_auth_controller,node_auth_middleware,node_rate_limit toneAmber
class node_interview_routes,node_upload,node_interview_controller,node_ai_service toneMint
class node_server,node_user_store,node_blacklist_store,node_report_store toneRose
class node_user,node_gemini,node_pdf_renderer toneIndigo
```

## Components

### Web client

- [Application shell](https://github.com/hetshah24-06/ai-interview-prep/blob/main/Frontend/src/App.jsx): `Frontend/src/App.jsx`
- [Page routing](https://github.com/hetshah24-06/ai-interview-prep/blob/main/Frontend/src/app.routes.jsx): `Frontend/src/app.routes.jsx`
- [Login and register](https://github.com/hetshah24-06/ai-interview-prep/tree/main/Frontend/src/features/auth/pages): `Frontend/src/features/auth/pages`
- [Auth actions](https://github.com/hetshah24-06/ai-interview-prep/blob/main/Frontend/src/features/auth/hooks/useAuth.js): `Frontend/src/features/auth/hooks/useAuth.js`
- [Session state](https://github.com/hetshah24-06/ai-interview-prep/blob/main/Frontend/src/features/auth/auth.context.jsx): `Frontend/src/features/auth/auth.context.jsx`
- [Auth API client](https://github.com/hetshah24-06/ai-interview-prep/blob/main/Frontend/src/features/auth/services/auth.api.js): `Frontend/src/features/auth/services/auth.api.js`
- [Report submission](https://github.com/hetshah24-06/ai-interview-prep/blob/main/Frontend/src/features/interview/pages/Home.jsx): `Frontend/src/features/interview/pages/Home.jsx`
- [Report viewer](https://github.com/hetshah24-06/ai-interview-prep/blob/main/Frontend/src/features/interview/pages/Interview.jsx): `Frontend/src/features/interview/pages/Interview.jsx`
- [Report actions](https://github.com/hetshah24-06/ai-interview-prep/blob/main/Frontend/src/features/interview/hooks/useInterview.js): `Frontend/src/features/interview/hooks/useInterview.js`
- [Report state](https://github.com/hetshah24-06/ai-interview-prep/blob/main/Frontend/src/features/interview/interview.context.jsx): `Frontend/src/features/interview/interview.context.jsx`
- [Interview API client](https://github.com/hetshah24-06/ai-interview-prep/blob/main/Frontend/src/features/interview/services/interview.api.js): `Frontend/src/features/interview/services/interview.api.js`

### Identity and access

- [Auth routes](https://github.com/hetshah24-06/ai-interview-prep/blob/main/Backend/src/routes/auth.routes.js): `Backend/src/routes/auth.routes.js`
- [Account operations](https://github.com/hetshah24-06/ai-interview-prep/blob/main/Backend/src/controllers/auth.controller.js): `Backend/src/controllers/auth.controller.js`
- [Session validation](https://github.com/hetshah24-06/ai-interview-prep/blob/main/Backend/src/middlewares/auth.middleware.js): `Backend/src/middlewares/auth.middleware.js`
- [Login rate limit](https://github.com/hetshah24-06/ai-interview-prep/blob/main/Backend/src/middlewares/rateLimit.middleware.js): `Backend/src/middlewares/rateLimit.middleware.js`

### Interview preparation

- [Interview routes](https://github.com/hetshah24-06/ai-interview-prep/blob/main/Backend/src/routes/interview.routes.js): `Backend/src/routes/interview.routes.js`
- [Resume upload](https://github.com/hetshah24-06/ai-interview-prep/blob/main/Backend/src/middlewares/file.middleware.js): `Backend/src/middlewares/file.middleware.js`
- [Report operations](https://github.com/hetshah24-06/ai-interview-prep/blob/main/Backend/src/controllers/interview.controller.js): `Backend/src/controllers/interview.controller.js`
- [AI generation](https://github.com/hetshah24-06/ai-interview-prep/blob/main/Backend/src/services/ai.service.js): `Backend/src/services/ai.service.js`

### Backend runtime and state

- [HTTP application](https://github.com/hetshah24-06/ai-interview-prep/blob/main/Backend/src/app.js): `Backend/src/app.js`
- [User records](https://github.com/hetshah24-06/ai-interview-prep/blob/main/Backend/src/models/user.model.js): `Backend/src/models/user.model.js`
- [Token blacklist](https://github.com/hetshah24-06/ai-interview-prep/blob/main/Backend/src/models/blacklist.model.js): `Backend/src/models/blacklist.model.js`
- [Interview reports](https://github.com/hetshah24-06/ai-interview-prep/blob/main/Backend/src/models/interviewReport.model.js): `Backend/src/models/interviewReport.model.js`

### Other components

- **Candidate**
- **Gemini**
- **PDF renderer**

## Connections

- Candidate → Application shell: uses (evidence: `README.md`)
- Application shell → Page routing: mounts (evidence: `Frontend/src/App.jsx`)
- Application shell → Session state: provides (evidence: `Frontend/src/App.jsx`)
- Application shell → Report state: provides (evidence: `Frontend/src/App.jsx`)
- Page routing → Login and register: routes to (evidence: `Frontend/src/app.routes.jsx`)
- Page routing → Report submission: routes to (evidence: `Frontend/src/app.routes.jsx`)
- Page routing → Report viewer: routes to (evidence: `Frontend/src/app.routes.jsx`)
- Login and register → Auth actions: uses (evidence: `Frontend/src/features/auth/pages/Login.jsx`)
- Auth actions → Session state: reads and updates (evidence: `Frontend/src/features/auth/hooks/useAuth.js`)
- Auth actions → Auth API client: calls (evidence: `Frontend/src/features/auth/hooks/useAuth.js`)
- Session state → Auth API client: restores session via (evidence: `Frontend/src/features/auth/auth.context.jsx`)
- Report submission → Report actions: uses (evidence: `Frontend/src/features/interview/pages/Home.jsx`)
- Report viewer → Report actions: uses (evidence: `Frontend/src/features/interview/pages/Interview.jsx`)
- Report actions → Report state: reads and updates (evidence: `Frontend/src/features/interview/hooks/useInterview.js`)
- Report actions → Interview API client: calls (evidence: `Frontend/src/features/interview/hooks/useInterview.js`)
- Auth API client → Auth routes: requests auth endpoints
- Interview API client → Interview routes: requests report endpoints
- HTTP application → Auth routes: mounts (evidence: `Backend/src/app.js`)
- HTTP application → Interview routes: mounts (evidence: `Backend/src/app.js`)
- Auth routes → Account operations: dispatches to (evidence: `Backend/src/routes/auth.routes.js`)
- Auth routes → Session validation: checks sessions (evidence: `Backend/src/routes/auth.routes.js`)
- Auth routes → Login rate limit: limits login (evidence: `Backend/src/routes/auth.routes.js`)
- Account operations → User records: reads and writes (evidence: `Backend/src/controllers/auth.controller.js`)
- Account operations → Token blacklist: blacklists token (evidence: `Backend/src/controllers/auth.controller.js`)
- Session validation → Token blacklist: checks token (evidence: `Backend/src/middlewares/auth.middleware.js`)
- Interview routes → Session validation: checks sessions (evidence: `Backend/src/routes/interview.routes.js`)
- Interview routes → Resume upload: accepts resume via (evidence: `Backend/src/routes/interview.routes.js`)
- Interview routes → Report operations: dispatches to (evidence: `Backend/src/routes/interview.routes.js`)
- Report operations → AI generation: generates report or PDF (evidence: `Backend/src/controllers/interview.controller.js`)
- Report operations → Interview reports: reads and writes (evidence: `Backend/src/controllers/interview.controller.js`)
- Report operations → Resume upload: extracts uploaded PDF text (evidence: `Backend/src/controllers/interview.controller.js`)
- AI generation → Gemini: requests structured output (evidence: `README.md`)
- AI generation → PDF renderer: renders resume PDF (evidence: `README.md`)
