# mayank67-tech/interview-preparation-platform architecture

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

- Interactive diagram: https://gitdiagram.com/mayank67-tech/interview-preparation-platform
- Repository: https://github.com/mayank67-tech/interview-preparation-platform

## Overview

This is a full-stack AI interview-preparation platform. Users sign up or log in, create role- and topic-based practice sessions, review and manage questions, and request explanations. The frontend routes users through those tasks and calls the Express API; backend controllers handle authentication, AI generation, session/question management, and persistence. The README documents MongoDB and AI integration; sampled code confirms Gemini generation with local fallbacks. Some frontend-to-backend route wiring and unsampled features are represented only at the API level, not as inferred controller calls.

Main entry points: [`frontend/src/App.jsx`](https://github.com/mayank67-tech/interview-preparation-platform/blob/main/frontend/src/App.jsx) (App routing), [`backend/server.js`](https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/server.js) (Express server), [`frontend/src/pages/Home/Dashboard.jsx`](https://github.com/mayank67-tech/interview-preparation-platform/blob/main/frontend/src/pages/Home/Dashboard.jsx) (Session dashboard), [`frontend/src/pages/InterviewPrep.jsx`](https://github.com/mayank67-tech/interview-preparation-platform/blob/main/frontend/src/pages/InterviewPrep.jsx) (Practice session view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["App routing<br/>[App.jsx]"]
  node_signup["Sign up<br/>[SignUp.jsx]"]
  node_login["Login<br/>[Login.jsx]"]
  node_dashboard["Session dashboard<br/>[Dashboard.jsx]"]
  node_prepview["Practice session view<br/>[InterviewPrep.jsx]"]
  node_usercontext["User context<br/>[userContext.jsx]"]
  node_navbar["Navigation<br/>[Navbar.jsx]"]
  node_profile["Profile card"]
  node_questionsview["Question list<br/>[QuestionList.jsx]"]
  node_apiutils["API client paths<br/>[axiosInstance.js]"]
  node_apipaths["API endpoints<br/>[apiPaths.js]"]
end

subgraph group_api["API and identity"]
  node_server["Express server<br/>[server.js]"]
  node_authroutes["Authentication routes<br/>[authRoutes.js]"]
  node_authcontroller["Authentication<br/>[authControllers.js]"]
  node_authmiddleware["JWT verification<br/>[authMiddleware.js]"]
  node_sessionroutes["Session routes<br/>[sessionRoutes.js]"]
end

subgraph group_prep["Interview preparation"]
  node_sessioncontroller["Session management"]
  node_questionroutes["Question routes<br/>[questionRoutes.js]"]
  node_questioncontroller["Question management"]
  node_aicontroller["AI generation<br/>[aiControllers.js]"]
  node_prompts["AI prompts<br/>[prompts.js]"]
end

subgraph group_support["Persistence and utilities"]
  node_sessions[("Session records<br/>[session.model.js]")]
  node_questions[("Question records<br/>[question.model.js]")]
  node_users[("User records<br/>[user.model.js]")]
  node_dbconfig["Database connection<br/>[db.js]"]
  node_cloudinary["Avatar image storage<br/>[cloudinary.js]"]
end

node_candidate(("Candidate"))
node_mongodb[("MongoDB")]
node_llm{{"Google Gemini"}}
node_cloudservice{{"Cloudinary service"}}

node_candidate -->|"uses"| node_app
node_app -->|"routes to"| node_signup
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_prepview
node_app -->|"provides"| node_usercontext
node_signup -->|"submits registration"| node_apiutils
node_signup -->|"selects endpoint"| node_apipaths
node_login -->|"sends credentials"| node_apiutils
node_login -->|"selects endpoint"| node_apipaths
node_usercontext -->|"fetches profile"| node_apiutils
node_usercontext -->|"selects endpoint"| node_apipaths
node_dashboard -->|"requests sessions"| node_apiutils
node_dashboard -->|"selects endpoints"| node_apipaths
node_dashboard -->|"renders"| node_profile
node_dashboard -->|"renders"| node_navbar
node_prepview -->|"manages questions"| node_apiutils
node_prepview -->|"selects endpoints"| node_apipaths
node_prepview -->|"renders"| node_questionsview
node_prepview -->|"renders"| node_navbar
node_server -->|"mounts"| node_authroutes
node_server -->|"mounts"| node_sessionroutes
node_server -->|"mounts"| node_questionroutes
node_server -->|"registers routes"| node_aicontroller
node_authroutes -->|"dispatches"| node_authcontroller
node_authroutes -->|"protects routes"| node_authmiddleware
node_sessionroutes -->|"dispatches"| node_sessioncontroller
node_questionroutes -->|"dispatches"| node_questioncontroller
node_questionroutes -->|"protects routes"| node_authmiddleware
node_authcontroller -->|"reads and updates"| node_users
node_authcontroller -->|"uploads avatar"| node_cloudinary
node_cloudinary -->|"uploads image"| node_cloudservice
node_authmiddleware -->|"loads user"| node_users
node_sessioncontroller -->|"creates and queries"| node_sessions
node_sessioncontroller -->|"creates and deletes"| node_questions
node_questioncontroller -->|"manages records"| node_questions
node_questioncontroller -->|"updates session"| node_sessions
node_aicontroller -->|"builds prompts"| node_prompts
node_aicontroller -->|"generates content"| node_llm
node_server -->|"connects database"| node_dbconfig
node_dbconfig -.->|"connects"| node_mongodb
node_sessions -.->|"persists"| node_mongodb
node_questions -.->|"persists"| node_mongodb
node_users -.->|"persists"| node_mongodb

click node_app "https://github.com/mayank67-tech/interview-preparation-platform/blob/main/frontend/src/App.jsx"
click node_signup "https://github.com/mayank67-tech/interview-preparation-platform/blob/main/frontend/src/pages/Auth/SignUp.jsx"
click node_login "https://github.com/mayank67-tech/interview-preparation-platform/blob/main/frontend/src/pages/Auth/Login.jsx"
click node_dashboard "https://github.com/mayank67-tech/interview-preparation-platform/blob/main/frontend/src/pages/Home/Dashboard.jsx"
click node_prepview "https://github.com/mayank67-tech/interview-preparation-platform/blob/main/frontend/src/pages/InterviewPrep.jsx"
click node_usercontext "https://github.com/mayank67-tech/interview-preparation-platform/blob/main/frontend/src/context/userContext.jsx"
click node_navbar "https://github.com/mayank67-tech/interview-preparation-platform/blob/main/frontend/src/components/Navbar.jsx"
click node_profile "https://github.com/mayank67-tech/interview-preparation-platform/blob/main/frontend/src/components/ProfileInfoCard.jsx"
click node_questionsview "https://github.com/mayank67-tech/interview-preparation-platform/blob/main/frontend/src/components/cards/QuestionList.jsx"
click node_apiutils "https://github.com/mayank67-tech/interview-preparation-platform/blob/main/frontend/src/utils/axiosInstance.js"
click node_apipaths "https://github.com/mayank67-tech/interview-preparation-platform/blob/main/frontend/src/utils/apiPaths.js"
click node_server "https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/server.js"
click node_authroutes "https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/routes/authRoutes.js"
click node_authcontroller "https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/controllers/authControllers.js"
click node_authmiddleware "https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/middlewares/authMiddleware.js"
click node_sessionroutes "https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/routes/sessionRoutes.js"
click node_sessioncontroller "https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/controllers/sessionControllers.js"
click node_questionroutes "https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/routes/questionRoutes.js"
click node_questioncontroller "https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/controllers/questionControllers.js"
click node_aicontroller "https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/controllers/aiControllers.js"
click node_prompts "https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/utils/prompts.js"
click node_sessions "https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/models/session.model.js"
click node_questions "https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/models/question.model.js"
click node_users "https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/models/user.model.js"
click node_dbconfig "https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/config/db.js"
click node_cloudinary "https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/utils/cloudinary.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_signup,node_login,node_dashboard,node_prepview,node_usercontext,node_navbar,node_profile,node_questionsview,node_apiutils,node_apipaths toneBlue
class node_server,node_authroutes,node_authcontroller,node_authmiddleware,node_sessionroutes,node_mongodb toneAmber
class node_sessioncontroller,node_questionroutes,node_questioncontroller,node_aicontroller,node_prompts toneMint
class node_sessions,node_questions,node_users,node_dbconfig,node_cloudinary toneRose
class node_candidate,node_llm,node_cloudservice toneIndigo
```

## Components

### Web application

- [App routing](https://github.com/mayank67-tech/interview-preparation-platform/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Sign up](https://github.com/mayank67-tech/interview-preparation-platform/blob/main/frontend/src/pages/Auth/SignUp.jsx): `frontend/src/pages/Auth/SignUp.jsx`
- [Login](https://github.com/mayank67-tech/interview-preparation-platform/blob/main/frontend/src/pages/Auth/Login.jsx): `frontend/src/pages/Auth/Login.jsx`
- [Session dashboard](https://github.com/mayank67-tech/interview-preparation-platform/blob/main/frontend/src/pages/Home/Dashboard.jsx): `frontend/src/pages/Home/Dashboard.jsx`
- [Practice session view](https://github.com/mayank67-tech/interview-preparation-platform/blob/main/frontend/src/pages/InterviewPrep.jsx): `frontend/src/pages/InterviewPrep.jsx`
- [User context](https://github.com/mayank67-tech/interview-preparation-platform/blob/main/frontend/src/context/userContext.jsx): `frontend/src/context/userContext.jsx`
- [Navigation](https://github.com/mayank67-tech/interview-preparation-platform/blob/main/frontend/src/components/Navbar.jsx): `frontend/src/components/Navbar.jsx`
- [Profile card](https://github.com/mayank67-tech/interview-preparation-platform/blob/main/frontend/src/components/ProfileInfoCard.jsx): `frontend/src/components/ProfileInfoCard.jsx`
- [Question list](https://github.com/mayank67-tech/interview-preparation-platform/blob/main/frontend/src/components/cards/QuestionList.jsx): `frontend/src/components/cards/QuestionList.jsx`
- [API client paths](https://github.com/mayank67-tech/interview-preparation-platform/blob/main/frontend/src/utils/axiosInstance.js): `frontend/src/utils/axiosInstance.js`
- [API endpoints](https://github.com/mayank67-tech/interview-preparation-platform/blob/main/frontend/src/utils/apiPaths.js): `frontend/src/utils/apiPaths.js`

### API and identity

- [Express server](https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/server.js): `backend/server.js`
- [Authentication routes](https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/routes/authRoutes.js): `backend/routes/authRoutes.js`
- [Authentication](https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/controllers/authControllers.js): `backend/controllers/authControllers.js`
- [JWT verification](https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/middlewares/authMiddleware.js): `backend/middlewares/authMiddleware.js`
- [Session routes](https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/routes/sessionRoutes.js): `backend/routes/sessionRoutes.js`

### Interview preparation

- [Session management](https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/controllers/sessionControllers.js): `backend/controllers/sessionControllers.js`
- [Question routes](https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/routes/questionRoutes.js): `backend/routes/questionRoutes.js`
- [Question management](https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/controllers/questionControllers.js): `backend/controllers/questionControllers.js`
- [AI generation](https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/controllers/aiControllers.js): `backend/controllers/aiControllers.js`
- [AI prompts](https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/utils/prompts.js): `backend/utils/prompts.js`

### Persistence and utilities

- [Session records](https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/models/session.model.js): `backend/models/session.model.js`
- [Question records](https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/models/question.model.js): `backend/models/question.model.js`
- [User records](https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/models/user.model.js): `backend/models/user.model.js`
- [Database connection](https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/config/db.js): `backend/config/db.js`
- [Avatar image storage](https://github.com/mayank67-tech/interview-preparation-platform/blob/main/backend/utils/cloudinary.js): `backend/utils/cloudinary.js`

### Other components

- **Candidate**
- **MongoDB**
- **Google Gemini**
- **Cloudinary service**

## Connections

- Candidate → App routing: uses (evidence: `README.md`)
- App routing → Sign up: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Login: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Session dashboard: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Practice session view: routes to (evidence: `frontend/src/App.jsx`)
- App routing → User context: provides (evidence: `frontend/src/App.jsx`)
- Sign up → API client paths: submits registration (evidence: `frontend/src/pages/Auth/SignUp.jsx`)
- Sign up → API endpoints: selects endpoint (evidence: `frontend/src/pages/Auth/SignUp.jsx`)
- Login → API client paths: sends credentials (evidence: `frontend/src/pages/Auth/Login.jsx`)
- Login → API endpoints: selects endpoint (evidence: `frontend/src/pages/Auth/Login.jsx`)
- User context → API client paths: fetches profile (evidence: `frontend/src/context/userContext.jsx`)
- User context → API endpoints: selects endpoint (evidence: `frontend/src/context/userContext.jsx`)
- Session dashboard → API client paths: requests sessions (evidence: `frontend/src/pages/Home/Dashboard.jsx`)
- Session dashboard → API endpoints: selects endpoints (evidence: `frontend/src/pages/Home/Dashboard.jsx`)
- Session dashboard → Profile card: renders (evidence: `frontend/src/pages/Home/Dashboard.jsx`)
- Session dashboard → Navigation: renders (evidence: `frontend/src/pages/Home/Dashboard.jsx`)
- Practice session view → API client paths: manages questions (evidence: `frontend/src/pages/InterviewPrep.jsx`)
- Practice session view → API endpoints: selects endpoints (evidence: `frontend/src/pages/InterviewPrep.jsx`)
- Practice session view → Question list: renders (evidence: `frontend/src/pages/InterviewPrep.jsx`)
- Practice session view → Navigation: renders (evidence: `frontend/src/pages/InterviewPrep.jsx`)
- Express server → Authentication routes: mounts (evidence: `backend/server.js`)
- Express server → Session routes: mounts (evidence: `backend/server.js`)
- Express server → Question routes: mounts (evidence: `backend/server.js`)
- Express server → AI generation: registers routes (evidence: `backend/server.js`)
- Authentication routes → Authentication: dispatches (evidence: `backend/routes/authRoutes.js`)
- Authentication routes → JWT verification: protects routes (evidence: `backend/routes/authRoutes.js`)
- Session routes → Session management: dispatches (evidence: `backend/routes/sessionRoutes.js`)
- Question routes → Question management: dispatches (evidence: `backend/routes/questionRoutes.js`)
- Question routes → JWT verification: protects routes (evidence: `backend/routes/questionRoutes.js`)
- Authentication → User records: reads and updates (evidence: `backend/controllers/authControllers.js`)
- Authentication → Avatar image storage: uploads avatar (evidence: `backend/controllers/authControllers.js`)
- Avatar image storage → Cloudinary service: uploads image (evidence: `backend/utils/cloudinary.js`)
- JWT verification → User records: loads user (evidence: `backend/middlewares/authMiddleware.js`)
- Session management → Session records: creates and queries (evidence: `backend/controllers/sessionControllers.js`)
- Session management → Question records: creates and deletes (evidence: `backend/controllers/sessionControllers.js`)
- Question management → Question records: manages records (evidence: `backend/controllers/questionControllers.js`)
- Question management → Session records: updates session (evidence: `backend/controllers/questionControllers.js`)
- AI generation → AI prompts: builds prompts (evidence: `backend/controllers/aiControllers.js`)
- AI generation → Google Gemini: generates content (evidence: `backend/controllers/aiControllers.js`)
- Express server → Database connection: connects database (evidence: `backend/server.js`)
- Database connection → MongoDB: connects
- Session records → MongoDB: persists
- Question records → MongoDB: persists
- User records → MongoDB: persists
