# vks7102/zenquro-ai_interview architecture

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

- Interactive diagram: https://gitdiagram.com/vks7102/zenquro-ai_interview
- Repository: https://github.com/vks7102/zenquro-ai_interview

## Overview

Zenquro is an AI interview-practice product with account and plan management, paid subscriptions, and an admin console. The primary workflow is a candidate starting an interview, exchanging answers and generated questions, then receiving a saved report and history. The backend controller and route excerpts establish much of that flow; the README provides no further detail, and the Flutter application’s Dart UI sources are absent from the supplied tree, so its client-side workflow is not expanded here.

Main entry points: [`backend/src/controllers/interviewController.js`](https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/controllers/interviewController.js) (Interview workflow), [`backend/src/controllers/subscriptionController.js`](https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/controllers/subscriptionController.js) (Subscription workflow), [`backend/src/controllers/adminController.js`](https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/controllers/adminController.js) (Admin operations), [`backend/src/controllers/authController.js`](https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/controllers/authController.js) (Account workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_candidate["Interview practice"]
  node_interview_api["Interview API<br/>[interviewRoutes.js]"]
  node_interview_flow["Interview workflow"]
  node_ai_service["AI interview service<br/>[aiService.js]"]
  node_tts_service["Speech synthesis<br/>[ttsService.js]"]
  node_interview_store[("Interview data")]
  node_message_store[("Interview messages")]
  node_report_store[("Interview reports<br/>[InterviewReport.js]")]
end

subgraph group_accounts["Accounts and billing"]
  node_user_store[("User accounts<br/>[User.js]")]
  node_auth_api["Account API<br/>[authRoutes.js]"]
  node_auth_flow["Account workflow<br/>[authController.js]"]
  node_plan_service["Plan access<br/>[planService.js]"]
  node_plan_store[("Plans<br/>[Plan.js]")]
  node_subscription_flow["Subscription workflow"]
  node_subscription_service["Subscription service"]
  node_coupon_service["Coupon service<br/>[couponService.js]"]
  node_subscription_store[("Subscriptions<br/>[Subscription.js]")]
  node_coupon_store[("Coupons<br/>[Coupon.js]")]
end

subgraph group_operations["Administration"]
  node_admin_app["Admin console<br/>[App.jsx]"]
  node_admin_api_client["Admin API client<br/>[api.js]"]
  node_admin_routes["Admin API<br/>[adminRoutes.js]"]
  node_admin_flow["Admin operations<br/>[adminController.js]"]
  node_admin_store[("Admin accounts<br/>[Admin.js]")]
end

subgraph group_runtime["Backend runtime"]
  node_backend_app["HTTP application<br/>[app.js]"]
  node_database_config["Database connection<br/>[db.js]"]
end

node_candidate_user(("Candidate"))
node_openai["OpenAI-compatible API"]
node_speech_provider["Speech provider"]
node_payment_provider["Razorpay"]
node_admin_user(("Administrator"))

node_candidate_user -->|"starts and answers"| node_interview_api
node_interview_api -->|"dispatches requests"| node_interview_flow
node_interview_flow -->|"loads user"| node_user_store
node_interview_flow -->|"checks quota"| node_plan_service
node_plan_service -->|"reads plans"| node_plan_store
node_interview_flow -->|"creates and updates"| node_interview_store
node_interview_flow -->|"reads and saves"| node_message_store
node_interview_flow -->|"generates questions and reports"| node_ai_service
node_ai_service -->|"requests completions"| node_openai
node_interview_flow -->|"synthesizes questions"| node_tts_service
node_tts_service -.->|"requests speech"| node_speech_provider
node_interview_flow -->|"saves and reads reports"| node_report_store
node_interview_flow -->|"lists history"| node_interview_store
node_interview_flow -->|"loads history scores"| node_report_store
node_candidate_user -->|"authenticates"| node_auth_api
node_auth_api -->|"dispatches requests"| node_auth_flow
node_auth_flow -->|"creates and reads users"| node_user_store
node_auth_flow -->|"builds access limits"| node_plan_service
node_auth_flow -->|"reads selected plan"| node_plan_store
node_candidate_user -->|"manages subscription"| node_subscription_flow
node_auth_api -->|"dispatches billing routes"| node_subscription_flow
node_subscription_flow -->|"reads plan"| node_plan_store
node_subscription_flow -->|"reads and updates user"| node_user_store
node_subscription_flow -->|"validates coupon"| node_coupon_service
node_coupon_service -->|"checks usage"| node_coupon_store
node_subscription_flow -->|"reads and updates coupon"| node_coupon_store
node_subscription_flow -->|"checks subscription state"| node_subscription_service
node_subscription_flow -->|"creates and updates"| node_subscription_store
node_subscription_flow -->|"creates and verifies billing"| node_payment_provider
node_admin_user -->|"uses console"| node_admin_app
node_admin_app -->|"requests admin data"| node_admin_api_client
node_admin_api_client -->|"calls admin endpoints"| node_admin_routes
node_admin_routes -->|"dispatches requests"| node_admin_flow
node_admin_flow -->|"authenticates admin"| node_admin_store
node_admin_flow -->|"manages users"| node_user_store
node_admin_flow -->|"manages plans"| node_plan_store
node_admin_flow -->|"manages coupons"| node_coupon_store
node_admin_flow -->|"lists subscriptions"| node_subscription_store
node_backend_app -->|"mounts routes"| node_auth_api
node_backend_app -->|"mounts routes"| node_interview_api
node_backend_app -->|"mounts routes"| node_admin_routes
node_database_config -->|"connects database"| node_interview_store

click node_interview_api "https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/routes/interviewRoutes.js"
click node_interview_flow "https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/controllers/interviewController.js"
click node_ai_service "https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/services/aiService.js"
click node_tts_service "https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/services/ttsService.js"
click node_interview_store "https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/models/InterviewSession.js"
click node_message_store "https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/models/InterviewMessage.js"
click node_report_store "https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/models/InterviewReport.js"
click node_user_store "https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/models/User.js"
click node_auth_api "https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/routes/authRoutes.js"
click node_auth_flow "https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/controllers/authController.js"
click node_plan_service "https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/services/planService.js"
click node_plan_store "https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/models/Plan.js"
click node_subscription_flow "https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/controllers/subscriptionController.js"
click node_subscription_service "https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/services/subscriptionService.js"
click node_coupon_service "https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/services/couponService.js"
click node_subscription_store "https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/models/Subscription.js"
click node_coupon_store "https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/models/Coupon.js"
click node_admin_app "https://github.com/vks7102/zenquro-ai_interview/blob/main/admin-panel/src/App.jsx"
click node_admin_api_client "https://github.com/vks7102/zenquro-ai_interview/blob/main/admin-panel/src/api.js"
click node_admin_routes "https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/routes/adminRoutes.js"
click node_admin_flow "https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/controllers/adminController.js"
click node_admin_store "https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/models/Admin.js"
click node_backend_app "https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/app.js"
click node_database_config "https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/config/db.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_interview_api,node_interview_flow,node_ai_service,node_tts_service,node_interview_store,node_message_store,node_report_store toneBlue
class node_user_store,node_auth_api,node_auth_flow,node_plan_service,node_plan_store,node_subscription_flow,node_subscription_service,node_coupon_service,node_subscription_store,node_coupon_store toneAmber
class node_admin_app,node_admin_api_client,node_admin_routes,node_admin_flow,node_admin_store,node_openai toneMint
class node_backend_app,node_database_config toneRose
class node_candidate_user,node_speech_provider,node_payment_provider,node_admin_user toneIndigo
```

## Components

### Interview practice

- [Interview API](https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/routes/interviewRoutes.js): `backend/src/routes/interviewRoutes.js`
- [Interview workflow](https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/controllers/interviewController.js): `backend/src/controllers/interviewController.js`
- [AI interview service](https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/services/aiService.js): `backend/src/services/aiService.js`
- [Speech synthesis](https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/services/ttsService.js): `backend/src/services/ttsService.js`
- [Interview data](https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/models/InterviewSession.js): `backend/src/models/InterviewSession.js`
- [Interview messages](https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/models/InterviewMessage.js): `backend/src/models/InterviewMessage.js`
- [Interview reports](https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/models/InterviewReport.js): `backend/src/models/InterviewReport.js`

### Accounts and billing

- [User accounts](https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/models/User.js): `backend/src/models/User.js`
- [Account API](https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/routes/authRoutes.js): `backend/src/routes/authRoutes.js`
- [Account workflow](https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/controllers/authController.js): `backend/src/controllers/authController.js`
- [Plan access](https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/services/planService.js): `backend/src/services/planService.js`
- [Plans](https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/models/Plan.js): `backend/src/models/Plan.js`
- [Subscription workflow](https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/controllers/subscriptionController.js): `backend/src/controllers/subscriptionController.js`
- [Subscription service](https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/services/subscriptionService.js): `backend/src/services/subscriptionService.js`
- [Coupon service](https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/services/couponService.js): `backend/src/services/couponService.js`
- [Subscriptions](https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/models/Subscription.js): `backend/src/models/Subscription.js`
- [Coupons](https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/models/Coupon.js): `backend/src/models/Coupon.js`

### Administration

- [Admin console](https://github.com/vks7102/zenquro-ai_interview/blob/main/admin-panel/src/App.jsx): `admin-panel/src/App.jsx`
- [Admin API client](https://github.com/vks7102/zenquro-ai_interview/blob/main/admin-panel/src/api.js): `admin-panel/src/api.js`
- [Admin API](https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/routes/adminRoutes.js): `backend/src/routes/adminRoutes.js`
- [Admin operations](https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/controllers/adminController.js): `backend/src/controllers/adminController.js`
- [Admin accounts](https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/models/Admin.js): `backend/src/models/Admin.js`

### Backend runtime

- [HTTP application](https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/app.js): `backend/src/app.js`
- [Database connection](https://github.com/vks7102/zenquro-ai_interview/blob/main/backend/src/config/db.js): `backend/src/config/db.js`

### Other components

- **Candidate**
- **OpenAI-compatible API**
- **Speech provider**
- **Razorpay**
- **Administrator**

## Connections

- Candidate → Interview API: starts and answers
- Interview API → Interview workflow: dispatches requests
- Interview workflow → User accounts: loads user
- Interview workflow → Plan access: checks quota
- Plan access → Plans: reads plans
- Interview workflow → Interview data: creates and updates
- Interview workflow → Interview messages: reads and saves
- Interview workflow → AI interview service: generates questions and reports
- AI interview service → OpenAI-compatible API: requests completions
- Interview workflow → Speech synthesis: synthesizes questions
- Speech synthesis → Speech provider: requests speech
- Interview workflow → Interview reports: saves and reads reports
- Interview workflow → Interview data: lists history
- Interview workflow → Interview reports: loads history scores
- Candidate → Account API: authenticates
- Account API → Account workflow: dispatches requests
- Account workflow → User accounts: creates and reads users
- Account workflow → Plan access: builds access limits
- Account workflow → Plans: reads selected plan
- Candidate → Subscription workflow: manages subscription
- Account API → Subscription workflow: dispatches billing routes
- Subscription workflow → Plans: reads plan
- Subscription workflow → User accounts: reads and updates user
- Subscription workflow → Coupon service: validates coupon
- Coupon service → Coupons: checks usage
- Subscription workflow → Coupons: reads and updates coupon
- Subscription workflow → Subscription service: checks subscription state
- Subscription workflow → Subscriptions: creates and updates
- Subscription workflow → Razorpay: creates and verifies billing
- Administrator → Admin console: uses console
- Admin console → Admin API client: requests admin data
- Admin API client → Admin API: calls admin endpoints
- Admin API → Admin operations: dispatches requests
- Admin operations → Admin accounts: authenticates admin
- Admin operations → User accounts: manages users
- Admin operations → Plans: manages plans
- Admin operations → Coupons: manages coupons
- Admin operations → Subscriptions: lists subscriptions
- HTTP application → Account API: mounts routes
- HTTP application → Interview API: mounts routes
- HTTP application → Admin API: mounts routes
- Database connection → Interview data: connects database
