# netizen-om/pravya-ai architecture

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

- Interactive diagram: https://gitdiagram.com/netizen-om/pravya-ai
- Repository: https://github.com/netizen-om/pravya-ai

## Overview

Pravya AI is a multi-service interview-practice and resume-analysis platform, with a separate admin console. The primary workflow runs from interview setup through live voice interaction to persisted transcripts and asynchronous AI feedback; the parallel resume workflow uploads and analyzes a resume, then supports contextual chat. The README documents these stages and the service boundaries. Sampled worker code confirms interview-question generation and resume-chat dependencies; unsampled service internals are represented only where documented, so some links are dashed.

Main entry points: [`packages/db`](https://github.com/netizen-om/pravya-ai/tree/main/packages/db) (PostgreSQL data), [`apps/worker/src/controller/resume.controller.ts`](https://github.com/netizen-om/pravya-ai/blob/main/apps/worker/src/controller/resume.controller.ts) (Resume processing and chat), [`apps/ws-server/src/index.ts`](https://github.com/netizen-om/pravya-ai/blob/main/apps/ws-server/src/index.ts) (Live interview server), [`apps/worker/src/controller/interview.controller.ts`](https://github.com/netizen-om/pravya-ai/blob/main/apps/worker/src/controller/interview.controller.ts) (Question generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_product["User application"]
  node_pravya["Pravya app"]
  node_interview_ui["Interview experience"]
  node_resume_ui["Resume workspace"]
end

subgraph group_interview["Interview services"]
  node_ws["Live interview server<br/>[index.ts]"]
  node_speech["Speech transcription<br/>[deepGramClient.ts]"]
  node_interview_ai["Interview AI<br/>[gemini.ts]"]
  node_worker["Background worker<br/>[index.ts]"]
  node_interview_routes["Interview job routes"]
  node_interview_controller["Question generation"]
  node_feedback["Feedback analysis"]
end

subgraph group_resume["Resume services"]
  node_resume_upload["Resume upload API<br/>[route.ts]"]
  node_resume_routes["Resume job routes<br/>[resume.routes.ts]"]
  node_resume_controller["Resume processing and chat"]
  node_resume_parse["PDF parsing<br/>[parseResume.ts]"]
  node_embedding["Text embeddings<br/>[embedding.ts]"]
  node_vectors[("Vector search<br/>[qdrant.ts]")]
end

subgraph group_billing["Billing and administration"]
  node_payment["Checkout and subscription<br/>[route.ts]"]
  node_payment_webhook["Payment webhook<br/>[route.ts]"]
  node_admin["Admin console"]
  node_admin_api["Admin APIs"]
  node_webhooks["Email webhooks<br/>[index.ts]"]
end

subgraph group_shared["Shared platform"]
  node_auth["User authentication<br/>[index.ts]"]
  node_db[("PostgreSQL data")]
  node_qdrant[("Qdrant")]
end

node_user(("Candidate"))
node_deepgram["Deepgram"]
node_dodopayments["DodoPayments"]

node_user -->|"uses"| node_pravya
node_pravya -->|"authenticates with"| node_auth
node_pravya -->|"offers"| node_interview_ui
node_interview_ui -.->|"starts live session"| node_ws
node_ws -->|"transcribes audio"| node_speech
node_speech -->|"uses"| node_deepgram
node_ws -->|"streams AI interaction"| node_interview_ai
node_ws -.->|"persists transcript"| node_db
node_ws -.->|"queues analysis"| node_worker
node_worker -.->|"mounts routes"| node_interview_routes
node_interview_routes -->|"dispatches"| node_interview_controller
node_interview_controller -->|"reads and writes"| node_db
node_interview_controller -.->|"analyzes results"| node_feedback
node_interview_controller -->|"generates questions"| node_interview_ai
node_interview_ui -->|"shows feedback"| node_feedback
node_user -->|"uploads resume"| node_resume_ui
node_resume_ui -.->|"sends PDF"| node_resume_upload
node_resume_upload -.->|"submits processing job"| node_worker
node_worker -.->|"mounts routes"| node_resume_routes
node_resume_routes -->|"dispatches"| node_resume_controller
node_resume_controller -.->|"parses resume"| node_resume_parse
node_resume_controller -->|"creates embeddings"| node_embedding
node_resume_controller -->|"searches vectors"| node_vectors
node_embedding -.->|"stores vectors"| node_qdrant
node_resume_controller -->|"reads analysis"| node_db
node_resume_ui -.->|"chats with resume"| node_resume_controller
node_user -->|"subscribes"| node_payment
node_payment -->|"checks session"| node_auth
node_payment -->|"reads user"| node_db
node_payment -->|"creates checkout"| node_dodopayments
node_dodopayments -->|"sends events"| node_payment_webhook
node_payment_webhook -->|"updates payments"| node_db
node_user -->|"administers platform"| node_admin
node_admin -.->|"manages records"| node_admin_api
node_admin_api -->|"reads and writes"| node_db
node_webhooks -->|"uses data"| node_db

click node_pravya "https://github.com/netizen-om/pravya-ai/tree/main/apps/pravya"
click node_auth "https://github.com/netizen-om/pravya-ai/blob/main/packages/auth/index.ts"
click node_interview_ui "https://github.com/netizen-om/pravya-ai/tree/main/apps/pravya/src/app/interview"
click node_ws "https://github.com/netizen-om/pravya-ai/blob/main/apps/ws-server/src/index.ts"
click node_speech "https://github.com/netizen-om/pravya-ai/blob/main/apps/ws-server/src/lib/deepGramClient.ts"
click node_interview_ai "https://github.com/netizen-om/pravya-ai/blob/main/apps/ws-server/src/lib/gemini.ts"
click node_worker "https://github.com/netizen-om/pravya-ai/blob/main/apps/worker/src/index.ts"
click node_interview_routes "https://github.com/netizen-om/pravya-ai/blob/main/apps/worker/src/routes/interview.routes.ts"
click node_interview_controller "https://github.com/netizen-om/pravya-ai/blob/main/apps/worker/src/controller/interview.controller.ts"
click node_feedback "https://github.com/netizen-om/pravya-ai/blob/main/apps/worker/src/utils/analyseInterview.ts"
click node_resume_ui "https://github.com/netizen-om/pravya-ai/tree/main/apps/pravya/src/app/resume"
click node_resume_upload "https://github.com/netizen-om/pravya-ai/blob/main/apps/pravya/src/app/api/upload/resume-upload/route.ts"
click node_resume_routes "https://github.com/netizen-om/pravya-ai/blob/main/apps/worker/src/routes/resume.routes.ts"
click node_resume_controller "https://github.com/netizen-om/pravya-ai/blob/main/apps/worker/src/controller/resume.controller.ts"
click node_resume_parse "https://github.com/netizen-om/pravya-ai/blob/main/apps/worker/src/utils/parseResume.ts"
click node_embedding "https://github.com/netizen-om/pravya-ai/blob/main/apps/worker/src/lib/embedding.ts"
click node_vectors "https://github.com/netizen-om/pravya-ai/blob/main/apps/worker/src/lib/qdrant.ts"
click node_payment "https://github.com/netizen-om/pravya-ai/blob/main/apps/pravya/src/app/api/checkout/route.ts"
click node_payment_webhook "https://github.com/netizen-om/pravya-ai/blob/main/apps/pravya/src/app/api/webhook/dodopayment/route.ts"
click node_admin "https://github.com/netizen-om/pravya-ai/tree/main/apps/admin/app/admin"
click node_admin_api "https://github.com/netizen-om/pravya-ai/tree/main/apps/admin/app/api/admin"
click node_webhooks "https://github.com/netizen-om/pravya-ai/blob/main/apps/webhooks/src/index.ts"
click node_db "https://github.com/netizen-om/pravya-ai/tree/main/packages/db"

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_pravya,node_interview_ui,node_resume_ui toneBlue
class node_ws,node_speech,node_interview_ai,node_worker,node_interview_routes,node_interview_controller,node_feedback toneAmber
class node_resume_upload,node_resume_routes,node_resume_controller,node_resume_parse,node_embedding,node_vectors toneMint
class node_payment,node_payment_webhook,node_admin,node_admin_api,node_webhooks toneRose
class node_auth,node_db,node_qdrant,node_user,node_deepgram,node_dodopayments toneIndigo
```

## Components

### User application

- [Pravya app](https://github.com/netizen-om/pravya-ai/tree/main/apps/pravya): `apps/pravya`
- [Interview experience](https://github.com/netizen-om/pravya-ai/tree/main/apps/pravya/src/app/interview): `apps/pravya/src/app/interview`
- [Resume workspace](https://github.com/netizen-om/pravya-ai/tree/main/apps/pravya/src/app/resume): `apps/pravya/src/app/resume`

### Interview services

- [Live interview server](https://github.com/netizen-om/pravya-ai/blob/main/apps/ws-server/src/index.ts): `apps/ws-server/src/index.ts`
- [Speech transcription](https://github.com/netizen-om/pravya-ai/blob/main/apps/ws-server/src/lib/deepGramClient.ts): `apps/ws-server/src/lib/deepGramClient.ts`
- [Interview AI](https://github.com/netizen-om/pravya-ai/blob/main/apps/ws-server/src/lib/gemini.ts): `apps/ws-server/src/lib/gemini.ts`
- [Background worker](https://github.com/netizen-om/pravya-ai/blob/main/apps/worker/src/index.ts): `apps/worker/src/index.ts`
- [Interview job routes](https://github.com/netizen-om/pravya-ai/blob/main/apps/worker/src/routes/interview.routes.ts): `apps/worker/src/routes/interview.routes.ts`
- [Question generation](https://github.com/netizen-om/pravya-ai/blob/main/apps/worker/src/controller/interview.controller.ts): `apps/worker/src/controller/interview.controller.ts`
- [Feedback analysis](https://github.com/netizen-om/pravya-ai/blob/main/apps/worker/src/utils/analyseInterview.ts): `apps/worker/src/utils/analyseInterview.ts`

### Resume services

- [Resume upload API](https://github.com/netizen-om/pravya-ai/blob/main/apps/pravya/src/app/api/upload/resume-upload/route.ts): `apps/pravya/src/app/api/upload/resume-upload/route.ts`
- [Resume job routes](https://github.com/netizen-om/pravya-ai/blob/main/apps/worker/src/routes/resume.routes.ts): `apps/worker/src/routes/resume.routes.ts`
- [Resume processing and chat](https://github.com/netizen-om/pravya-ai/blob/main/apps/worker/src/controller/resume.controller.ts): `apps/worker/src/controller/resume.controller.ts`
- [PDF parsing](https://github.com/netizen-om/pravya-ai/blob/main/apps/worker/src/utils/parseResume.ts): `apps/worker/src/utils/parseResume.ts`
- [Text embeddings](https://github.com/netizen-om/pravya-ai/blob/main/apps/worker/src/lib/embedding.ts): `apps/worker/src/lib/embedding.ts`
- [Vector search](https://github.com/netizen-om/pravya-ai/blob/main/apps/worker/src/lib/qdrant.ts): `apps/worker/src/lib/qdrant.ts`

### Billing and administration

- [Checkout and subscription](https://github.com/netizen-om/pravya-ai/blob/main/apps/pravya/src/app/api/checkout/route.ts): `apps/pravya/src/app/api/checkout/route.ts`
- [Payment webhook](https://github.com/netizen-om/pravya-ai/blob/main/apps/pravya/src/app/api/webhook/dodopayment/route.ts): `apps/pravya/src/app/api/webhook/dodopayment/route.ts`
- [Admin console](https://github.com/netizen-om/pravya-ai/tree/main/apps/admin/app/admin): `apps/admin/app/admin`
- [Admin APIs](https://github.com/netizen-om/pravya-ai/tree/main/apps/admin/app/api/admin): `apps/admin/app/api/admin`
- [Email webhooks](https://github.com/netizen-om/pravya-ai/blob/main/apps/webhooks/src/index.ts): `apps/webhooks/src/index.ts`

### Shared platform

- [User authentication](https://github.com/netizen-om/pravya-ai/blob/main/packages/auth/index.ts): `packages/auth/index.ts`
- [PostgreSQL data](https://github.com/netizen-om/pravya-ai/tree/main/packages/db): `packages/db`
- **Qdrant**

### Other components

- **Candidate**
- **Deepgram**
- **DodoPayments**

## Connections

- Candidate → Pravya app: uses
- Pravya app → User authentication: authenticates with (evidence: `packages/auth/index.ts`)
- Pravya app → Interview experience: offers
- Interview experience → Live interview server: starts live session
- Live interview server → Speech transcription: transcribes audio (evidence: `apps/ws-server/src/index.ts`)
- Speech transcription → Deepgram: uses
- Live interview server → Interview AI: streams AI interaction (evidence: `apps/ws-server/src/index.ts`)
- Live interview server → PostgreSQL data: persists transcript
- Live interview server → Background worker: queues analysis
- Background worker → Interview job routes: mounts routes
- Interview job routes → Question generation: dispatches (evidence: `apps/worker/src/routes/interview.routes.ts`)
- Question generation → PostgreSQL data: reads and writes (evidence: `apps/worker/src/controller/interview.controller.ts`)
- Question generation → Feedback analysis: analyzes results
- Question generation → Interview AI: generates questions (evidence: `apps/worker/src/controller/interview.controller.ts`)
- Interview experience → Feedback analysis: shows feedback
- Candidate → Resume workspace: uploads resume
- Resume workspace → Resume upload API: sends PDF
- Resume upload API → Background worker: submits processing job
- Background worker → Resume job routes: mounts routes
- Resume job routes → Resume processing and chat: dispatches (evidence: `apps/worker/src/routes/resume.routes.ts`)
- Resume processing and chat → PDF parsing: parses resume
- Resume processing and chat → Text embeddings: creates embeddings (evidence: `apps/worker/src/controller/resume.controller.ts`)
- Resume processing and chat → Vector search: searches vectors (evidence: `apps/worker/src/controller/resume.controller.ts`)
- Text embeddings → Qdrant: stores vectors
- Resume processing and chat → PostgreSQL data: reads analysis (evidence: `apps/worker/src/controller/resume.controller.ts`)
- Resume workspace → Resume processing and chat: chats with resume
- Candidate → Checkout and subscription: subscribes
- Checkout and subscription → User authentication: checks session (evidence: `apps/pravya/src/app/api/checkout/route.ts`)
- Checkout and subscription → PostgreSQL data: reads user (evidence: `apps/pravya/src/app/api/checkout/route.ts`)
- Checkout and subscription → DodoPayments: creates checkout (evidence: `apps/pravya/src/app/api/checkout/route.ts`)
- DodoPayments → Payment webhook: sends events
- Payment webhook → PostgreSQL data: updates payments (evidence: `apps/pravya/src/app/api/webhook/dodopayment/route.ts`)
- Candidate → Admin console: administers platform
- Admin console → Admin APIs: manages records
- Admin APIs → PostgreSQL data: reads and writes (evidence: `apps/admin/app/api/admin/create/route.ts`)
- Email webhooks → PostgreSQL data: uses data (evidence: `apps/webhooks/src/index.ts`)
