# sudiptomaity2005/offerprep architecture

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

- Interactive diagram: https://gitdiagram.com/sudiptomaity2005/offerprep
- Repository: https://github.com/sudiptomaity2005/offerprep

## Overview

OfferPrep supports role-based interview practice: users create a session, answer questions by speech or text, receive AI evaluation, and review results and historical analytics. The graph follows the documented frontend-to-API workflow and the sampled route-to-AI/database calls. Audio transcription and dashboard capabilities are represented from README and frontend components; unsampled backend details and database implementation are not inferred.

Main entry points: [`frontend/src/lib/api-client.ts`](https://github.com/sudiptomaity2005/offerprep/blob/main/frontend/src/lib/api-client.ts) (Typed API Client), [`backend/src/routes/interviews.ts`](https://github.com/sudiptomaity2005/offerprep/blob/main/backend/src/routes/interviews.ts) (Interview Routes), [`frontend/src/app/interview/[sessionId]/page.tsx`](https://github.com/sudiptomaity2005/offerprep/blob/main/frontend/src/app/interview/%5BsessionId%5D/page.tsx) (Interview Session), [`backend/src/index.ts`](https://github.com/sudiptomaity2005/offerprep/blob/main/backend/src/index.ts) (Express API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Practice Experience"]
  node_landing["Landing and Sign-in<br/>[page.tsx]"]
  node_creation["Session Creation"]
  node_practice["Interview Session<br/>[page.tsx]"]
  node_speech["Speech Input"]
  node_visualizer["Audio Visualization"]
  node_review["Evaluation Review<br/>[page.tsx]"]
  node_dashboard["History and Analytics<br/>[page.tsx]"]
  node_history["Previous Interviews"]
  node_analytics["Score Trends"]
end

subgraph group_service["Interview API"]
  node_api["Typed API Client<br/>[api-client.ts]"]
  node_api_config["API URL Config<br/>[config.ts]"]
  node_server["Express API<br/>[index.ts]"]
  node_interviews["Interview Routes<br/>[interviews.ts]"]
  node_validation["Request Validation<br/>[validate.ts]"]
  node_limiting["Rate Limits<br/>[rateLimiter.ts]"]
end

subgraph group_intelligence["AI Assessment"]
  node_ai["Question and Evaluation AI<br/>[ai.ts]"]
end

subgraph group_identity["Identity and Data"]
  node_db[("Prisma Data Store<br/>[index.js]")]
  node_webhook["Clerk User Sync<br/>[webhooks.ts]"]
end

node_candidate(("Candidate"))
node_clerk["Clerk Identity"]
node_gemini["Gemini AI"]

node_candidate -->|"opens"| node_landing
node_candidate -.->|"configures"| node_creation
node_candidate -.->|"answers"| node_practice
node_landing -->|"signs in"| node_clerk
node_creation -.->|"creates session"| node_api
node_practice -.->|"accepts speech"| node_speech
node_practice -->|"renders"| node_visualizer
node_practice -.->|"submits answers"| node_api
node_review -.->|"fetches evaluation"| node_api
node_dashboard -.->|"shows sessions"| node_history
node_dashboard -.->|"shows trends"| node_analytics
node_history -.->|"fetches sessions"| node_api
node_analytics -.->|"fetches metrics"| node_api
node_api -->|"builds URLs"| node_api_config
node_api -.->|"sends HTTP requests"| node_server
node_server -->|"mounts routes"| node_interviews
node_server -->|"mounts webhooks"| node_webhook
node_server -->|"limits API traffic"| node_limiting
node_interviews -->|"validates requests"| node_validation
node_interviews -->|"limits AI routes"| node_limiting
node_interviews -->|"generates and evaluates"| node_ai
node_ai -->|"generates content"| node_gemini
node_interviews -->|"reads and writes"| node_db
node_webhook -->|"syncs users"| node_db
node_clerk -.->|"sends events"| node_webhook

click node_landing "https://github.com/sudiptomaity2005/offerprep/blob/main/frontend/src/app/page.tsx"
click node_creation "https://github.com/sudiptomaity2005/offerprep/blob/main/frontend/src/components/CreateInterviewForm.tsx"
click node_practice "https://github.com/sudiptomaity2005/offerprep/blob/main/frontend/src/app/interview/%5BsessionId%5D/page.tsx"
click node_speech "https://github.com/sudiptomaity2005/offerprep/blob/main/frontend/src/components/TechnicalAnswerInput.tsx"
click node_visualizer "https://github.com/sudiptomaity2005/offerprep/blob/main/frontend/src/components/AudioVisualizer.tsx"
click node_review "https://github.com/sudiptomaity2005/offerprep/blob/main/frontend/src/app/evaluation/%5BsessionId%5D/page.tsx"
click node_dashboard "https://github.com/sudiptomaity2005/offerprep/blob/main/frontend/src/app/dashboard/page.tsx"
click node_history "https://github.com/sudiptomaity2005/offerprep/blob/main/frontend/src/components/PreviousInterviews.tsx"
click node_analytics "https://github.com/sudiptomaity2005/offerprep/blob/main/frontend/src/components/AnalyticsOverview.tsx"
click node_api "https://github.com/sudiptomaity2005/offerprep/blob/main/frontend/src/lib/api-client.ts"
click node_api_config "https://github.com/sudiptomaity2005/offerprep/blob/main/frontend/src/lib/config.ts"
click node_server "https://github.com/sudiptomaity2005/offerprep/blob/main/backend/src/index.ts"
click node_interviews "https://github.com/sudiptomaity2005/offerprep/blob/main/backend/src/routes/interviews.ts"
click node_validation "https://github.com/sudiptomaity2005/offerprep/blob/main/backend/src/middleware/validate.ts"
click node_limiting "https://github.com/sudiptomaity2005/offerprep/blob/main/backend/src/middleware/rateLimiter.ts"
click node_ai "https://github.com/sudiptomaity2005/offerprep/blob/main/backend/src/services/ai.ts"
click node_db "https://github.com/sudiptomaity2005/offerprep/blob/main/database/index.js"
click node_webhook "https://github.com/sudiptomaity2005/offerprep/blob/main/backend/src/routes/webhooks.ts"

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_landing,node_creation,node_practice,node_speech,node_visualizer,node_review,node_dashboard,node_history,node_analytics toneBlue
class node_api,node_api_config,node_server,node_interviews,node_validation,node_limiting toneAmber
class node_ai toneMint
class node_db,node_webhook toneRose
class node_candidate,node_clerk,node_gemini toneIndigo
```

## Components

### Practice Experience

- [Landing and Sign-in](https://github.com/sudiptomaity2005/offerprep/blob/main/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`
- [Session Creation](https://github.com/sudiptomaity2005/offerprep/blob/main/frontend/src/components/CreateInterviewForm.tsx): `frontend/src/components/CreateInterviewForm.tsx`
- [Interview Session](https://github.com/sudiptomaity2005/offerprep/blob/main/frontend/src/app/interview/%5BsessionId%5D/page.tsx): `frontend/src/app/interview/[sessionId]/page.tsx`
- [Speech Input](https://github.com/sudiptomaity2005/offerprep/blob/main/frontend/src/components/TechnicalAnswerInput.tsx): `frontend/src/components/TechnicalAnswerInput.tsx`
- [Audio Visualization](https://github.com/sudiptomaity2005/offerprep/blob/main/frontend/src/components/AudioVisualizer.tsx): `frontend/src/components/AudioVisualizer.tsx`
- [Evaluation Review](https://github.com/sudiptomaity2005/offerprep/blob/main/frontend/src/app/evaluation/%5BsessionId%5D/page.tsx): `frontend/src/app/evaluation/[sessionId]/page.tsx`
- [History and Analytics](https://github.com/sudiptomaity2005/offerprep/blob/main/frontend/src/app/dashboard/page.tsx): `frontend/src/app/dashboard/page.tsx`
- [Previous Interviews](https://github.com/sudiptomaity2005/offerprep/blob/main/frontend/src/components/PreviousInterviews.tsx): `frontend/src/components/PreviousInterviews.tsx`
- [Score Trends](https://github.com/sudiptomaity2005/offerprep/blob/main/frontend/src/components/AnalyticsOverview.tsx): `frontend/src/components/AnalyticsOverview.tsx`

### Interview API

- [Typed API Client](https://github.com/sudiptomaity2005/offerprep/blob/main/frontend/src/lib/api-client.ts): `frontend/src/lib/api-client.ts`
- [API URL Config](https://github.com/sudiptomaity2005/offerprep/blob/main/frontend/src/lib/config.ts): `frontend/src/lib/config.ts`
- [Express API](https://github.com/sudiptomaity2005/offerprep/blob/main/backend/src/index.ts): `backend/src/index.ts`
- [Interview Routes](https://github.com/sudiptomaity2005/offerprep/blob/main/backend/src/routes/interviews.ts): `backend/src/routes/interviews.ts`
- [Request Validation](https://github.com/sudiptomaity2005/offerprep/blob/main/backend/src/middleware/validate.ts): `backend/src/middleware/validate.ts`
- [Rate Limits](https://github.com/sudiptomaity2005/offerprep/blob/main/backend/src/middleware/rateLimiter.ts): `backend/src/middleware/rateLimiter.ts`

### AI Assessment

- [Question and Evaluation AI](https://github.com/sudiptomaity2005/offerprep/blob/main/backend/src/services/ai.ts): `backend/src/services/ai.ts`

### Identity and Data

- [Prisma Data Store](https://github.com/sudiptomaity2005/offerprep/blob/main/database/index.js): `database/index.js`
- [Clerk User Sync](https://github.com/sudiptomaity2005/offerprep/blob/main/backend/src/routes/webhooks.ts): `backend/src/routes/webhooks.ts`

### Other components

- **Candidate**
- **Clerk Identity**
- **Gemini AI**

## Connections

- Candidate → Landing and Sign-in: opens (evidence: `frontend/src/app/page.tsx`)
- Candidate → Session Creation: configures
- Candidate → Interview Session: answers
- Landing and Sign-in → Clerk Identity: signs in (evidence: `frontend/src/app/page.tsx`)
- Session Creation → Typed API Client: creates session
- Interview Session → Speech Input: accepts speech
- Interview Session → Audio Visualization: renders (evidence: `frontend/src/app/interview/[sessionId]/page.tsx`)
- Interview Session → Typed API Client: submits answers
- Evaluation Review → Typed API Client: fetches evaluation
- History and Analytics → Previous Interviews: shows sessions
- History and Analytics → Score Trends: shows trends
- Previous Interviews → Typed API Client: fetches sessions
- Score Trends → Typed API Client: fetches metrics
- Typed API Client → API URL Config: builds URLs (evidence: `frontend/src/lib/api-client.ts`)
- Typed API Client → Express API: sends HTTP requests
- Express API → Interview Routes: mounts routes (evidence: `backend/src/index.ts`)
- Express API → Clerk User Sync: mounts webhooks (evidence: `backend/src/index.ts`)
- Express API → Rate Limits: limits API traffic (evidence: `backend/src/index.ts`)
- Interview Routes → Request Validation: validates requests (evidence: `backend/src/routes/interviews.ts`)
- Interview Routes → Rate Limits: limits AI routes (evidence: `backend/src/routes/interviews.ts`)
- Interview Routes → Question and Evaluation AI: generates and evaluates (evidence: `backend/src/routes/interviews.ts`)
- Question and Evaluation AI → Gemini AI: generates content (evidence: `backend/src/services/ai.ts`)
- Interview Routes → Prisma Data Store: reads and writes (evidence: `backend/src/routes/interviews.ts`)
- Clerk User Sync → Prisma Data Store: syncs users (evidence: `backend/src/routes/webhooks.ts`)
- Clerk Identity → Clerk User Sync: sends events
