# tejavenkat29/ai-interview-platform architecture

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

- Interactive diagram: https://gitdiagram.com/tejavenkat29/ai-interview-platform
- Repository: https://github.com/tejavenkat29/ai-interview-platform

## Overview

AI Interview Platform is a Django/DRF and Next.js SaaS scaffold. Its working user journey is registration or login through the Next.js auth proxy, backend JWT issuance, cookie-held refresh tokens, then protected dashboard/profile access. Backend auth also supports verification and password-reset email dispatch. Interviews, resumes, AI, payments, and results appear as planned Phase 2–4 capabilities, but their runtime implementations were not sampled; their nodes represent only the app directories. Edges are limited to README statements and visible imports/calls, so unsampled feature relationships are omitted.

Main entry points: [`backend/apps/users/services/auth_service.py`](https://github.com/tejavenkat29/ai-interview-platform/blob/main/backend/apps/users/services/auth_service.py) (Auth business logic), [`backend/apps/users/urls/users.py`](https://github.com/tejavenkat29/ai-interview-platform/blob/main/backend/apps/users/urls/users.py) (User routes), [`frontend/app/api/auth/refresh/route.ts`](https://github.com/tejavenkat29/ai-interview-platform/blob/main/frontend/app/api/auth/refresh/route.ts) (Auth proxy routes), [`backend/apps/users/services/email_service.py`](https://github.com/tejavenkat29/ai-interview-platform/blob/main/backend/apps/users/services/email_service.py) (Email service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_auth_pages["Login and register<br/>[page.tsx]"]
  node_auth_forms["Auth forms<br/>[register-form.tsx]"]
  node_auth_api["Auth API client<br/>[auth.ts]"]
  node_proxy["Auth proxy routes<br/>[route.ts]"]
  node_cookie["Refresh cookies<br/>[cookies.ts]"]
  node_auth_hook["Auth state hooks<br/>[use-auth.ts]"]
  node_auth_store["Auth store<br/>[auth-store.ts]"]
  node_dashboard["Dashboard pages<br/>[page.tsx]"]
  node_profile["Profile UI<br/>[profile-form.tsx]"]
  node_api_client["Backend API client<br/>[api-client.ts]"]
  node_user_types["User contracts<br/>[user.ts]"]
end

subgraph group_auth["Identity and accounts"]
  node_user_routes["User routes<br/>[users.py]"]
  node_auth_service["Auth business logic<br/>[auth_service.py]"]
  node_serializers["User serializers<br/>[serializers.py]"]
  node_user_model[("User model<br/>[models.py]")]
  node_tokens["Verification tokens<br/>[tokens.py]"]
end

subgraph group_async["Email delivery"]
  node_email_service["Email service<br/>[email_service.py]"]
  node_email_task["Email task<br/>[tasks.py]"]
  node_celery["Celery worker setup<br/>[celery.py]"]
end

subgraph group_domain["Interview product areas"]
  node_resume["Resume support"]
  node_interviews["Interview practice"]
  node_ai["AI engine"]
  node_payments["Payments"]
end

subgraph group_runtime["Platform runtime"]
  node_settings["Django settings<br/>[base.py]"]
  node_api_routes["API routing<br/>[urls.py]"]
end

node_visitor(("Candidate"))
node_database[("PostgreSQL")]
node_redis["Redis broker/cache"]

node_visitor -->|"opens"| node_auth_pages
node_auth_pages -->|"renders"| node_auth_forms
node_auth_forms -.->|"submits credentials"| node_auth_api
node_auth_api -.->|"calls auth routes"| node_proxy
node_proxy -->|"sets refresh cookie"| node_cookie
node_proxy -->|"forwards auth request"| node_auth_service
node_auth_service -->|"serializes user"| node_serializers
node_serializers -->|"validates and serializes"| node_user_model
node_auth_service -->|"creates and updates"| node_user_model
node_auth_service -->|"builds reset tokens"| node_tokens
node_auth_service -->|"requests email"| node_email_service
node_email_service -->|"encodes user token"| node_tokens
node_email_service -->|"dispatches email"| node_email_task
node_email_task -->|"runs as task"| node_celery
node_celery -->|"uses broker"| node_redis
node_auth_hook -.->|"uses state"| node_auth_store
node_dashboard -.->|"loads protected data"| node_api_client
node_profile -.->|"updates profile"| node_user_routes
node_api_client -.->|"calls API"| node_user_routes
node_user_routes -.->|"uses account logic"| node_auth_service
node_user_routes -.->|"reads profile"| node_user_model
node_settings -->|"configures database"| node_database
node_settings -->|"configures cache"| node_redis
node_api_routes -.->|"routes users"| node_user_routes

click node_auth_pages "https://github.com/tejavenkat29/ai-interview-platform/blob/main/frontend/app/(auth)/login/page.tsx"
click node_auth_forms "https://github.com/tejavenkat29/ai-interview-platform/blob/main/frontend/components/auth/register-form.tsx"
click node_auth_api "https://github.com/tejavenkat29/ai-interview-platform/blob/main/frontend/services/auth.ts"
click node_proxy "https://github.com/tejavenkat29/ai-interview-platform/blob/main/frontend/app/api/auth/refresh/route.ts"
click node_cookie "https://github.com/tejavenkat29/ai-interview-platform/blob/main/frontend/lib/server/cookies.ts"
click node_auth_hook "https://github.com/tejavenkat29/ai-interview-platform/blob/main/frontend/hooks/use-auth.ts"
click node_auth_store "https://github.com/tejavenkat29/ai-interview-platform/blob/main/frontend/store/auth-store.ts"
click node_dashboard "https://github.com/tejavenkat29/ai-interview-platform/blob/main/frontend/app/(dashboard)/dashboard/page.tsx"
click node_profile "https://github.com/tejavenkat29/ai-interview-platform/blob/main/frontend/components/profile/profile-form.tsx"
click node_api_client "https://github.com/tejavenkat29/ai-interview-platform/blob/main/frontend/services/api-client.ts"
click node_user_types "https://github.com/tejavenkat29/ai-interview-platform/blob/main/frontend/types/user.ts"
click node_user_routes "https://github.com/tejavenkat29/ai-interview-platform/blob/main/backend/apps/users/urls/users.py"
click node_auth_service "https://github.com/tejavenkat29/ai-interview-platform/blob/main/backend/apps/users/services/auth_service.py"
click node_serializers "https://github.com/tejavenkat29/ai-interview-platform/blob/main/backend/apps/users/serializers.py"
click node_user_model "https://github.com/tejavenkat29/ai-interview-platform/blob/main/backend/apps/users/models.py"
click node_tokens "https://github.com/tejavenkat29/ai-interview-platform/blob/main/backend/apps/users/tokens.py"
click node_email_service "https://github.com/tejavenkat29/ai-interview-platform/blob/main/backend/apps/users/services/email_service.py"
click node_email_task "https://github.com/tejavenkat29/ai-interview-platform/blob/main/backend/apps/users/tasks.py"
click node_celery "https://github.com/tejavenkat29/ai-interview-platform/blob/main/backend/config/celery.py"
click node_resume "https://github.com/tejavenkat29/ai-interview-platform/tree/main/backend/apps/resumes"
click node_interviews "https://github.com/tejavenkat29/ai-interview-platform/tree/main/backend/apps/interviews"
click node_ai "https://github.com/tejavenkat29/ai-interview-platform/tree/main/backend/apps/ai_engine"
click node_payments "https://github.com/tejavenkat29/ai-interview-platform/tree/main/backend/apps/payments"
click node_settings "https://github.com/tejavenkat29/ai-interview-platform/blob/main/backend/config/settings/base.py"
click node_api_routes "https://github.com/tejavenkat29/ai-interview-platform/blob/main/backend/config/urls.py"

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_auth_pages,node_auth_forms,node_auth_api,node_proxy,node_cookie,node_auth_hook,node_auth_store,node_dashboard,node_profile,node_api_client,node_user_types toneBlue
class node_user_routes,node_auth_service,node_serializers,node_user_model,node_tokens,node_database,node_redis toneAmber
class node_email_service,node_email_task,node_celery toneMint
class node_resume,node_interviews,node_ai,node_payments toneRose
class node_settings,node_api_routes,node_visitor toneIndigo
```

## Components

### Web experience

- [Login and register](https://github.com/tejavenkat29/ai-interview-platform/blob/main/frontend/app/(auth)/login/page.tsx): `frontend/app/(auth)/login/page.tsx`
- [Auth forms](https://github.com/tejavenkat29/ai-interview-platform/blob/main/frontend/components/auth/register-form.tsx): `frontend/components/auth/register-form.tsx`
- [Auth API client](https://github.com/tejavenkat29/ai-interview-platform/blob/main/frontend/services/auth.ts): `frontend/services/auth.ts`
- [Auth proxy routes](https://github.com/tejavenkat29/ai-interview-platform/blob/main/frontend/app/api/auth/refresh/route.ts): `frontend/app/api/auth/refresh/route.ts`
- [Refresh cookies](https://github.com/tejavenkat29/ai-interview-platform/blob/main/frontend/lib/server/cookies.ts): `frontend/lib/server/cookies.ts`
- [Auth state hooks](https://github.com/tejavenkat29/ai-interview-platform/blob/main/frontend/hooks/use-auth.ts): `frontend/hooks/use-auth.ts`
- [Auth store](https://github.com/tejavenkat29/ai-interview-platform/blob/main/frontend/store/auth-store.ts): `frontend/store/auth-store.ts`
- [Dashboard pages](https://github.com/tejavenkat29/ai-interview-platform/blob/main/frontend/app/(dashboard)/dashboard/page.tsx): `frontend/app/(dashboard)/dashboard/page.tsx`
- [Profile UI](https://github.com/tejavenkat29/ai-interview-platform/blob/main/frontend/components/profile/profile-form.tsx): `frontend/components/profile/profile-form.tsx`
- [Backend API client](https://github.com/tejavenkat29/ai-interview-platform/blob/main/frontend/services/api-client.ts): `frontend/services/api-client.ts`
- [User contracts](https://github.com/tejavenkat29/ai-interview-platform/blob/main/frontend/types/user.ts): `frontend/types/user.ts`

### Identity and accounts

- [User routes](https://github.com/tejavenkat29/ai-interview-platform/blob/main/backend/apps/users/urls/users.py): `backend/apps/users/urls/users.py`
- [Auth business logic](https://github.com/tejavenkat29/ai-interview-platform/blob/main/backend/apps/users/services/auth_service.py): `backend/apps/users/services/auth_service.py`
- [User serializers](https://github.com/tejavenkat29/ai-interview-platform/blob/main/backend/apps/users/serializers.py): `backend/apps/users/serializers.py`
- [User model](https://github.com/tejavenkat29/ai-interview-platform/blob/main/backend/apps/users/models.py): `backend/apps/users/models.py`
- [Verification tokens](https://github.com/tejavenkat29/ai-interview-platform/blob/main/backend/apps/users/tokens.py): `backend/apps/users/tokens.py`

### Email delivery

- [Email service](https://github.com/tejavenkat29/ai-interview-platform/blob/main/backend/apps/users/services/email_service.py): `backend/apps/users/services/email_service.py`
- [Email task](https://github.com/tejavenkat29/ai-interview-platform/blob/main/backend/apps/users/tasks.py): `backend/apps/users/tasks.py`
- [Celery worker setup](https://github.com/tejavenkat29/ai-interview-platform/blob/main/backend/config/celery.py): `backend/config/celery.py`

### Interview product areas

- [Resume support](https://github.com/tejavenkat29/ai-interview-platform/tree/main/backend/apps/resumes): `backend/apps/resumes`
- [Interview practice](https://github.com/tejavenkat29/ai-interview-platform/tree/main/backend/apps/interviews): `backend/apps/interviews`
- [AI engine](https://github.com/tejavenkat29/ai-interview-platform/tree/main/backend/apps/ai_engine): `backend/apps/ai_engine`
- [Payments](https://github.com/tejavenkat29/ai-interview-platform/tree/main/backend/apps/payments): `backend/apps/payments`

### Platform runtime

- [Django settings](https://github.com/tejavenkat29/ai-interview-platform/blob/main/backend/config/settings/base.py): `backend/config/settings/base.py`
- [API routing](https://github.com/tejavenkat29/ai-interview-platform/blob/main/backend/config/urls.py): `backend/config/urls.py`

### Other components

- **Candidate**
- **PostgreSQL**
- **Redis broker/cache**

## Connections

- Candidate → Login and register: opens (evidence: `README.md`)
- Login and register → Auth forms: renders (evidence: `README.md`)
- Auth forms → Auth API client: submits credentials
- Auth API client → Auth proxy routes: calls auth routes
- Auth proxy routes → Refresh cookies: sets refresh cookie (evidence: `frontend/app/api/auth/refresh/route.ts`)
- Auth proxy routes → Auth business logic: forwards auth request (evidence: `frontend/app/api/auth/refresh/route.ts`)
- Auth business logic → User serializers: serializes user (evidence: `backend/apps/users/services/auth_service.py`)
- User serializers → User model: validates and serializes (evidence: `backend/apps/users/serializers.py`)
- Auth business logic → User model: creates and updates (evidence: `backend/apps/users/services/auth_service.py`)
- Auth business logic → Verification tokens: builds reset tokens (evidence: `backend/apps/users/services/auth_service.py`)
- Auth business logic → Email service: requests email (evidence: `backend/apps/users/services/auth_service.py`)
- Email service → Verification tokens: encodes user token (evidence: `backend/apps/users/services/email_service.py`)
- Email service → Email task: dispatches email (evidence: `backend/apps/users/services/email_service.py`)
- Email task → Celery worker setup: runs as task (evidence: `backend/apps/users/tasks.py`)
- Celery worker setup → Redis broker/cache: uses broker
- Auth state hooks → Auth store: uses state
- Dashboard pages → Backend API client: loads protected data
- Profile UI → User routes: updates profile
- Backend API client → User routes: calls API
- User routes → Auth business logic: uses account logic
- User routes → User model: reads profile
- Django settings → PostgreSQL: configures database (evidence: `backend/config/settings/base.py`)
- Django settings → Redis broker/cache: configures cache (evidence: `backend/config/settings/base.py`)
- API routing → User routes: routes users
