# adityahar06/ai-interview-repo architecture

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

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

## Overview

AI Interview Platform takes users from account access through interview setup, timed answers, AI evaluation, and reports, with dashboard and history views for follow-up. The graph includes the documented resume-upload and reporting capabilities. Source excerpts show the main interview controller’s model and AI dependencies, API mappings, and route mounting; some page-to-API and unsampled route behavior is supported by the SOURCE INDEX or README rather than full implementation excerpts.

Main entry points: [`client/src/App.jsx`](https://github.com/adityahar06/ai-interview-repo/blob/main/client/src/App.jsx) (Routes and shell), [`client/src/api/index.js`](https://github.com/adityahar06/ai-interview-repo/blob/main/client/src/api/index.js) (HTTP API client), [`server/controllers/interviewController.js`](https://github.com/adityahar06/ai-interview-repo/blob/main/server/controllers/interviewController.js) (Interview handlers), [`server/server.js`](https://github.com/adityahar06/ai-interview-repo/blob/main/server/server.js) (Express server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_app["Routes and shell<br/>[App.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_history["Interview history<br/>[History.jsx]"]
end

subgraph group_identity["Authentication"]
  node_authui["Auth state<br/>[AuthContext.jsx]"]
  node_login["Sign in<br/>[Login.jsx]"]
  node_register["Registration<br/>[Register.jsx]"]
  node_authcontroller["Auth handlers<br/>[authController.js]"]
  node_authmw["JWT protection<br/>[auth.js]"]
end

subgraph group_interview["Interview workflow"]
  node_setup["Interview setup<br/>[InterviewSetup.jsx]"]
  node_session["Interview session"]
  node_timer["Question timer<br/>[useTimer.js]"]
  node_results["Results view<br/>[Results.jsx]"]
  node_interviewcontroller["Interview handlers"]
  node_reportcontroller["Report handlers"]
end

subgraph group_backend["API services"]
  node_api["HTTP API client<br/>[index.js]"]
  node_server["Express server<br/>[server.js]"]
  node_authroutes["Auth routes<br/>[auth.js]"]
  node_interviewroutes["Interview routes<br/>[interview.js]"]
  node_reportroutes["Report routes<br/>[report.js]"]
end

subgraph group_persistence["Data and AI"]
  node_user[("User records<br/>[User.js]")]
  node_interviewmodel[("Interview records<br/>[Interview.js]")]
  node_reportmodel[("Report records<br/>[Report.js]")]
  node_groq["Groq AI service<br/>[groqService.js]"]
  node_mongodb[("MongoDB")]
end

node_candidate(("Candidate"))
node_groqapi{{"Groq API"}}

node_candidate -->|"uses"| node_app
node_app -->|"provides state"| node_authui
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_register
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_setup
node_app -->|"routes to"| node_session
node_app -->|"routes to"| node_results
node_app -->|"routes to"| node_history
node_login -->|"requests auth"| node_api
node_register -->|"requests auth"| node_api
node_authui -->|"validates session"| node_api
node_dashboard -->|"loads dashboard data"| node_api
node_setup -->|"starts interview"| node_api
node_session -->|"uses timer"| node_timer
node_session -->|"submits answers"| node_api
node_results -->|"loads report"| node_api
node_history -->|"loads history"| node_api
node_api -->|"sends HTTP requests"| node_server
node_server -->|"mounts routes"| node_authroutes
node_server -->|"mounts routes"| node_interviewroutes
node_server -->|"mounts routes"| node_reportroutes
node_authroutes -->|"dispatches to"| node_authcontroller
node_authroutes -->|"protects endpoints"| node_authmw
node_interviewroutes -->|"dispatches to"| node_interviewcontroller
node_interviewroutes -->|"protects endpoints"| node_authmw
node_reportroutes -->|"dispatches to"| node_reportcontroller
node_reportroutes -->|"protects endpoints"| node_authmw
node_authcontroller -->|"creates and checks"| node_user
node_authmw -->|"loads user"| node_user
node_interviewcontroller -->|"reads and writes"| node_interviewmodel
node_interviewcontroller -->|"updates stats"| node_user
node_interviewcontroller -->|"creates reports"| node_reportmodel
node_interviewcontroller -->|"generates and evaluates"| node_groq
node_reportcontroller -->|"reads reports"| node_reportmodel
node_reportcontroller -->|"populates interview"| node_interviewmodel
node_groq -->|"requests completions"| node_groqapi
node_interviewcontroller -.->|"persists interview data"| node_mongodb
node_authcontroller -.->|"persists account data"| node_mongodb
node_interviewcontroller -.->|"persists report data"| node_mongodb
node_candidate -.->|"uploads resume"| node_setup

click node_app "https://github.com/adityahar06/ai-interview-repo/blob/main/client/src/App.jsx"
click node_authui "https://github.com/adityahar06/ai-interview-repo/blob/main/client/src/context/AuthContext.jsx"
click node_login "https://github.com/adityahar06/ai-interview-repo/blob/main/client/src/pages/Login.jsx"
click node_register "https://github.com/adityahar06/ai-interview-repo/blob/main/client/src/pages/Register.jsx"
click node_dashboard "https://github.com/adityahar06/ai-interview-repo/blob/main/client/src/pages/Dashboard.jsx"
click node_setup "https://github.com/adityahar06/ai-interview-repo/blob/main/client/src/pages/InterviewSetup.jsx"
click node_session "https://github.com/adityahar06/ai-interview-repo/blob/main/client/src/pages/InterviewSession.jsx"
click node_timer "https://github.com/adityahar06/ai-interview-repo/blob/main/client/src/hooks/useTimer.js"
click node_results "https://github.com/adityahar06/ai-interview-repo/blob/main/client/src/pages/Results.jsx"
click node_history "https://github.com/adityahar06/ai-interview-repo/blob/main/client/src/pages/History.jsx"
click node_api "https://github.com/adityahar06/ai-interview-repo/blob/main/client/src/api/index.js"
click node_server "https://github.com/adityahar06/ai-interview-repo/blob/main/server/server.js"
click node_authroutes "https://github.com/adityahar06/ai-interview-repo/blob/main/server/routes/auth.js"
click node_interviewroutes "https://github.com/adityahar06/ai-interview-repo/blob/main/server/routes/interview.js"
click node_reportroutes "https://github.com/adityahar06/ai-interview-repo/blob/main/server/routes/report.js"
click node_authcontroller "https://github.com/adityahar06/ai-interview-repo/blob/main/server/controllers/authController.js"
click node_authmw "https://github.com/adityahar06/ai-interview-repo/blob/main/server/middleware/auth.js"
click node_interviewcontroller "https://github.com/adityahar06/ai-interview-repo/blob/main/server/controllers/interviewController.js"
click node_reportcontroller "https://github.com/adityahar06/ai-interview-repo/blob/main/server/controllers/reportController.js"
click node_user "https://github.com/adityahar06/ai-interview-repo/blob/main/server/models/User.js"
click node_interviewmodel "https://github.com/adityahar06/ai-interview-repo/blob/main/server/models/Interview.js"
click node_reportmodel "https://github.com/adityahar06/ai-interview-repo/blob/main/server/models/Report.js"
click node_groq "https://github.com/adityahar06/ai-interview-repo/blob/main/server/services/groqService.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_dashboard,node_history toneBlue
class node_authui,node_login,node_register,node_authcontroller,node_authmw toneAmber
class node_setup,node_session,node_timer,node_results,node_interviewcontroller,node_reportcontroller,node_groqapi toneMint
class node_api,node_server,node_authroutes,node_interviewroutes,node_reportroutes toneRose
class node_user,node_interviewmodel,node_reportmodel,node_groq,node_mongodb,node_candidate toneIndigo
```

## Components

### Web application

- [Routes and shell](https://github.com/adityahar06/ai-interview-repo/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Dashboard](https://github.com/adityahar06/ai-interview-repo/blob/main/client/src/pages/Dashboard.jsx): `client/src/pages/Dashboard.jsx`
- [Interview history](https://github.com/adityahar06/ai-interview-repo/blob/main/client/src/pages/History.jsx): `client/src/pages/History.jsx`

### Authentication

- [Auth state](https://github.com/adityahar06/ai-interview-repo/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [Sign in](https://github.com/adityahar06/ai-interview-repo/blob/main/client/src/pages/Login.jsx): `client/src/pages/Login.jsx`
- [Registration](https://github.com/adityahar06/ai-interview-repo/blob/main/client/src/pages/Register.jsx): `client/src/pages/Register.jsx`
- [Auth handlers](https://github.com/adityahar06/ai-interview-repo/blob/main/server/controllers/authController.js): `server/controllers/authController.js`
- [JWT protection](https://github.com/adityahar06/ai-interview-repo/blob/main/server/middleware/auth.js): `server/middleware/auth.js`

### Interview workflow

- [Interview setup](https://github.com/adityahar06/ai-interview-repo/blob/main/client/src/pages/InterviewSetup.jsx): `client/src/pages/InterviewSetup.jsx`
- [Interview session](https://github.com/adityahar06/ai-interview-repo/blob/main/client/src/pages/InterviewSession.jsx): `client/src/pages/InterviewSession.jsx`
- [Question timer](https://github.com/adityahar06/ai-interview-repo/blob/main/client/src/hooks/useTimer.js): `client/src/hooks/useTimer.js`
- [Results view](https://github.com/adityahar06/ai-interview-repo/blob/main/client/src/pages/Results.jsx): `client/src/pages/Results.jsx`
- [Interview handlers](https://github.com/adityahar06/ai-interview-repo/blob/main/server/controllers/interviewController.js): `server/controllers/interviewController.js`
- [Report handlers](https://github.com/adityahar06/ai-interview-repo/blob/main/server/controllers/reportController.js): `server/controllers/reportController.js`

### API services

- [HTTP API client](https://github.com/adityahar06/ai-interview-repo/blob/main/client/src/api/index.js): `client/src/api/index.js`
- [Express server](https://github.com/adityahar06/ai-interview-repo/blob/main/server/server.js): `server/server.js`
- [Auth routes](https://github.com/adityahar06/ai-interview-repo/blob/main/server/routes/auth.js): `server/routes/auth.js`
- [Interview routes](https://github.com/adityahar06/ai-interview-repo/blob/main/server/routes/interview.js): `server/routes/interview.js`
- [Report routes](https://github.com/adityahar06/ai-interview-repo/blob/main/server/routes/report.js): `server/routes/report.js`

### Data and AI

- [User records](https://github.com/adityahar06/ai-interview-repo/blob/main/server/models/User.js): `server/models/User.js`
- [Interview records](https://github.com/adityahar06/ai-interview-repo/blob/main/server/models/Interview.js): `server/models/Interview.js`
- [Report records](https://github.com/adityahar06/ai-interview-repo/blob/main/server/models/Report.js): `server/models/Report.js`
- [Groq AI service](https://github.com/adityahar06/ai-interview-repo/blob/main/server/services/groqService.js): `server/services/groqService.js`
- **MongoDB**

### Other components

- **Candidate**
- **Groq API**

## Connections

- Candidate → Routes and shell: uses (evidence: `README.md`)
- Routes and shell → Auth state: provides state (evidence: `client/src/App.jsx`)
- Routes and shell → Sign in: routes to (evidence: `client/src/App.jsx`)
- Routes and shell → Registration: routes to (evidence: `client/src/App.jsx`)
- Routes and shell → Dashboard: routes to (evidence: `client/src/App.jsx`)
- Routes and shell → Interview setup: routes to (evidence: `client/src/App.jsx`)
- Routes and shell → Interview session: routes to (evidence: `client/src/App.jsx`)
- Routes and shell → Results view: routes to (evidence: `client/src/App.jsx`)
- Routes and shell → Interview history: routes to (evidence: `client/src/App.jsx`)
- Sign in → HTTP API client: requests auth (evidence: `client/src/pages/Login.jsx`)
- Registration → HTTP API client: requests auth (evidence: `client/src/pages/Register.jsx`)
- Auth state → HTTP API client: validates session (evidence: `client/src/context/AuthContext.jsx`)
- Dashboard → HTTP API client: loads dashboard data (evidence: `client/src/pages/Dashboard.jsx`)
- Interview setup → HTTP API client: starts interview (evidence: `client/src/pages/InterviewSetup.jsx`)
- Interview session → Question timer: uses timer (evidence: `client/src/pages/InterviewSession.jsx`)
- Interview session → HTTP API client: submits answers (evidence: `client/src/pages/InterviewSession.jsx`)
- Results view → HTTP API client: loads report (evidence: `client/src/pages/Results.jsx`)
- Interview history → HTTP API client: loads history (evidence: `client/src/pages/History.jsx`)
- HTTP API client → Express server: sends HTTP requests (evidence: `client/src/api/index.js`)
- Express server → Auth routes: mounts routes (evidence: `server/server.js`)
- Express server → Interview routes: mounts routes (evidence: `server/server.js`)
- Express server → Report routes: mounts routes (evidence: `server/server.js`)
- Auth routes → Auth handlers: dispatches to (evidence: `server/routes/auth.js`)
- Auth routes → JWT protection: protects endpoints (evidence: `server/routes/auth.js`)
- Interview routes → Interview handlers: dispatches to (evidence: `server/routes/interview.js`)
- Interview routes → JWT protection: protects endpoints (evidence: `server/routes/interview.js`)
- Report routes → Report handlers: dispatches to (evidence: `server/routes/report.js`)
- Report routes → JWT protection: protects endpoints (evidence: `server/routes/report.js`)
- Auth handlers → User records: creates and checks (evidence: `server/controllers/authController.js`)
- JWT protection → User records: loads user (evidence: `server/middleware/auth.js`)
- Interview handlers → Interview records: reads and writes (evidence: `server/controllers/interviewController.js`)
- Interview handlers → User records: updates stats (evidence: `server/controllers/interviewController.js`)
- Interview handlers → Report records: creates reports (evidence: `server/controllers/interviewController.js`)
- Interview handlers → Groq AI service: generates and evaluates (evidence: `server/controllers/interviewController.js`)
- Report handlers → Report records: reads reports (evidence: `server/controllers/reportController.js`)
- Report handlers → Interview records: populates interview (evidence: `server/controllers/reportController.js`)
- Groq AI service → Groq API: requests completions (evidence: `server/services/groqService.js`)
- Interview handlers → MongoDB: persists interview data
- Auth handlers → MongoDB: persists account data
- Interview handlers → MongoDB: persists report data
- Candidate → Interview setup: uploads resume (evidence: `README.md`)
