# shreya22-prog/interview-ai-yt architecture

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

- Interactive diagram: https://gitdiagram.com/shreya22-prog/interview-ai-yt
- Repository: https://github.com/shreya22-prog/interview-ai-yt

## Overview

Interview AI is a candidate-facing platform for account access and AI-assisted interview preparation. A candidate registers or signs in, submits a job description with a PDF resume or self-description, and receives a tailored report; they can revisit report history and export a resume PDF. The client routes requests through the REST API, where authentication and upload handling precede report generation and persistence. The README documents Gemini analysis, structured report contents, and PDF export. Connections for unsampled client API and export implementation are based on README documentation, not inspected source.

Main entry points: [`Backend/src/controllers/interview.controller.js`](https://github.com/shreya22-prog/interview-ai-yt/blob/main/Backend/src/controllers/interview.controller.js) (Report operations), [`Backend/src/routes/interview.routes.js`](https://github.com/shreya22-prog/interview-ai-yt/blob/main/Backend/src/routes/interview.routes.js) (Interview routes), [`Backend/src/controllers/auth.controller.js`](https://github.com/shreya22-prog/interview-ai-yt/blob/main/Backend/src/controllers/auth.controller.js) (Account operations), [`Frontend/src/app.routes.jsx`](https://github.com/shreya22-prog/interview-ai-yt/blob/main/Frontend/src/app.routes.jsx) (App routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React application"]
  node_routes_ui["App routing<br/>[app.routes.jsx]"]
  node_auth_pages["Login and register"]
  node_auth_state["Auth state and actions<br/>[useAuth.js]"]
  node_auth_api["Auth API client<br/>[auth.api.js]"]
  node_interview_pages["Interview screens"]
  node_interview_state["Interview state and actions<br/>[useInterview.js]"]
  node_interview_api["Interview API client<br/>[interview.api.js]"]
end

subgraph group_api["REST API"]
  node_auth_routes["Auth routes<br/>[auth.routes.js]"]
  node_interview_routes["Interview routes"]
  node_auth_guard["JWT auth guard<br/>[auth.middleware.js]"]
  node_resume_upload["Resume upload<br/>[file.middleware.js]"]
  node_auth_controller["Account operations<br/>[auth.controller.js]"]
  node_interview_controller["Report operations"]
  node_pdf_extract["PDF text extraction"]
end

subgraph group_intelligence["AI preparation"]
  node_ai_service["Report and resume generation<br/>[ai.service.js]"]
  node_pdf_export["Resume PDF rendering"]
end

subgraph group_storage["Persistence"]
  node_user_data[("User records<br/>[user.model.js]")]
  node_report_data[("Interview reports")]
  node_blacklist_data[("Token blacklist<br/>[blacklist.model.js]")]
end

node_candidate(("Candidate"))
node_gemini{{"Google Gemini"}}
node_mongodb[("MongoDB")]

node_candidate -->|"uses"| node_routes_ui
node_routes_ui -->|"routes to"| node_auth_pages
node_routes_ui -->|"routes to"| node_interview_pages
node_candidate -.->|"submits credentials"| node_auth_pages
node_auth_pages -->|"uses"| node_auth_state
node_auth_state -->|"calls"| node_auth_api
node_auth_api -.->|"requests"| node_auth_routes
node_auth_routes -->|"dispatches"| node_auth_controller
node_auth_routes -->|"guards profile lookup"| node_auth_guard
node_auth_controller -->|"reads and writes"| node_user_data
node_auth_controller -->|"blacklists tokens"| node_blacklist_data
node_auth_guard -->|"checks tokens"| node_blacklist_data
node_interview_pages -->|"uses"| node_interview_state
node_interview_state -->|"calls"| node_interview_api
node_candidate -->|"provides profile and role"| node_interview_pages
node_interview_api -.->|"requests"| node_interview_routes
node_interview_routes -->|"authenticates"| node_auth_guard
node_interview_routes -->|"parses upload"| node_resume_upload
node_interview_routes -->|"dispatches"| node_interview_controller
node_interview_controller -->|"extracts resume text"| node_pdf_extract
node_interview_controller -->|"requests report"| node_ai_service
node_ai_service -->|"generates analysis"| node_gemini
node_interview_controller -->|"stores and retrieves"| node_report_data
node_auth_controller -.->|"persists account state"| node_mongodb
node_interview_controller -.->|"persists reports"| node_mongodb
node_interview_controller -->|"requests PDF"| node_pdf_export
node_pdf_export -->|"downloads tailored PDF"| node_candidate
node_report_data -->|"stored in"| node_mongodb

click node_routes_ui "https://github.com/shreya22-prog/interview-ai-yt/blob/main/Frontend/src/app.routes.jsx"
click node_auth_pages "https://github.com/shreya22-prog/interview-ai-yt/tree/main/Frontend/src/features/auth/pages"
click node_auth_state "https://github.com/shreya22-prog/interview-ai-yt/blob/main/Frontend/src/features/auth/hooks/useAuth.js"
click node_auth_api "https://github.com/shreya22-prog/interview-ai-yt/blob/main/Frontend/src/features/auth/services/auth.api.js"
click node_interview_pages "https://github.com/shreya22-prog/interview-ai-yt/tree/main/Frontend/src/features/interview/pages"
click node_interview_state "https://github.com/shreya22-prog/interview-ai-yt/blob/main/Frontend/src/features/interview/hooks/useInterview.js"
click node_interview_api "https://github.com/shreya22-prog/interview-ai-yt/blob/main/Frontend/src/features/interview/services/interview.api.js"
click node_auth_routes "https://github.com/shreya22-prog/interview-ai-yt/blob/main/Backend/src/routes/auth.routes.js"
click node_interview_routes "https://github.com/shreya22-prog/interview-ai-yt/blob/main/Backend/src/routes/interview.routes.js"
click node_auth_guard "https://github.com/shreya22-prog/interview-ai-yt/blob/main/Backend/src/middlewares/auth.middleware.js"
click node_resume_upload "https://github.com/shreya22-prog/interview-ai-yt/blob/main/Backend/src/middlewares/file.middleware.js"
click node_auth_controller "https://github.com/shreya22-prog/interview-ai-yt/blob/main/Backend/src/controllers/auth.controller.js"
click node_interview_controller "https://github.com/shreya22-prog/interview-ai-yt/blob/main/Backend/src/controllers/interview.controller.js"
click node_pdf_extract "https://github.com/shreya22-prog/interview-ai-yt/blob/main/Backend/src/controllers/interview.controller.js"
click node_ai_service "https://github.com/shreya22-prog/interview-ai-yt/blob/main/Backend/src/services/ai.service.js"
click node_pdf_export "https://github.com/shreya22-prog/interview-ai-yt/tree/main/Backend/src/services"
click node_user_data "https://github.com/shreya22-prog/interview-ai-yt/blob/main/Backend/src/models/user.model.js"
click node_report_data "https://github.com/shreya22-prog/interview-ai-yt/blob/main/Backend/src/models/interviewReport.model.js"
click node_blacklist_data "https://github.com/shreya22-prog/interview-ai-yt/blob/main/Backend/src/models/blacklist.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_routes_ui,node_auth_pages,node_auth_state,node_auth_api,node_interview_pages,node_interview_state,node_interview_api toneBlue
class node_auth_routes,node_interview_routes,node_auth_guard,node_resume_upload,node_auth_controller,node_interview_controller,node_pdf_extract,node_mongodb toneAmber
class node_ai_service,node_pdf_export toneMint
class node_user_data,node_report_data,node_blacklist_data toneRose
class node_candidate,node_gemini toneIndigo
```

## Components

### React application

- [App routing](https://github.com/shreya22-prog/interview-ai-yt/blob/main/Frontend/src/app.routes.jsx): `Frontend/src/app.routes.jsx`
- [Login and register](https://github.com/shreya22-prog/interview-ai-yt/tree/main/Frontend/src/features/auth/pages): `Frontend/src/features/auth/pages`
- [Auth state and actions](https://github.com/shreya22-prog/interview-ai-yt/blob/main/Frontend/src/features/auth/hooks/useAuth.js): `Frontend/src/features/auth/hooks/useAuth.js`
- [Auth API client](https://github.com/shreya22-prog/interview-ai-yt/blob/main/Frontend/src/features/auth/services/auth.api.js): `Frontend/src/features/auth/services/auth.api.js`
- [Interview screens](https://github.com/shreya22-prog/interview-ai-yt/tree/main/Frontend/src/features/interview/pages): `Frontend/src/features/interview/pages`
- [Interview state and actions](https://github.com/shreya22-prog/interview-ai-yt/blob/main/Frontend/src/features/interview/hooks/useInterview.js): `Frontend/src/features/interview/hooks/useInterview.js`
- [Interview API client](https://github.com/shreya22-prog/interview-ai-yt/blob/main/Frontend/src/features/interview/services/interview.api.js): `Frontend/src/features/interview/services/interview.api.js`

### REST API

- [Auth routes](https://github.com/shreya22-prog/interview-ai-yt/blob/main/Backend/src/routes/auth.routes.js): `Backend/src/routes/auth.routes.js`
- [Interview routes](https://github.com/shreya22-prog/interview-ai-yt/blob/main/Backend/src/routes/interview.routes.js): `Backend/src/routes/interview.routes.js`
- [JWT auth guard](https://github.com/shreya22-prog/interview-ai-yt/blob/main/Backend/src/middlewares/auth.middleware.js): `Backend/src/middlewares/auth.middleware.js`
- [Resume upload](https://github.com/shreya22-prog/interview-ai-yt/blob/main/Backend/src/middlewares/file.middleware.js): `Backend/src/middlewares/file.middleware.js`
- [Account operations](https://github.com/shreya22-prog/interview-ai-yt/blob/main/Backend/src/controllers/auth.controller.js): `Backend/src/controllers/auth.controller.js`
- [Report operations](https://github.com/shreya22-prog/interview-ai-yt/blob/main/Backend/src/controllers/interview.controller.js): `Backend/src/controllers/interview.controller.js`
- [PDF text extraction](https://github.com/shreya22-prog/interview-ai-yt/blob/main/Backend/src/controllers/interview.controller.js): `Backend/src/controllers/interview.controller.js`

### AI preparation

- [Report and resume generation](https://github.com/shreya22-prog/interview-ai-yt/blob/main/Backend/src/services/ai.service.js): `Backend/src/services/ai.service.js`
- [Resume PDF rendering](https://github.com/shreya22-prog/interview-ai-yt/tree/main/Backend/src/services): `Backend/src/services`

### Persistence

- [User records](https://github.com/shreya22-prog/interview-ai-yt/blob/main/Backend/src/models/user.model.js): `Backend/src/models/user.model.js`
- [Interview reports](https://github.com/shreya22-prog/interview-ai-yt/blob/main/Backend/src/models/interviewReport.model.js): `Backend/src/models/interviewReport.model.js`
- [Token blacklist](https://github.com/shreya22-prog/interview-ai-yt/blob/main/Backend/src/models/blacklist.model.js): `Backend/src/models/blacklist.model.js`

### Other components

- **Candidate**
- **Google Gemini**
- **MongoDB**

## Connections

- Candidate → App routing: uses (evidence: `README.md`)
- App routing → Login and register: routes to (evidence: `Frontend/src/app.routes.jsx`)
- App routing → Interview screens: routes to (evidence: `Frontend/src/app.routes.jsx`)
- Candidate → Login and register: submits credentials (evidence: `README.md`)
- Login and register → Auth state and actions: uses (evidence: `Frontend/src/features/auth/hooks/useAuth.js`)
- Auth state and actions → Auth API client: calls (evidence: `Frontend/src/features/auth/hooks/useAuth.js`)
- Auth API client → Auth routes: requests (evidence: `README.md`)
- Auth routes → Account operations: dispatches (evidence: `Backend/src/routes/auth.routes.js`)
- Auth routes → JWT auth guard: guards profile lookup (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 tokens (evidence: `Backend/src/controllers/auth.controller.js`)
- JWT auth guard → Token blacklist: checks tokens (evidence: `Backend/src/middlewares/auth.middleware.js`)
- Interview screens → Interview state and actions: uses (evidence: `Frontend/src/features/interview/hooks/useInterview.js`)
- Interview state and actions → Interview API client: calls (evidence: `Frontend/src/features/interview/hooks/useInterview.js`)
- Candidate → Interview screens: provides profile and role (evidence: `README.md`)
- Interview API client → Interview routes: requests (evidence: `README.md`)
- Interview routes → JWT auth guard: authenticates (evidence: `Backend/src/routes/interview.routes.js`)
- Interview routes → Resume upload: parses upload (evidence: `Backend/src/routes/interview.routes.js`)
- Interview routes → Report operations: dispatches (evidence: `Backend/src/routes/interview.routes.js`)
- Report operations → PDF text extraction: extracts resume text (evidence: `Backend/src/controllers/interview.controller.js`)
- Report operations → Report and resume generation: requests report (evidence: `Backend/src/controllers/interview.controller.js`)
- Report and resume generation → Google Gemini: generates analysis (evidence: `README.md`)
- Report operations → Interview reports: stores and retrieves (evidence: `Backend/src/controllers/interview.controller.js`)
- Account operations → MongoDB: persists account state
- Report operations → MongoDB: persists reports
- Report operations → Resume PDF rendering: requests PDF (evidence: `README.md`)
- Resume PDF rendering → Candidate: downloads tailored PDF (evidence: `README.md`)
- Interview reports → MongoDB: stored in (evidence: `README.md`)
