# jaysharma424/ai-job-board architecture

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

- Interactive diagram: https://gitdiagram.com/jaysharma424/ai-job-board
- Repository: https://github.com/jaysharma424/ai-job-board

## Overview

#### Purpose and Entry Points
Job Dekho is a full-stack AI recruitment platform for candidate job discovery/resume assistance and employer job publishing. The Next.js App Router UI starts at `app/page.tsx` with global layout in `app/layout.tsx`. The FastAPI API entry point is `backend/main.py`, which registers domain routers and exposes OpenAPI docs.

#### Frontend Workspaces
The frontend is a client-side dashboard application rather than a server-rendered content site. Candidate flows—job feed, filters, resume upload, applications, and interview tools—center on `app/CandidateDashboard.tsx`; recruiter publishing and pipeline views center on `app/EmployerDashboard.tsx`. Session-oriented AI coaching is surfaced by `app/AICareerCoach.tsx`. These components call the FastAPI backend via the configured public API base URL.

#### API and Domain Boundary
FastAPI separates responsibilities into routers, with schemas in `backend/models.py` and MongoDB wiring in `backend/database.py`.
- Authentication, OTP, and account recovery: `backend/routers/auth.py`
- Candidate profile, saved jobs, and applications: `backend/routers/user.py`
- Structured job discovery/filtering: `backend/routers/jobs.py`
- Employer onboarding, publishing, and ETL trigger: `backend/routers/employer.py`
- Resume and AI product APIs: `backend/routers/resume.py`, `backend/routers/premium.py`, `backend/routers/chat.py`

#### Job Ingestion and Asynchronous Enrichment
Employer publishing is deliberately decoupled from LLM processing. `backend/routers/employer.py` saves a raw job immediately with fallback/regex-derived fields and an unprocessed marker. A scheduler invokes the secured ETL endpoint; it batches unprocessed jobs, asks Gemini for schema-shaped enrichment (skills, category, experience, Markdown description), then updates the MongoDB document. This boundary keeps publish latency independent of external model latency and failures. `backend/normalize_jobs.py` supports normalization workflows.

#### Persistence and Search
MongoDB Atlas is the system of record for users, employers, raw and normalized jobs, applications, and saved items, accessed through `backend/database.py`. Structured, compound job search reads MongoDB via `backend/routers/jobs.py`; it does not depend on vector search. Qdrant Cloud is reserved for semantic resume-to-job retrieval. `backend/vector_db.py` loads local FastEmbed / MiniLM embeddings, initializes the vector collection, and supports idempotent vector upserts tied to job records.

#### Resume, Premium, and Chat Intelligence
Resume processing accepts PDFs, extracts text, embeds the candidate context, retrieves relevant Qdrant jobs, hydrates full documents from MongoDB, and uses Gemini to produce match scores, fit rationale, and skill gaps; the primary API implementation is `backend/routers/resume.py`. Gemini also powers ATS scoring, cover letters, and checkout-adjacent premium behavior in `backend/routers/premium.py`. Career conversations flow through `backend/routers/chat.py`; the UI supplies a user-provided Gemini key for that session rather than persisting it server-side.

#### External Services and Runtime
The frontend runs on Next.js 14/TypeScript; the backend is async Python/FastAPI served by Uvicorn. Production deploys as separate Render services, with container definitions in `Dockerfile` and `backend/Dockerfile`. External dependencies are MongoDB Atlas, Qdrant Cloud, Google Gemini, and Brevo’s HTTPS API for OTP email. The batch ETL scheduler is external and authenticates with a cron secret.

#### AI Quality Evaluation
AI behavior has an offline evaluation path separate from production traffic. Golden inputs in `backend/etl_golden.csv`, `backend/resume_golden.csv`, `backend/chatbot_ragas_golden.csv`, and `backend/premium_golden.csv` are run by `backend/generate_predictions.py`; `backend/evaluate_system.py` combines deterministic metrics with NVIDIA-hosted judge scoring. Outputs are persisted under `backend/evaluation_results/`, providing a regression signal for extraction, matching, chat grounding, and premium endpoint behavior.

Main entry points: [`backend/main.py`](https://github.com/jaysharma424/ai-job-board/blob/main/backend/main.py) (FastAPI application), [`backend/database.py`](https://github.com/jaysharma424/ai-job-board/blob/main/backend/database.py) (MongoDB Atlas), [`backend/routers/resume.py`](https://github.com/jaysharma424/ai-job-board/blob/main/backend/routers/resume.py) (Resume intelligence API), [`backend/routers/employer.py`](https://github.com/jaysharma424/ai-job-board/blob/main/backend/routers/employer.py) (Employer publishing API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Next.js frontend"]
  node_next_entry["App entry and layout<br/>Next.js App Router<br/>[page.tsx]"]
  node_candidate_ui["Candidate dashboard<br/>client dashboard"]
  node_employer_ui["Employer dashboard<br/>client dashboard"]
  node_coach_ui["AI career coach<br/>client AI UI<br/>[AICareerCoach.tsx]"]
end

subgraph group_api["FastAPI backend"]
  node_api_entry["FastAPI application<br/>API entry point<br/>[main.py]"]
  node_auth_api["Auth and OTP API<br/>router<br/>[auth.py]"]
  node_candidate_api["Candidate API<br/>router<br/>[user.py]"]
  node_jobs_api["Structured jobs API<br/>router<br/>[jobs.py]"]
  node_employer_api["Employer publishing API<br/>router<br/>[employer.py]"]
  node_resume_api["Resume intelligence API<br/>router<br/>[resume.py]"]
  node_premium_api["Premium AI API<br/>router<br/>[premium.py]"]
  node_chat_api["Career chat API<br/>router<br/>[chat.py]"]
end

subgraph group_data_ai["Data and AI services"]
  node_mongodb[("MongoDB Atlas<br/>system of record<br/>[database.py]")]
  node_vector_store[("Qdrant Cloud<br/>vector database<br/>[vector_db.py]")]
  node_gemini{{"Google Gemini<br/>LLM service"}}
  node_brevo{{"Brevo HTTPS API<br/>email service"}}
end

subgraph group_ops["Async operations and evaluation"]
  node_etl_scheduler(("External ETL scheduler<br/>scheduled caller"))
  node_enrichment["Job enrichment pipeline<br/>batch ETL<br/>[normalize_jobs.py]"]
  node_evaluation["Offline AI evaluation<br/>evaluation pipeline<br/>[evaluate_system.py]"]
  node_evaluation_results["Evaluation results<br/>regression artifacts"]
end

node_next_entry -->|"renders"| node_candidate_ui
node_next_entry -->|"renders"| node_employer_ui
node_next_entry -->|"renders"| node_coach_ui
node_candidate_ui -->|"API calls"| node_api_entry
node_employer_ui -->|"API calls"| node_api_entry
node_coach_ui -->|"session chat calls"| node_api_entry
node_api_entry -->|"routes"| node_auth_api
node_api_entry -->|"routes"| node_candidate_api
node_api_entry -->|"routes"| node_jobs_api
node_api_entry -->|"routes"| node_employer_api
node_api_entry -->|"routes"| node_resume_api
node_api_entry -->|"routes"| node_premium_api
node_api_entry -->|"routes"| node_chat_api
node_auth_api -->|"accounts"| node_mongodb
node_auth_api -->|"OTP email"| node_brevo
node_candidate_api -->|"profiles and applications"| node_mongodb
node_jobs_api -->|"structured search"| node_mongodb
node_employer_api -->|"raw job publish"| node_mongodb
node_etl_scheduler -->|"secured ETL trigger"| node_employer_api
node_employer_api -->|"starts batch"| node_enrichment
node_enrichment -->|"reads raw and updates normalized jobs"| node_mongodb
node_enrichment -->|"schema enrichment"| node_gemini
node_resume_api -->|"semantic retrieval"| node_vector_store
node_resume_api -->|"hydrates job documents"| node_mongodb
node_resume_api -->|"fit analysis"| node_gemini
node_premium_api -->|"generates AI outputs"| node_gemini
node_chat_api -->|"uses session key"| node_gemini
node_evaluation -.->|"judge scoring"| node_gemini
node_evaluation -->|"writes metrics"| node_evaluation_results

click node_next_entry "https://github.com/jaysharma424/ai-job-board/blob/main/app/page.tsx"
click node_candidate_ui "https://github.com/jaysharma424/ai-job-board/blob/main/app/CandidateDashboard.tsx"
click node_employer_ui "https://github.com/jaysharma424/ai-job-board/blob/main/app/EmployerDashboard.tsx"
click node_coach_ui "https://github.com/jaysharma424/ai-job-board/blob/main/app/AICareerCoach.tsx"
click node_api_entry "https://github.com/jaysharma424/ai-job-board/blob/main/backend/main.py"
click node_auth_api "https://github.com/jaysharma424/ai-job-board/blob/main/backend/routers/auth.py"
click node_candidate_api "https://github.com/jaysharma424/ai-job-board/blob/main/backend/routers/user.py"
click node_jobs_api "https://github.com/jaysharma424/ai-job-board/blob/main/backend/routers/jobs.py"
click node_employer_api "https://github.com/jaysharma424/ai-job-board/blob/main/backend/routers/employer.py"
click node_resume_api "https://github.com/jaysharma424/ai-job-board/blob/main/backend/routers/resume.py"
click node_premium_api "https://github.com/jaysharma424/ai-job-board/blob/main/backend/routers/premium.py"
click node_chat_api "https://github.com/jaysharma424/ai-job-board/blob/main/backend/routers/chat.py"
click node_mongodb "https://github.com/jaysharma424/ai-job-board/blob/main/backend/database.py"
click node_vector_store "https://github.com/jaysharma424/ai-job-board/blob/main/backend/vector_db.py"
click node_enrichment "https://github.com/jaysharma424/ai-job-board/blob/main/backend/normalize_jobs.py"
click node_evaluation "https://github.com/jaysharma424/ai-job-board/blob/main/backend/evaluate_system.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_next_entry,node_candidate_ui,node_employer_ui,node_coach_ui toneBlue
class node_api_entry,node_auth_api,node_candidate_api,node_jobs_api,node_employer_api,node_resume_api,node_premium_api,node_chat_api toneAmber
class node_mongodb,node_vector_store,node_gemini,node_brevo toneMint
class node_etl_scheduler,node_enrichment,node_evaluation,node_evaluation_results toneRose
```

## Components

### Next.js frontend

- [App entry and layout](https://github.com/jaysharma424/ai-job-board/blob/main/app/page.tsx): Next.js App Router · `app/page.tsx`
- [Candidate dashboard](https://github.com/jaysharma424/ai-job-board/blob/main/app/CandidateDashboard.tsx): client dashboard · Job discovery, applications, resume, and interview flows. · `app/CandidateDashboard.tsx`
- [Employer dashboard](https://github.com/jaysharma424/ai-job-board/blob/main/app/EmployerDashboard.tsx): client dashboard · Employer publishing and pipeline views. · `app/EmployerDashboard.tsx`
- [AI career coach](https://github.com/jaysharma424/ai-job-board/blob/main/app/AICareerCoach.tsx): client AI UI · Supplies a session-only user Gemini key. · `app/AICareerCoach.tsx`

### FastAPI backend

- [FastAPI application](https://github.com/jaysharma424/ai-job-board/blob/main/backend/main.py): API entry point · Registers domain routers and OpenAPI docs. · `backend/main.py`
- [Auth and OTP API](https://github.com/jaysharma424/ai-job-board/blob/main/backend/routers/auth.py): router · `backend/routers/auth.py`
- [Candidate API](https://github.com/jaysharma424/ai-job-board/blob/main/backend/routers/user.py): router · Profiles, saved jobs, and applications. · `backend/routers/user.py`
- [Structured jobs API](https://github.com/jaysharma424/ai-job-board/blob/main/backend/routers/jobs.py): router · MongoDB-backed compound filtering and discovery. · `backend/routers/jobs.py`
- [Employer publishing API](https://github.com/jaysharma424/ai-job-board/blob/main/backend/routers/employer.py): router · Writes raw jobs and exposes the secured ETL trigger. · `backend/routers/employer.py`
- [Resume intelligence API](https://github.com/jaysharma424/ai-job-board/blob/main/backend/routers/resume.py): router · PDF matching, retrieval, and fit analysis. · `backend/routers/resume.py`
- [Premium AI API](https://github.com/jaysharma424/ai-job-board/blob/main/backend/routers/premium.py): router · ATS scoring, cover letters, and premium behavior. · `backend/routers/premium.py`
- [Career chat API](https://github.com/jaysharma424/ai-job-board/blob/main/backend/routers/chat.py): router · `backend/routers/chat.py`

### Data and AI services

- [MongoDB Atlas](https://github.com/jaysharma424/ai-job-board/blob/main/backend/database.py): system of record · Stores accounts, jobs, applications, and saved items. · `backend/database.py`
- [Qdrant Cloud](https://github.com/jaysharma424/ai-job-board/blob/main/backend/vector_db.py): vector database · Semantic resume-to-job retrieval index. · `backend/vector_db.py`
- **Google Gemini**: LLM service
- **Brevo HTTPS API**: email service · Delivers OTP email.

### Async operations and evaluation

- **External ETL scheduler**: scheduled caller · Authenticates ETL requests with a cron secret.
- [Job enrichment pipeline](https://github.com/jaysharma424/ai-job-board/blob/main/backend/normalize_jobs.py): batch ETL · Batches unprocessed jobs and writes Gemini-derived normalized fields. · `backend/normalize_jobs.py`
- [Offline AI evaluation](https://github.com/jaysharma424/ai-job-board/blob/main/backend/evaluate_system.py): evaluation pipeline · Runs golden cases and judge-assisted regression metrics. · `backend/evaluate_system.py`
- **Evaluation results**: regression artifacts

## Connections

- App entry and layout → Candidate dashboard: renders
- App entry and layout → Employer dashboard: renders
- App entry and layout → AI career coach: renders
- Candidate dashboard → FastAPI application: API calls
- Employer dashboard → FastAPI application: API calls
- AI career coach → FastAPI application: session chat calls
- FastAPI application → Auth and OTP API: routes
- FastAPI application → Candidate API: routes
- FastAPI application → Structured jobs API: routes
- FastAPI application → Employer publishing API: routes
- FastAPI application → Resume intelligence API: routes
- FastAPI application → Premium AI API: routes
- FastAPI application → Career chat API: routes
- Auth and OTP API → MongoDB Atlas: accounts
- Auth and OTP API → Brevo HTTPS API: OTP email
- Candidate API → MongoDB Atlas: profiles and applications
- Structured jobs API → MongoDB Atlas: structured search
- Employer publishing API → MongoDB Atlas: raw job publish
- External ETL scheduler → Employer publishing API: secured ETL trigger
- Employer publishing API → Job enrichment pipeline: starts batch
- Job enrichment pipeline → MongoDB Atlas: reads raw and updates normalized jobs
- Job enrichment pipeline → Google Gemini: schema enrichment
- Resume intelligence API → Qdrant Cloud: semantic retrieval
- Resume intelligence API → MongoDB Atlas: hydrates job documents
- Resume intelligence API → Google Gemini: fit analysis
- Premium AI API → Google Gemini: generates AI outputs
- Career chat API → Google Gemini: uses session key
- Offline AI evaluation → Google Gemini: judge scoring
- Offline AI evaluation → Evaluation results: writes metrics
