# pandeychandan001/career-copilot architecture

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

- Interactive diagram: https://gitdiagram.com/pandeychandan001/career-copilot
- Repository: https://github.com/pandeychandan001/career-copilot

## Overview

Career Copilot accepts a resume and target job description, parses uploaded PDFs, then returns an ATS-oriented analysis with scoring, keyword gaps, rewrites, a preparation roadmap, and interview questions. Users can also generate tailored resume data, export a PDF, and revisit saved analyses. The graph follows the shown analysis route and its service calls; several UI-to-endpoint links and README-documented capabilities are included only where documented or marked unverified.

Main entry points: [`src/app/page.tsx`](https://github.com/pandeychandan001/career-copilot/blob/main/src/app/page.tsx) (Analysis Dashboard), [`src/app/api/analyze/route.ts`](https://github.com/pandeychandan001/career-copilot/blob/main/src/app/api/analyze/route.ts) (Analysis Route), [`src/services/resumeService.ts`](https://github.com/pandeychandan001/career-copilot/blob/main/src/services/resumeService.ts) (Resume Generation), [`src/services/historyService.ts`](https://github.com/pandeychandan001/career-copilot/blob/main/src/services/historyService.ts) (History Persistence)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Career Copilot UI"]
  node_dashboard["Analysis Dashboard<br/>[page.tsx]"]
  node_upload["Resume Upload"]
  node_score["Match Score<br/>[MatchScoreCard.tsx]"]
  node_keyword["Keyword Matrix<br/>[KeywordMatrix.tsx]"]
  node_gaps["Skill Gaps<br/>[SkillGapList.tsx]"]
  node_roadmap["Preparation Roadmap"]
  node_questions["Interview Questions"]
  node_rewrite["Resume Rewrites"]
  node_historyui["History Drawer<br/>[HistoryDrawer.tsx]"]
  node_exportui["Dashboard Export"]
end

subgraph group_api["Request Routes"]
  node_parseapi["PDF Parse Route<br/>[route.ts]"]
  node_analyzeapi["Analysis Route<br/>[route.ts]"]
  node_historyapi["History Routes<br/>[route.ts]"]
  node_historyidapi["Analysis Detail Route<br/>[route.ts]"]
  node_tailorapi["Tailor Data Route<br/>[route.ts]"]
  node_pdfapi["PDF Export Route<br/>[route.ts]"]
end

subgraph group_analysis["Analysis Services"]
  node_parser["PDF Text Parser<br/>[parserService.ts]"]
  node_ai["AI Gap Analysis<br/>[aiService.ts]"]
  node_scoring["Deterministic Scoring<br/>[scoring.ts]"]
  node_sanitize["Resume Sanitizer<br/>[sanitizer.ts]"]
end

subgraph group_resume["Resume Tailoring"]
  node_resume["Resume Generation<br/>[resumeService.ts]"]
  node_pdfdoc["ATS Resume Document"]
end

subgraph group_foundation["Data and Contracts"]
  node_history["History Persistence<br/>[historyService.ts]"]
  node_database[("PostgreSQL")]
  node_analysiscontract["Analysis Schema<br/>[analysisSchema.ts]"]
  node_resumecontract["Resume Schema<br/>[resumeSchema.ts]"]
end

node_user(("Job Seeker"))
node_openrouter{{"OpenRouter Model"}}
node_gemini{{"Google Gemini"}}
node_clerk{{"Clerk Identity"}}

node_user -->|"uses"| node_dashboard
node_dashboard -->|"submits analysis"| node_analyzeapi
node_dashboard -->|"renders"| node_upload
node_upload -.->|"requests parsing"| node_parseapi
node_parseapi -->|"extracts text"| node_parser
node_analyzeapi -->|"redacts PII"| node_sanitize
node_analyzeapi -->|"calculates match"| node_scoring
node_analyzeapi -->|"generates analysis"| node_ai
node_ai -->|"generates text"| node_openrouter
node_ai -->|"validates output"| node_analysiscontract
node_analyzeapi -->|"checks identity"| node_clerk
node_analyzeapi -->|"saves analysis"| node_history
node_historyapi -->|"loads analyses"| node_history
node_historyidapi -->|"loads record"| node_history
node_history -->|"reads and writes"| node_database
node_dashboard -->|"renders score"| node_score
node_dashboard -->|"renders history"| node_historyui
node_historyui -.->|"requests history"| node_historyapi
node_dashboard -.->|"shows keyword gaps"| node_keyword
node_dashboard -.->|"shows skill gaps"| node_gaps
node_dashboard -.->|"shows preparation plan"| node_roadmap
node_dashboard -.->|"shows questions"| node_questions
node_dashboard -.->|"shows rewrites"| node_rewrite
node_dashboard -->|"renders export"| node_exportui
node_dashboard -.->|"requests tailored data"| node_tailorapi
node_tailorapi -->|"generates resume data"| node_resume
node_resume -->|"generates structured data"| node_gemini
node_resume -->|"validates resume"| node_resumecontract
node_pdfapi -->|"renders PDF"| node_resume
node_resume -->|"renders document"| node_pdfdoc
node_exportui -.->|"requests PDF"| node_pdfapi

click node_dashboard "https://github.com/pandeychandan001/career-copilot/blob/main/src/app/page.tsx"
click node_upload "https://github.com/pandeychandan001/career-copilot/blob/main/src/components/dashboard/ResumeUploadZone.tsx"
click node_score "https://github.com/pandeychandan001/career-copilot/blob/main/src/components/dashboard/MatchScoreCard.tsx"
click node_keyword "https://github.com/pandeychandan001/career-copilot/blob/main/src/components/dashboard/KeywordMatrix.tsx"
click node_gaps "https://github.com/pandeychandan001/career-copilot/blob/main/src/components/dashboard/SkillGapList.tsx"
click node_roadmap "https://github.com/pandeychandan001/career-copilot/blob/main/src/components/dashboard/PreparationRoadmap.tsx"
click node_questions "https://github.com/pandeychandan001/career-copilot/blob/main/src/components/dashboard/InterviewQuestionBank.tsx"
click node_rewrite "https://github.com/pandeychandan001/career-copilot/blob/main/src/components/dashboard/LiveResumeRewrite.tsx"
click node_historyui "https://github.com/pandeychandan001/career-copilot/blob/main/src/components/dashboard/HistoryDrawer.tsx"
click node_exportui "https://github.com/pandeychandan001/career-copilot/blob/main/src/components/dashboard/ExportDashboardCTA.tsx"
click node_parseapi "https://github.com/pandeychandan001/career-copilot/blob/main/src/app/api/parse/route.ts"
click node_analyzeapi "https://github.com/pandeychandan001/career-copilot/blob/main/src/app/api/analyze/route.ts"
click node_historyapi "https://github.com/pandeychandan001/career-copilot/blob/main/src/app/api/history/route.ts"
click node_historyidapi "https://github.com/pandeychandan001/career-copilot/blob/main/src/app/api/history/%5Bid%5D/route.ts"
click node_tailorapi "https://github.com/pandeychandan001/career-copilot/blob/main/src/app/api/tailor-data/route.ts"
click node_pdfapi "https://github.com/pandeychandan001/career-copilot/blob/main/src/app/api/export-pdf/route.ts"
click node_parser "https://github.com/pandeychandan001/career-copilot/blob/main/src/services/parserService.ts"
click node_ai "https://github.com/pandeychandan001/career-copilot/blob/main/src/services/aiService.ts"
click node_scoring "https://github.com/pandeychandan001/career-copilot/blob/main/src/lib/scoring.ts"
click node_sanitize "https://github.com/pandeychandan001/career-copilot/blob/main/src/lib/sanitizer.ts"
click node_resume "https://github.com/pandeychandan001/career-copilot/blob/main/src/services/resumeService.ts"
click node_pdfdoc "https://github.com/pandeychandan001/career-copilot/blob/main/src/components/pdf/ATSResumeDocument.tsx"
click node_history "https://github.com/pandeychandan001/career-copilot/blob/main/src/services/historyService.ts"
click node_analysiscontract "https://github.com/pandeychandan001/career-copilot/blob/main/src/schemas/analysisSchema.ts"
click node_resumecontract "https://github.com/pandeychandan001/career-copilot/blob/main/src/schemas/resumeSchema.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_dashboard,node_upload,node_score,node_keyword,node_gaps,node_roadmap,node_questions,node_rewrite,node_historyui,node_exportui toneBlue
class node_parseapi,node_analyzeapi,node_historyapi,node_historyidapi,node_tailorapi,node_pdfapi toneAmber
class node_parser,node_ai,node_scoring,node_sanitize,node_openrouter toneMint
class node_resume,node_pdfdoc toneRose
class node_history,node_database,node_analysiscontract,node_resumecontract,node_user,node_gemini,node_clerk toneIndigo
```

## Components

### Career Copilot UI

- [Analysis Dashboard](https://github.com/pandeychandan001/career-copilot/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Resume Upload](https://github.com/pandeychandan001/career-copilot/blob/main/src/components/dashboard/ResumeUploadZone.tsx): `src/components/dashboard/ResumeUploadZone.tsx`
- [Match Score](https://github.com/pandeychandan001/career-copilot/blob/main/src/components/dashboard/MatchScoreCard.tsx): `src/components/dashboard/MatchScoreCard.tsx`
- [Keyword Matrix](https://github.com/pandeychandan001/career-copilot/blob/main/src/components/dashboard/KeywordMatrix.tsx): `src/components/dashboard/KeywordMatrix.tsx`
- [Skill Gaps](https://github.com/pandeychandan001/career-copilot/blob/main/src/components/dashboard/SkillGapList.tsx): `src/components/dashboard/SkillGapList.tsx`
- [Preparation Roadmap](https://github.com/pandeychandan001/career-copilot/blob/main/src/components/dashboard/PreparationRoadmap.tsx): `src/components/dashboard/PreparationRoadmap.tsx`
- [Interview Questions](https://github.com/pandeychandan001/career-copilot/blob/main/src/components/dashboard/InterviewQuestionBank.tsx): `src/components/dashboard/InterviewQuestionBank.tsx`
- [Resume Rewrites](https://github.com/pandeychandan001/career-copilot/blob/main/src/components/dashboard/LiveResumeRewrite.tsx): `src/components/dashboard/LiveResumeRewrite.tsx`
- [History Drawer](https://github.com/pandeychandan001/career-copilot/blob/main/src/components/dashboard/HistoryDrawer.tsx): `src/components/dashboard/HistoryDrawer.tsx`
- [Dashboard Export](https://github.com/pandeychandan001/career-copilot/blob/main/src/components/dashboard/ExportDashboardCTA.tsx): `src/components/dashboard/ExportDashboardCTA.tsx`

### Request Routes

- [PDF Parse Route](https://github.com/pandeychandan001/career-copilot/blob/main/src/app/api/parse/route.ts): `src/app/api/parse/route.ts`
- [Analysis Route](https://github.com/pandeychandan001/career-copilot/blob/main/src/app/api/analyze/route.ts): `src/app/api/analyze/route.ts`
- [History Routes](https://github.com/pandeychandan001/career-copilot/blob/main/src/app/api/history/route.ts): `src/app/api/history/route.ts`
- [Analysis Detail Route](https://github.com/pandeychandan001/career-copilot/blob/main/src/app/api/history/%5Bid%5D/route.ts): `src/app/api/history/[id]/route.ts`
- [Tailor Data Route](https://github.com/pandeychandan001/career-copilot/blob/main/src/app/api/tailor-data/route.ts): `src/app/api/tailor-data/route.ts`
- [PDF Export Route](https://github.com/pandeychandan001/career-copilot/blob/main/src/app/api/export-pdf/route.ts): `src/app/api/export-pdf/route.ts`

### Analysis Services

- [PDF Text Parser](https://github.com/pandeychandan001/career-copilot/blob/main/src/services/parserService.ts): `src/services/parserService.ts`
- [AI Gap Analysis](https://github.com/pandeychandan001/career-copilot/blob/main/src/services/aiService.ts): `src/services/aiService.ts`
- [Deterministic Scoring](https://github.com/pandeychandan001/career-copilot/blob/main/src/lib/scoring.ts): `src/lib/scoring.ts`
- [Resume Sanitizer](https://github.com/pandeychandan001/career-copilot/blob/main/src/lib/sanitizer.ts): `src/lib/sanitizer.ts`

### Resume Tailoring

- [Resume Generation](https://github.com/pandeychandan001/career-copilot/blob/main/src/services/resumeService.ts): `src/services/resumeService.ts`
- [ATS Resume Document](https://github.com/pandeychandan001/career-copilot/blob/main/src/components/pdf/ATSResumeDocument.tsx): `src/components/pdf/ATSResumeDocument.tsx`

### Data and Contracts

- [History Persistence](https://github.com/pandeychandan001/career-copilot/blob/main/src/services/historyService.ts): `src/services/historyService.ts`
- **PostgreSQL**
- [Analysis Schema](https://github.com/pandeychandan001/career-copilot/blob/main/src/schemas/analysisSchema.ts): `src/schemas/analysisSchema.ts`
- [Resume Schema](https://github.com/pandeychandan001/career-copilot/blob/main/src/schemas/resumeSchema.ts): `src/schemas/resumeSchema.ts`

### Other components

- **Job Seeker**
- **OpenRouter Model**
- **Google Gemini**
- **Clerk Identity**

## Connections

- Job Seeker → Analysis Dashboard: uses (evidence: `src/app/page.tsx`)
- Analysis Dashboard → Analysis Route: submits analysis (evidence: `src/app/page.tsx`)
- Analysis Dashboard → Resume Upload: renders (evidence: `src/app/page.tsx`)
- Resume Upload → PDF Parse Route: requests parsing
- PDF Parse Route → PDF Text Parser: extracts text (evidence: `src/app/api/parse/route.ts`)
- Analysis Route → Resume Sanitizer: redacts PII (evidence: `src/app/api/analyze/route.ts`)
- Analysis Route → Deterministic Scoring: calculates match (evidence: `src/app/api/analyze/route.ts`)
- Analysis Route → AI Gap Analysis: generates analysis (evidence: `src/app/api/analyze/route.ts`)
- AI Gap Analysis → OpenRouter Model: generates text (evidence: `src/services/aiService.ts`)
- AI Gap Analysis → Analysis Schema: validates output (evidence: `src/services/aiService.ts`)
- Analysis Route → Clerk Identity: checks identity (evidence: `src/app/api/analyze/route.ts`)
- Analysis Route → History Persistence: saves analysis (evidence: `src/app/api/analyze/route.ts`)
- History Routes → History Persistence: loads analyses (evidence: `src/app/api/history/route.ts`)
- Analysis Detail Route → History Persistence: loads record (evidence: `src/app/api/history/[id]/route.ts`)
- History Persistence → PostgreSQL: reads and writes (evidence: `src/services/historyService.ts`)
- Analysis Dashboard → Match Score: renders score (evidence: `src/app/page.tsx`)
- Analysis Dashboard → History Drawer: renders history (evidence: `src/app/page.tsx`)
- History Drawer → History Routes: requests history
- Analysis Dashboard → Keyword Matrix: shows keyword gaps
- Analysis Dashboard → Skill Gaps: shows skill gaps
- Analysis Dashboard → Preparation Roadmap: shows preparation plan
- Analysis Dashboard → Interview Questions: shows questions
- Analysis Dashboard → Resume Rewrites: shows rewrites
- Analysis Dashboard → Dashboard Export: renders export (evidence: `src/app/page.tsx`)
- Analysis Dashboard → Tailor Data Route: requests tailored data
- Tailor Data Route → Resume Generation: generates resume data (evidence: `src/app/api/tailor-data/route.ts`)
- Resume Generation → Google Gemini: generates structured data (evidence: `src/services/resumeService.ts`)
- Resume Generation → Resume Schema: validates resume (evidence: `src/services/resumeService.ts`)
- PDF Export Route → Resume Generation: renders PDF (evidence: `src/app/api/export-pdf/route.ts`)
- Resume Generation → ATS Resume Document: renders document (evidence: `src/services/resumeService.ts`)
- Dashboard Export → PDF Export Route: requests PDF
