# charansaigompa/interviewiq-ai architecture

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

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

## Overview

InterviewIQ AI is a full-stack mock-interview product: users authenticate, configure a role-specific interview (optionally using resume context), answer by voice or text, and receive evaluated results and reports. The map includes the documented history, analytics, and credit-purchase branches. The interview controller excerpt supports resume parsing, AI question generation, answer scoring, and persisted results; unsampled UI and route wiring is shown only at the documented subsystem level.

Main entry points: [`server/index.js`](https://github.com/charansaigompa/interviewiq-ai/blob/main/server/index.js) (Express API), [`client/src/App.jsx`](https://github.com/charansaigompa/interviewiq-ai/blob/main/client/src/App.jsx) (React application), [`server/models/user.model.js`](https://github.com/charansaigompa/interviewiq-ai/blob/main/server/models/user.model.js) (User records and credits), [`server/controllers/auth.controller.js`](https://github.com/charansaigompa/interviewiq-ai/blob/main/server/controllers/auth.controller.js) (Authentication logic)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Interview experience"]
  node_webapp["React application<br/>[App.jsx]"]
  node_authui["Sign-in and setup<br/>[Auth.jsx]"]
  node_setup["Interview setup<br/>[Setp1SetUp.jsx]"]
  node_session["Interview session<br/>[Step2Interview.jsx]"]
  node_history["Interview history"]
  node_report["Analytics and report"]
  node_pricing["Credit plans<br/>[Pricing.jsx]"]
end

subgraph group_server["API and domain"]
  node_backend["Express API<br/>[index.js]"]
  node_authroutes["Authentication routes<br/>[auth.routes.js]"]
  node_interviewroutes["Interview routes<br/>[interview.route.js]"]
  node_userroutes["User routes<br/>[user.route.js]"]
  node_paymentroutes["Payment routes<br/>[payment.route.js]"]
  node_authcontroller["Authentication logic<br/>[auth.controller.js]"]
  node_interviewcontroller["Interview workflow"]
  node_usercontroller["User profile<br/>[user.controller.js]"]
  node_paymentcontroller["Payment workflow"]
  node_authguard["JWT authorization<br/>[isAuth.js]"]
end

subgraph group_ai["AI evaluation"]
  node_ai["OpenRouter client"]
end

subgraph group_state["Product data"]
  node_users[("User records and credits<br/>[user.model.js]")]
  node_interviews[("Interview records<br/>[interview.model.js]")]
  node_payments[("Payment records<br/>[payment.model.js]")]
end

subgraph group_services["External services"]
  node_speech["Browser speech APIs"]
  node_firebase["Firebase Authentication<br/>[firebase.js]"]
  node_openrouter["OpenRouter AI"]
  node_razorpay["Razorpay"]
  node_mongo[("MongoDB")]
end

node_candidate(("Candidate"))

node_candidate -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_authui
node_webapp -->|"routes to"| node_setup
node_webapp -->|"routes to"| node_session
node_webapp -->|"routes to"| node_history
node_webapp -->|"routes to"| node_report
node_webapp -->|"routes to"| node_pricing
node_authui -.->|"Google sign-in"| node_firebase
node_authui -->|"sends auth requests"| node_backend
node_setup -->|"requests interview"| node_backend
node_session -->|"submits answers"| node_backend
node_session -.->|"uses voice"| node_speech
node_history -->|"loads history"| node_backend
node_report -->|"loads report"| node_backend
node_pricing -->|"requests payment"| node_backend
node_backend -->|"mounts"| node_authroutes
node_backend -->|"mounts"| node_interviewroutes
node_backend -->|"mounts"| node_userroutes
node_backend -->|"mounts"| node_paymentroutes
node_authroutes -->|"dispatches"| node_authcontroller
node_authguard -->|"authorizes"| node_authcontroller
node_authcontroller -->|"reads and writes"| node_users
node_authcontroller -->|"issues user identity"| node_users
node_interviewcontroller -->|"requests analysis and scoring"| node_ai
node_ai -->|"sends prompts"| node_openrouter
node_interviewcontroller -->|"checks and deducts credits"| node_users
node_interviewcontroller -->|"creates and updates"| node_interviews
node_usercontroller -->|"reads profile"| node_users
node_paymentcontroller -->|"creates orders"| node_razorpay
node_paymentcontroller -->|"creates and verifies records"| node_payments
node_paymentcontroller -->|"adds credits"| node_users
node_users -->|"persists"| node_mongo
node_interviews -->|"persists"| node_mongo
node_payments -->|"persists"| node_mongo

click node_webapp "https://github.com/charansaigompa/interviewiq-ai/blob/main/client/src/App.jsx"
click node_authui "https://github.com/charansaigompa/interviewiq-ai/blob/main/client/src/pages/Auth.jsx"
click node_setup "https://github.com/charansaigompa/interviewiq-ai/blob/main/client/src/components/Setp1SetUp.jsx"
click node_session "https://github.com/charansaigompa/interviewiq-ai/blob/main/client/src/components/Step2Interview.jsx"
click node_history "https://github.com/charansaigompa/interviewiq-ai/blob/main/client/src/pages/InterviewHistory.jsx"
click node_report "https://github.com/charansaigompa/interviewiq-ai/blob/main/client/src/pages/InterviewReport.jsx"
click node_pricing "https://github.com/charansaigompa/interviewiq-ai/blob/main/client/src/pages/Pricing.jsx"
click node_backend "https://github.com/charansaigompa/interviewiq-ai/blob/main/server/index.js"
click node_authroutes "https://github.com/charansaigompa/interviewiq-ai/blob/main/server/routes/auth.routes.js"
click node_interviewroutes "https://github.com/charansaigompa/interviewiq-ai/blob/main/server/routes/interview.route.js"
click node_userroutes "https://github.com/charansaigompa/interviewiq-ai/blob/main/server/routes/user.route.js"
click node_paymentroutes "https://github.com/charansaigompa/interviewiq-ai/blob/main/server/routes/payment.route.js"
click node_authcontroller "https://github.com/charansaigompa/interviewiq-ai/blob/main/server/controllers/auth.controller.js"
click node_interviewcontroller "https://github.com/charansaigompa/interviewiq-ai/blob/main/server/controllers/interview.controller.js"
click node_usercontroller "https://github.com/charansaigompa/interviewiq-ai/blob/main/server/controllers/user.controller.js"
click node_paymentcontroller "https://github.com/charansaigompa/interviewiq-ai/blob/main/server/controllers/payment.controller.js"
click node_authguard "https://github.com/charansaigompa/interviewiq-ai/blob/main/server/middlewares/isAuth.js"
click node_ai "https://github.com/charansaigompa/interviewiq-ai/blob/main/server/services/openRouter.service.js"
click node_users "https://github.com/charansaigompa/interviewiq-ai/blob/main/server/models/user.model.js"
click node_interviews "https://github.com/charansaigompa/interviewiq-ai/blob/main/server/models/interview.model.js"
click node_payments "https://github.com/charansaigompa/interviewiq-ai/blob/main/server/models/payment.model.js"
click node_firebase "https://github.com/charansaigompa/interviewiq-ai/blob/main/client/src/utils/firebase.js"
click node_razorpay "https://github.com/charansaigompa/interviewiq-ai/blob/main/server/services/razorpay.service.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_webapp,node_authui,node_setup,node_session,node_history,node_report,node_pricing toneBlue
class node_backend,node_authroutes,node_interviewroutes,node_userroutes,node_paymentroutes,node_authcontroller,node_interviewcontroller,node_usercontroller,node_paymentcontroller,node_authguard toneAmber
class node_ai toneMint
class node_users,node_interviews,node_payments toneRose
class node_speech,node_firebase,node_openrouter,node_razorpay,node_mongo,node_candidate toneIndigo
```

## Components

### Interview experience

- [React application](https://github.com/charansaigompa/interviewiq-ai/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Sign-in and setup](https://github.com/charansaigompa/interviewiq-ai/blob/main/client/src/pages/Auth.jsx): `client/src/pages/Auth.jsx`
- [Interview setup](https://github.com/charansaigompa/interviewiq-ai/blob/main/client/src/components/Setp1SetUp.jsx): `client/src/components/Setp1SetUp.jsx`
- [Interview session](https://github.com/charansaigompa/interviewiq-ai/blob/main/client/src/components/Step2Interview.jsx): `client/src/components/Step2Interview.jsx`
- [Interview history](https://github.com/charansaigompa/interviewiq-ai/blob/main/client/src/pages/InterviewHistory.jsx): `client/src/pages/InterviewHistory.jsx`
- [Analytics and report](https://github.com/charansaigompa/interviewiq-ai/blob/main/client/src/pages/InterviewReport.jsx): `client/src/pages/InterviewReport.jsx`
- [Credit plans](https://github.com/charansaigompa/interviewiq-ai/blob/main/client/src/pages/Pricing.jsx): `client/src/pages/Pricing.jsx`

### API and domain

- [Express API](https://github.com/charansaigompa/interviewiq-ai/blob/main/server/index.js): `server/index.js`
- [Authentication routes](https://github.com/charansaigompa/interviewiq-ai/blob/main/server/routes/auth.routes.js): `server/routes/auth.routes.js`
- [Interview routes](https://github.com/charansaigompa/interviewiq-ai/blob/main/server/routes/interview.route.js): `server/routes/interview.route.js`
- [User routes](https://github.com/charansaigompa/interviewiq-ai/blob/main/server/routes/user.route.js): `server/routes/user.route.js`
- [Payment routes](https://github.com/charansaigompa/interviewiq-ai/blob/main/server/routes/payment.route.js): `server/routes/payment.route.js`
- [Authentication logic](https://github.com/charansaigompa/interviewiq-ai/blob/main/server/controllers/auth.controller.js): `server/controllers/auth.controller.js`
- [Interview workflow](https://github.com/charansaigompa/interviewiq-ai/blob/main/server/controllers/interview.controller.js): `server/controllers/interview.controller.js`
- [User profile](https://github.com/charansaigompa/interviewiq-ai/blob/main/server/controllers/user.controller.js): `server/controllers/user.controller.js`
- [Payment workflow](https://github.com/charansaigompa/interviewiq-ai/blob/main/server/controllers/payment.controller.js): `server/controllers/payment.controller.js`
- [JWT authorization](https://github.com/charansaigompa/interviewiq-ai/blob/main/server/middlewares/isAuth.js): `server/middlewares/isAuth.js`

### AI evaluation

- [OpenRouter client](https://github.com/charansaigompa/interviewiq-ai/blob/main/server/services/openRouter.service.js): `server/services/openRouter.service.js`

### Product data

- [User records and credits](https://github.com/charansaigompa/interviewiq-ai/blob/main/server/models/user.model.js): `server/models/user.model.js`
- [Interview records](https://github.com/charansaigompa/interviewiq-ai/blob/main/server/models/interview.model.js): `server/models/interview.model.js`
- [Payment records](https://github.com/charansaigompa/interviewiq-ai/blob/main/server/models/payment.model.js): `server/models/payment.model.js`

### External services

- **Browser speech APIs**
- [Firebase Authentication](https://github.com/charansaigompa/interviewiq-ai/blob/main/client/src/utils/firebase.js): `client/src/utils/firebase.js`
- **OpenRouter AI**
- [Razorpay](https://github.com/charansaigompa/interviewiq-ai/blob/main/server/services/razorpay.service.js): `server/services/razorpay.service.js`
- **MongoDB**

### Other components

- **Candidate**

## Connections

- Candidate → React application: uses
- React application → Sign-in and setup: routes to
- React application → Interview setup: routes to
- React application → Interview session: routes to
- React application → Interview history: routes to
- React application → Analytics and report: routes to
- React application → Credit plans: routes to
- Sign-in and setup → Firebase Authentication: Google sign-in
- Sign-in and setup → Express API: sends auth requests
- Interview setup → Express API: requests interview
- Interview session → Express API: submits answers
- Interview session → Browser speech APIs: uses voice
- Interview history → Express API: loads history
- Analytics and report → Express API: loads report
- Credit plans → Express API: requests payment
- Express API → Authentication routes: mounts
- Express API → Interview routes: mounts
- Express API → User routes: mounts
- Express API → Payment routes: mounts
- Authentication routes → Authentication logic: dispatches
- JWT authorization → Authentication logic: authorizes
- Authentication logic → User records and credits: reads and writes
- Authentication logic → User records and credits: issues user identity
- Interview workflow → OpenRouter client: requests analysis and scoring
- OpenRouter client → OpenRouter AI: sends prompts
- Interview workflow → User records and credits: checks and deducts credits
- Interview workflow → Interview records: creates and updates
- User profile → User records and credits: reads profile
- Payment workflow → Razorpay: creates orders
- Payment workflow → Payment records: creates and verifies records
- Payment workflow → User records and credits: adds credits
- User records and credits → MongoDB: persists
- Interview records → MongoDB: persists
- Payment records → MongoDB: persists
