# u23ec179/interviewiq architecture

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

- Interactive diagram: https://gitdiagram.com/u23ec179/interviewiq
- Repository: https://github.com/u23ec179/interviewiq

## Overview

InterviewIQ is an AI interview-preparation application. Users sign in, configure an interview using resume/profile details, answer generated questions, and review scores and feedback; credits can be replenished through paid plans. The graph preserves the documented interview, history/report, authentication, and payment capabilities. Some client pages and routes are unsampled, so links to backend behavior are shown only where source excerpts establish them.

Main entry points: [`client/src/App.jsx`](https://github.com/u23ec179/interviewiq/blob/main/client/src/App.jsx) (App routing), [`server/index.js`](https://github.com/u23ec179/interviewiq/blob/main/server/index.js) (API server), [`client/src/pages/Auth.jsx`](https://github.com/u23ec179/interviewiq/blob/main/client/src/pages/Auth.jsx) (Google sign-in), [`server/controllers/interview.controller.js`](https://github.com/u23ec179/interviewiq/blob/main/server/controllers/interview.controller.js) (Interview workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client application"]
  node_app["App routing<br/>[App.jsx]"]
  node_auth_ui["Google sign-in<br/>[Auth.jsx]"]
  node_home["Interview setup<br/>[Home.jsx]"]
  node_interview_ui["Interview session<br/>[InterviewPage.jsx]"]
  node_history_ui["Interview history"]
  node_report_ui["Interview report"]
  node_pricing_ui["Pricing plans<br/>[Pricing.jsx]"]
  node_user_state["User state<br/>[userSlice.js]"]
end

subgraph group_interview["Interview services"]
  node_interview_routes["Interview routes<br/>[interview.route.js]"]
  node_interview_controller["Interview workflow"]
  node_ai_service["AI question and feedback"]
  node_interview_store[("Interview records<br/>[interview.model.js]")]
end

subgraph group_identity["Identity and data"]
  node_firebase["Firebase auth<br/>[firebase.js]"]
  node_api_server["API server<br/>[index.js]"]
  node_auth_routes["Auth routes<br/>[auth.route.js]"]
  node_user_routes["User routes<br/>[user.route.js]"]
  node_auth_controller["Google account handling<br/>[auth.controller.js]"]
  node_user_store[("User and credits<br/>[user.model.js]")]
end

subgraph group_billing["Credits and payments"]
  node_payment_routes["Payment routes<br/>[payment.route.js]"]
  node_payment_controller["Payment and credit grants"]
  node_payment_store[("Payment records<br/>[payment.model.js]")]
end

node_candidate(("Candidate"))
node_razorpay["Razorpay"]
node_openrouter["OpenRouter AI"]
node_mongo[("MongoDB")]

node_candidate -->|"uses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_auth_ui
node_app -->|"routes to"| node_interview_ui
node_app -->|"routes to"| node_history_ui
node_app -->|"routes to"| node_report_ui
node_app -->|"routes to"| node_pricing_ui
node_auth_ui -->|"signs in with"| node_firebase
node_auth_ui -->|"posts credentials"| node_auth_routes
node_app -->|"fetches current user"| node_user_routes
node_auth_ui -->|"updates"| node_user_state
node_app -->|"updates"| node_user_state
node_api_server -->|"mounts"| node_auth_routes
node_api_server -->|"mounts"| node_user_routes
node_api_server -->|"mounts"| node_interview_routes
node_api_server -->|"mounts"| node_payment_routes
node_interview_routes -->|"dispatches to"| node_interview_controller
node_interview_controller -->|"requests AI"| node_ai_service
node_ai_service -->|"calls"| node_openrouter
node_interview_controller -->|"reads and writes"| node_interview_store
node_interview_controller -->|"checks credits"| node_user_store
node_auth_controller -->|"finds or creates"| node_user_store
node_payment_routes -->|"dispatches to"| node_payment_controller
node_payment_controller -->|"creates orders"| node_razorpay
node_payment_controller -->|"creates and updates"| node_payment_store
node_payment_controller -->|"grants credits"| node_user_store
node_api_server -->|"connects database"| node_mongo

click node_app "https://github.com/u23ec179/interviewiq/blob/main/client/src/App.jsx"
click node_auth_ui "https://github.com/u23ec179/interviewiq/blob/main/client/src/pages/Auth.jsx"
click node_firebase "https://github.com/u23ec179/interviewiq/blob/main/client/src/utils/firebase.js"
click node_home "https://github.com/u23ec179/interviewiq/blob/main/client/src/pages/Home.jsx"
click node_interview_ui "https://github.com/u23ec179/interviewiq/blob/main/client/src/pages/InterviewPage.jsx"
click node_history_ui "https://github.com/u23ec179/interviewiq/blob/main/client/src/pages/InterviewHistory.jsx"
click node_report_ui "https://github.com/u23ec179/interviewiq/blob/main/client/src/pages/InterviewReport.jsx"
click node_pricing_ui "https://github.com/u23ec179/interviewiq/blob/main/client/src/pages/Pricing.jsx"
click node_user_state "https://github.com/u23ec179/interviewiq/blob/main/client/src/redux/userSlice.js"
click node_api_server "https://github.com/u23ec179/interviewiq/blob/main/server/index.js"
click node_auth_routes "https://github.com/u23ec179/interviewiq/blob/main/server/routes/auth.route.js"
click node_user_routes "https://github.com/u23ec179/interviewiq/blob/main/server/routes/user.route.js"
click node_interview_routes "https://github.com/u23ec179/interviewiq/blob/main/server/routes/interview.route.js"
click node_interview_controller "https://github.com/u23ec179/interviewiq/blob/main/server/controllers/interview.controller.js"
click node_ai_service "https://github.com/u23ec179/interviewiq/blob/main/server/services/openRouter.services.js"
click node_interview_store "https://github.com/u23ec179/interviewiq/blob/main/server/models/interview.model.js"
click node_auth_controller "https://github.com/u23ec179/interviewiq/blob/main/server/controllers/auth.controller.js"
click node_user_store "https://github.com/u23ec179/interviewiq/blob/main/server/models/user.model.js"
click node_payment_routes "https://github.com/u23ec179/interviewiq/blob/main/server/routes/payment.route.js"
click node_payment_controller "https://github.com/u23ec179/interviewiq/blob/main/server/controllers/payment.controller.js"
click node_payment_store "https://github.com/u23ec179/interviewiq/blob/main/server/models/payment.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_auth_ui,node_home,node_interview_ui,node_history_ui,node_report_ui,node_pricing_ui,node_user_state toneBlue
class node_interview_routes,node_interview_controller,node_ai_service,node_interview_store,node_mongo toneAmber
class node_firebase,node_api_server,node_auth_routes,node_user_routes,node_auth_controller,node_user_store,node_openrouter toneMint
class node_payment_routes,node_payment_controller,node_payment_store toneRose
class node_candidate,node_razorpay toneIndigo
```

## Components

### Client application

- [App routing](https://github.com/u23ec179/interviewiq/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Google sign-in](https://github.com/u23ec179/interviewiq/blob/main/client/src/pages/Auth.jsx): `client/src/pages/Auth.jsx`
- [Interview setup](https://github.com/u23ec179/interviewiq/blob/main/client/src/pages/Home.jsx): `client/src/pages/Home.jsx`
- [Interview session](https://github.com/u23ec179/interviewiq/blob/main/client/src/pages/InterviewPage.jsx): `client/src/pages/InterviewPage.jsx`
- [Interview history](https://github.com/u23ec179/interviewiq/blob/main/client/src/pages/InterviewHistory.jsx): `client/src/pages/InterviewHistory.jsx`
- [Interview report](https://github.com/u23ec179/interviewiq/blob/main/client/src/pages/InterviewReport.jsx): `client/src/pages/InterviewReport.jsx`
- [Pricing plans](https://github.com/u23ec179/interviewiq/blob/main/client/src/pages/Pricing.jsx): `client/src/pages/Pricing.jsx`
- [User state](https://github.com/u23ec179/interviewiq/blob/main/client/src/redux/userSlice.js): `client/src/redux/userSlice.js`

### Interview services

- [Interview routes](https://github.com/u23ec179/interviewiq/blob/main/server/routes/interview.route.js): `server/routes/interview.route.js`
- [Interview workflow](https://github.com/u23ec179/interviewiq/blob/main/server/controllers/interview.controller.js): `server/controllers/interview.controller.js`
- [AI question and feedback](https://github.com/u23ec179/interviewiq/blob/main/server/services/openRouter.services.js): `server/services/openRouter.services.js`
- [Interview records](https://github.com/u23ec179/interviewiq/blob/main/server/models/interview.model.js): `server/models/interview.model.js`

### Identity and data

- [Firebase auth](https://github.com/u23ec179/interviewiq/blob/main/client/src/utils/firebase.js): `client/src/utils/firebase.js`
- [API server](https://github.com/u23ec179/interviewiq/blob/main/server/index.js): `server/index.js`
- [Auth routes](https://github.com/u23ec179/interviewiq/blob/main/server/routes/auth.route.js): `server/routes/auth.route.js`
- [User routes](https://github.com/u23ec179/interviewiq/blob/main/server/routes/user.route.js): `server/routes/user.route.js`
- [Google account handling](https://github.com/u23ec179/interviewiq/blob/main/server/controllers/auth.controller.js): `server/controllers/auth.controller.js`
- [User and credits](https://github.com/u23ec179/interviewiq/blob/main/server/models/user.model.js): `server/models/user.model.js`

### Credits and payments

- [Payment routes](https://github.com/u23ec179/interviewiq/blob/main/server/routes/payment.route.js): `server/routes/payment.route.js`
- [Payment and credit grants](https://github.com/u23ec179/interviewiq/blob/main/server/controllers/payment.controller.js): `server/controllers/payment.controller.js`
- [Payment records](https://github.com/u23ec179/interviewiq/blob/main/server/models/payment.model.js): `server/models/payment.model.js`

### Other components

- **Candidate**
- **Razorpay**
- **OpenRouter AI**
- **MongoDB**

## Connections

- Candidate → App routing: uses (evidence: `client/src/App.jsx`)
- App routing → Interview setup: routes to (evidence: `client/src/App.jsx`)
- App routing → Google sign-in: routes to (evidence: `client/src/App.jsx`)
- App routing → Interview session: routes to (evidence: `client/src/App.jsx`)
- App routing → Interview history: routes to (evidence: `client/src/App.jsx`)
- App routing → Interview report: routes to (evidence: `client/src/App.jsx`)
- App routing → Pricing plans: routes to (evidence: `client/src/App.jsx`)
- Google sign-in → Firebase auth: signs in with (evidence: `client/src/pages/Auth.jsx`)
- Google sign-in → Auth routes: posts credentials (evidence: `client/src/pages/Auth.jsx`)
- App routing → User routes: fetches current user (evidence: `client/src/App.jsx`)
- Google sign-in → User state: updates (evidence: `client/src/pages/Auth.jsx`)
- App routing → User state: updates (evidence: `client/src/App.jsx`)
- API server → Auth routes: mounts (evidence: `server/index.js`)
- API server → User routes: mounts (evidence: `server/index.js`)
- API server → Interview routes: mounts (evidence: `server/index.js`)
- API server → Payment routes: mounts (evidence: `server/index.js`)
- Interview routes → Interview workflow: dispatches to (evidence: `server/routes/interview.route.js`)
- Interview workflow → AI question and feedback: requests AI (evidence: `server/controllers/interview.controller.js`)
- AI question and feedback → OpenRouter AI: calls (evidence: `server/services/openRouter.services.js`)
- Interview workflow → Interview records: reads and writes (evidence: `server/controllers/interview.controller.js`)
- Interview workflow → User and credits: checks credits (evidence: `server/controllers/interview.controller.js`)
- Google account handling → User and credits: finds or creates (evidence: `server/controllers/auth.controller.js`)
- Payment routes → Payment and credit grants: dispatches to (evidence: `server/routes/payment.route.js`)
- Payment and credit grants → Razorpay: creates orders (evidence: `server/controllers/payment.controller.js`)
- Payment and credit grants → Payment records: creates and updates (evidence: `server/controllers/payment.controller.js`)
- Payment and credit grants → User and credits: grants credits (evidence: `server/controllers/payment.controller.js`)
- API server → MongoDB: connects database (evidence: `server/index.js`)
