# rahulyadav7418/ai-interview-simulator architecture

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

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

## Overview

AI Interview Simulator is a React and Express practice app: candidates choose a skill and difficulty, answer questions, receive AI scores and feedback, review a report, and can save results. The frontend’s App component owns the interview flow and its API requests; the Express server handles evaluation, interview records, and account endpoints. The README also documents authentication and MongoDB storage, while the sampled frontend does not show account flows. Resume-based interviews and analytics are described as planned, not implemented.

Main entry points: [`BACKEND/server.js`](https://github.com/rahulyadav7418/ai-interview-simulator/blob/main/BACKEND/server.js) (Express API), [`FRONTEND/vite-project/src/App.jsx`](https://github.com/rahulyadav7418/ai-interview-simulator/blob/main/FRONTEND/vite-project/src/App.jsx) (Interview flow), [`FRONTEND/vite-project/src/Hero.jsx`](https://github.com/rahulyadav7418/ai-interview-simulator/blob/main/FRONTEND/vite-project/src/Hero.jsx) (Name entry), [`BACKEND/models/interview.js`](https://github.com/rahulyadav7418/ai-interview-simulator/blob/main/BACKEND/models/interview.js) (Interview records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Interview experience"]
  node_app["Interview flow<br/>[App.jsx]"]
  node_hero["Name entry<br/>[Hero.jsx]"]
  node_question_bank["Skill questions<br/>[App.jsx]"]
  node_evaluation_ui["Answer and progress UI<br/>[App.jsx]"]
  node_report["Results report<br/>[App.jsx]"]
end

subgraph group_api["Backend API"]
  node_api_server["Express API<br/>[server.js]"]
  node_auth["Token middleware<br/>[auth.js]"]
end

subgraph group_data["Integrations and persistence"]
  node_interview_model["Interview records<br/>[interview.js]"]
  node_user_model["User records<br/>[user.js]"]
  node_mongo[("MongoDB")]
  node_openrouter["OpenRouter AI"]
end

node_candidate(("Candidate"))

node_candidate -->|"enters name"| node_hero
node_hero -->|"starts interview"| node_app
node_app -->|"selects questions"| node_question_bank
node_question_bank -->|"provides questions"| node_evaluation_ui
node_candidate -->|"submits answers"| node_evaluation_ui
node_evaluation_ui -->|"updates state"| node_app
node_app -->|"posts answer"| node_api_server
node_api_server -->|"requests evaluation"| node_openrouter
node_openrouter -->|"returns score"| node_api_server
node_api_server -->|"returns evaluation"| node_app
node_app -->|"builds report"| node_report
node_report -->|"shows results"| node_candidate
node_app -->|"saves result"| node_api_server
node_app -->|"requests interviews"| node_api_server
node_api_server -->|"checks token"| node_auth
node_api_server -->|"reads and writes"| node_interview_model
node_interview_model -->|"persists records"| node_mongo
node_api_server -->|"reads and creates users"| node_user_model
node_user_model -->|"persists users"| node_mongo

click node_app "https://github.com/rahulyadav7418/ai-interview-simulator/blob/main/FRONTEND/vite-project/src/App.jsx"
click node_hero "https://github.com/rahulyadav7418/ai-interview-simulator/blob/main/FRONTEND/vite-project/src/Hero.jsx"
click node_question_bank "https://github.com/rahulyadav7418/ai-interview-simulator/blob/main/FRONTEND/vite-project/src/App.jsx"
click node_evaluation_ui "https://github.com/rahulyadav7418/ai-interview-simulator/blob/main/FRONTEND/vite-project/src/App.jsx"
click node_report "https://github.com/rahulyadav7418/ai-interview-simulator/blob/main/FRONTEND/vite-project/src/App.jsx"
click node_api_server "https://github.com/rahulyadav7418/ai-interview-simulator/blob/main/BACKEND/server.js"
click node_auth "https://github.com/rahulyadav7418/ai-interview-simulator/blob/main/BACKEND/middleware/auth.js"
click node_interview_model "https://github.com/rahulyadav7418/ai-interview-simulator/blob/main/BACKEND/models/interview.js"
click node_user_model "https://github.com/rahulyadav7418/ai-interview-simulator/blob/main/BACKEND/models/user.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_hero,node_question_bank,node_evaluation_ui,node_report toneBlue
class node_api_server,node_auth toneAmber
class node_interview_model,node_user_model,node_mongo,node_openrouter toneMint
class node_candidate toneIndigo
```

## Components

### Interview experience

- [Interview flow](https://github.com/rahulyadav7418/ai-interview-simulator/blob/main/FRONTEND/vite-project/src/App.jsx): `FRONTEND/vite-project/src/App.jsx`
- [Name entry](https://github.com/rahulyadav7418/ai-interview-simulator/blob/main/FRONTEND/vite-project/src/Hero.jsx): `FRONTEND/vite-project/src/Hero.jsx`
- [Skill questions](https://github.com/rahulyadav7418/ai-interview-simulator/blob/main/FRONTEND/vite-project/src/App.jsx): `FRONTEND/vite-project/src/App.jsx`
- [Answer and progress UI](https://github.com/rahulyadav7418/ai-interview-simulator/blob/main/FRONTEND/vite-project/src/App.jsx): `FRONTEND/vite-project/src/App.jsx`
- [Results report](https://github.com/rahulyadav7418/ai-interview-simulator/blob/main/FRONTEND/vite-project/src/App.jsx): `FRONTEND/vite-project/src/App.jsx`

### Backend API

- [Express API](https://github.com/rahulyadav7418/ai-interview-simulator/blob/main/BACKEND/server.js): `BACKEND/server.js`
- [Token middleware](https://github.com/rahulyadav7418/ai-interview-simulator/blob/main/BACKEND/middleware/auth.js): `BACKEND/middleware/auth.js`

### Integrations and persistence

- [Interview records](https://github.com/rahulyadav7418/ai-interview-simulator/blob/main/BACKEND/models/interview.js): `BACKEND/models/interview.js`
- [User records](https://github.com/rahulyadav7418/ai-interview-simulator/blob/main/BACKEND/models/user.js): `BACKEND/models/user.js`
- **MongoDB**
- **OpenRouter AI**

### Other components

- **Candidate**

## Connections

- Candidate → Name entry: enters name
- Name entry → Interview flow: starts interview
- Interview flow → Skill questions: selects questions
- Skill questions → Answer and progress UI: provides questions
- Candidate → Answer and progress UI: submits answers
- Answer and progress UI → Interview flow: updates state
- Interview flow → Express API: posts answer
- Express API → OpenRouter AI: requests evaluation
- OpenRouter AI → Express API: returns score
- Express API → Interview flow: returns evaluation
- Interview flow → Results report: builds report
- Results report → Candidate: shows results
- Interview flow → Express API: saves result
- Interview flow → Express API: requests interviews
- Express API → Token middleware: checks token
- Express API → Interview records: reads and writes
- Interview records → MongoDB: persists records
- Express API → User records: reads and creates users
- User records → MongoDB: persists users
