# gauranshsahu/interview-ai architecture

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

- Interactive diagram: https://gitdiagram.com/gauranshsahu/interview-ai
- Repository: https://github.com/gauranshsahu/interview-ai

## Overview

Interview-AI is a web application for account-based AI interview preparation. Users register or log in, enter the protected interview experience, and submit a resume PDF with a job description and self-description; the backend extracts resume text, asks its AI service to generate a report, and stores the report. The graph also shows authentication, session checks, and logout. The README is empty, so capability coverage is based on the supplied source index and excerpts; unsampled behavior and integrations are not inferred.

Main entry points: [`Frontend/Interview-AI/src/app.routes.jsx`](https://github.com/gauranshsahu/interview-ai/blob/main/Frontend/Interview-AI/src/app.routes.jsx) (Page router), [`Frontend/Interview-AI/src/Features/auth/hooks/useAuth.js`](https://github.com/gauranshsahu/interview-ai/blob/main/Frontend/Interview-AI/src/Features/auth/hooks/useAuth.js) (Auth actions), [`Backend/src/routes/interview.routes.js`](https://github.com/gauranshsahu/interview-ai/blob/main/Backend/src/routes/interview.routes.js) (Interview route), [`Backend/src/routes/auth.routes.js`](https://github.com/gauranshsahu/interview-ai/blob/main/Backend/src/routes/auth.routes.js) (Auth routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["App shell<br/>[App.jsx]"]
  node_routes["Page router<br/>[app.routes.jsx]"]
  node_login["Login page<br/>[login.jsx]"]
  node_register["Register page<br/>[register.jsx]"]
  node_protected["Protected page gate<br/>[protected.jsx]"]
  node_auth_hook["Auth actions<br/>[useAuth.js]"]
  node_auth_api["Auth HTTP client<br/>[auth.api.js]"]
  node_auth_context["Auth state<br/>[auth.context.jsx]"]
  node_home["Interview home<br/>[Home.jsx]"]
  node_interview_page["Interview page<br/>[interview.jsx]"]
end

subgraph group_auth_backend["Authentication backend"]
  node_server["HTTP app<br/>[app.js]"]
  node_auth_routes["Auth routes<br/>[auth.routes.js]"]
  node_auth_controller["Auth operations<br/>[auth.controller.js]"]
  node_auth_middleware["Session verifier<br/>[auth.middleware.js]"]
  node_users[("User records<br/>[user.model.js]")]
  node_blacklist[("Token blacklist<br/>[blacklist.model.js]")]
end

subgraph group_interview_backend["Interview reporting"]
  node_interview_routes["Interview route"]
  node_file_upload["PDF upload handler<br/>[file.middleware.js]"]
  node_interview_controller["Report generation"]
  node_ai_service["AI report service<br/>[ai.service.js]"]
  node_reports[("Interview reports")]
end

node_user(("User"))

node_user -->|"opens pages"| node_routes
node_app -->|"mounts router"| node_routes
node_routes -->|"routes login"| node_login
node_routes -->|"routes registration"| node_register
node_routes -->|"guards pages"| node_protected
node_routes -->|"routes home"| node_home
node_routes -->|"routes interview"| node_interview_page
node_login -->|"uses auth actions"| node_auth_hook
node_register -->|"uses auth actions"| node_auth_hook
node_protected -->|"checks session"| node_auth_hook
node_auth_hook -->|"calls auth API"| node_auth_api
node_auth_hook -->|"reads and updates"| node_auth_context
node_auth_api -->|"HTTP requests"| node_auth_routes
node_server -->|"mounts routes"| node_auth_routes
node_server -->|"mounts routes"| node_interview_routes
node_auth_routes -->|"dispatches requests"| node_auth_controller
node_auth_routes -->|"checks session"| node_auth_middleware
node_auth_controller -->|"reads and creates"| node_users
node_auth_controller -->|"blacklists tokens"| node_blacklist
node_auth_middleware -->|"checks token"| node_blacklist
node_interview_routes -->|"checks session"| node_auth_middleware
node_interview_routes -->|"parses upload"| node_file_upload
node_interview_routes -->|"dispatches request"| node_interview_controller
node_interview_controller -->|"requests report"| node_ai_service
node_interview_controller -->|"creates report"| node_reports

click node_app "https://github.com/gauranshsahu/interview-ai/blob/main/Frontend/Interview-AI/src/App.jsx"
click node_routes "https://github.com/gauranshsahu/interview-ai/blob/main/Frontend/Interview-AI/src/app.routes.jsx"
click node_login "https://github.com/gauranshsahu/interview-ai/blob/main/Frontend/Interview-AI/src/Features/auth/pages/login.jsx"
click node_register "https://github.com/gauranshsahu/interview-ai/blob/main/Frontend/Interview-AI/src/Features/auth/pages/register.jsx"
click node_protected "https://github.com/gauranshsahu/interview-ai/blob/main/Frontend/Interview-AI/src/Features/auth/components/protected.jsx"
click node_auth_hook "https://github.com/gauranshsahu/interview-ai/blob/main/Frontend/Interview-AI/src/Features/auth/hooks/useAuth.js"
click node_auth_api "https://github.com/gauranshsahu/interview-ai/blob/main/Frontend/Interview-AI/src/Features/auth/services/auth.api.js"
click node_auth_context "https://github.com/gauranshsahu/interview-ai/blob/main/Frontend/Interview-AI/src/Features/auth/auth.context.jsx"
click node_home "https://github.com/gauranshsahu/interview-ai/blob/main/Frontend/Interview-AI/src/Features/Interview/pages/Home.jsx"
click node_interview_page "https://github.com/gauranshsahu/interview-ai/blob/main/Frontend/Interview-AI/src/Features/Interview/pages/interview.jsx"
click node_server "https://github.com/gauranshsahu/interview-ai/blob/main/Backend/src/app.js"
click node_auth_routes "https://github.com/gauranshsahu/interview-ai/blob/main/Backend/src/routes/auth.routes.js"
click node_auth_controller "https://github.com/gauranshsahu/interview-ai/blob/main/Backend/src/controllers/auth.controller.js"
click node_auth_middleware "https://github.com/gauranshsahu/interview-ai/blob/main/Backend/src/middlewares/auth.middleware.js"
click node_users "https://github.com/gauranshsahu/interview-ai/blob/main/Backend/src/models/user.model.js"
click node_blacklist "https://github.com/gauranshsahu/interview-ai/blob/main/Backend/src/models/blacklist.model.js"
click node_interview_routes "https://github.com/gauranshsahu/interview-ai/blob/main/Backend/src/routes/interview.routes.js"
click node_file_upload "https://github.com/gauranshsahu/interview-ai/blob/main/Backend/src/middlewares/file.middleware.js"
click node_interview_controller "https://github.com/gauranshsahu/interview-ai/blob/main/Backend/src/controllers/interview.controller.js"
click node_ai_service "https://github.com/gauranshsahu/interview-ai/blob/main/Backend/src/services/ai.service.js"
click node_reports "https://github.com/gauranshsahu/interview-ai/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_routes,node_login,node_register,node_protected,node_auth_hook,node_auth_api,node_auth_context,node_home,node_interview_page,node_user toneBlue
class node_server,node_auth_routes,node_auth_controller,node_auth_middleware,node_users,node_blacklist toneAmber
class node_interview_routes,node_file_upload,node_interview_controller,node_ai_service,node_reports toneMint
```

## Components

### Web application

- [App shell](https://github.com/gauranshsahu/interview-ai/blob/main/Frontend/Interview-AI/src/App.jsx): `Frontend/Interview-AI/src/App.jsx`
- [Page router](https://github.com/gauranshsahu/interview-ai/blob/main/Frontend/Interview-AI/src/app.routes.jsx): `Frontend/Interview-AI/src/app.routes.jsx`
- [Login page](https://github.com/gauranshsahu/interview-ai/blob/main/Frontend/Interview-AI/src/Features/auth/pages/login.jsx): `Frontend/Interview-AI/src/Features/auth/pages/login.jsx`
- [Register page](https://github.com/gauranshsahu/interview-ai/blob/main/Frontend/Interview-AI/src/Features/auth/pages/register.jsx): `Frontend/Interview-AI/src/Features/auth/pages/register.jsx`
- [Protected page gate](https://github.com/gauranshsahu/interview-ai/blob/main/Frontend/Interview-AI/src/Features/auth/components/protected.jsx): `Frontend/Interview-AI/src/Features/auth/components/protected.jsx`
- [Auth actions](https://github.com/gauranshsahu/interview-ai/blob/main/Frontend/Interview-AI/src/Features/auth/hooks/useAuth.js): `Frontend/Interview-AI/src/Features/auth/hooks/useAuth.js`
- [Auth HTTP client](https://github.com/gauranshsahu/interview-ai/blob/main/Frontend/Interview-AI/src/Features/auth/services/auth.api.js): `Frontend/Interview-AI/src/Features/auth/services/auth.api.js`
- [Auth state](https://github.com/gauranshsahu/interview-ai/blob/main/Frontend/Interview-AI/src/Features/auth/auth.context.jsx): `Frontend/Interview-AI/src/Features/auth/auth.context.jsx`
- [Interview home](https://github.com/gauranshsahu/interview-ai/blob/main/Frontend/Interview-AI/src/Features/Interview/pages/Home.jsx): `Frontend/Interview-AI/src/Features/Interview/pages/Home.jsx`
- [Interview page](https://github.com/gauranshsahu/interview-ai/blob/main/Frontend/Interview-AI/src/Features/Interview/pages/interview.jsx): `Frontend/Interview-AI/src/Features/Interview/pages/interview.jsx`

### Authentication backend

- [HTTP app](https://github.com/gauranshsahu/interview-ai/blob/main/Backend/src/app.js): `Backend/src/app.js`
- [Auth routes](https://github.com/gauranshsahu/interview-ai/blob/main/Backend/src/routes/auth.routes.js): `Backend/src/routes/auth.routes.js`
- [Auth operations](https://github.com/gauranshsahu/interview-ai/blob/main/Backend/src/controllers/auth.controller.js): `Backend/src/controllers/auth.controller.js`
- [Session verifier](https://github.com/gauranshsahu/interview-ai/blob/main/Backend/src/middlewares/auth.middleware.js): `Backend/src/middlewares/auth.middleware.js`
- [User records](https://github.com/gauranshsahu/interview-ai/blob/main/Backend/src/models/user.model.js): `Backend/src/models/user.model.js`
- [Token blacklist](https://github.com/gauranshsahu/interview-ai/blob/main/Backend/src/models/blacklist.model.js): `Backend/src/models/blacklist.model.js`

### Interview reporting

- [Interview route](https://github.com/gauranshsahu/interview-ai/blob/main/Backend/src/routes/interview.routes.js): `Backend/src/routes/interview.routes.js`
- [PDF upload handler](https://github.com/gauranshsahu/interview-ai/blob/main/Backend/src/middlewares/file.middleware.js): `Backend/src/middlewares/file.middleware.js`
- [Report generation](https://github.com/gauranshsahu/interview-ai/blob/main/Backend/src/controllers/interview.controller.js): `Backend/src/controllers/interview.controller.js`
- [AI report service](https://github.com/gauranshsahu/interview-ai/blob/main/Backend/src/services/ai.service.js): `Backend/src/services/ai.service.js`
- [Interview reports](https://github.com/gauranshsahu/interview-ai/blob/main/Backend/src/models/interviewReport.model.js): `Backend/src/models/interviewReport.model.js`

### Other components

- **User**

## Connections

- User → Page router: opens pages (evidence: `Frontend/Interview-AI/src/app.routes.jsx`)
- App shell → Page router: mounts router (evidence: `Frontend/Interview-AI/src/App.jsx`)
- Page router → Login page: routes login (evidence: `Frontend/Interview-AI/src/app.routes.jsx`)
- Page router → Register page: routes registration (evidence: `Frontend/Interview-AI/src/app.routes.jsx`)
- Page router → Protected page gate: guards pages (evidence: `Frontend/Interview-AI/src/app.routes.jsx`)
- Page router → Interview home: routes home (evidence: `Frontend/Interview-AI/src/app.routes.jsx`)
- Page router → Interview page: routes interview (evidence: `Frontend/Interview-AI/src/app.routes.jsx`)
- Login page → Auth actions: uses auth actions (evidence: `Frontend/Interview-AI/src/Features/auth/pages/login.jsx`)
- Register page → Auth actions: uses auth actions (evidence: `Frontend/Interview-AI/src/Features/auth/pages/register.jsx`)
- Protected page gate → Auth actions: checks session (evidence: `Frontend/Interview-AI/src/Features/auth/components/protected.jsx`)
- Auth actions → Auth HTTP client: calls auth API (evidence: `Frontend/Interview-AI/src/Features/auth/hooks/useAuth.js`)
- Auth actions → Auth state: reads and updates (evidence: `Frontend/Interview-AI/src/Features/auth/hooks/useAuth.js`)
- Auth HTTP client → Auth routes: HTTP requests (evidence: `Frontend/Interview-AI/src/Features/auth/services/auth.api.js`)
- HTTP app → Auth routes: mounts routes (evidence: `Backend/src/app.js`)
- HTTP app → Interview route: mounts routes (evidence: `Backend/src/app.js`)
- Auth routes → Auth operations: dispatches requests (evidence: `Backend/src/routes/auth.routes.js`)
- Auth routes → Session verifier: checks session (evidence: `Backend/src/routes/auth.routes.js`)
- Auth operations → User records: reads and creates (evidence: `Backend/src/controllers/auth.controller.js`)
- Auth operations → Token blacklist: blacklists tokens (evidence: `Backend/src/controllers/auth.controller.js`)
- Session verifier → Token blacklist: checks token (evidence: `Backend/src/middlewares/auth.middleware.js`)
- Interview route → Session verifier: checks session (evidence: `Backend/src/routes/interview.routes.js`)
- Interview route → PDF upload handler: parses upload (evidence: `Backend/src/routes/interview.routes.js`)
- Interview route → Report generation: dispatches request (evidence: `Backend/src/routes/interview.routes.js`)
- Report generation → AI report service: requests report (evidence: `Backend/src/controllers/interview.controller.js`)
- Report generation → Interview reports: creates report (evidence: `Backend/src/controllers/interview.controller.js`)
