# romanshrestha20/jobpilot architecture

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

- Interactive diagram: https://gitdiagram.com/romanshrestha20/jobpilot
- Repository: https://github.com/romanshrestha20/jobpilot

## Overview

JobPilot is an AI-assisted career-management web application. Its intended user journey is to maintain a candidate profile, add and manage job opportunities, analyze requirements and fit, generate tailored application drafts for review, then track application progress. The implementation also includes a separate background worker for analysis and draft processing, shared authentication, database, queue, and AI-provider infrastructure. The README names interview preparation and progress analytics as product goals, but the supplied tree does not show corresponding implementation modules; unsampled feature details and connections are therefore not inferred.

Main entry points: [`src/app`](https://github.com/romanshrestha20/jobpilot/tree/main/src/app) (App pages), [`src/app/(app)/jobs/[id]/_analysis`](https://github.com/romanshrestha20/jobpilot/tree/main/src/app/(app)/jobs/%5Bid%5D/_analysis) (Analysis interface), [`src/app/(app)/jobs/[id]/_drafts`](https://github.com/romanshrestha20/jobpilot/tree/main/src/app/(app)/jobs/%5Bid%5D/_drafts) (Draft interface), [`src/worker/analysis-worker.ts`](https://github.com/romanshrestha20/jobpilot/blob/main/src/worker/analysis-worker.ts) (Background worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_web["App pages"]
  node_analysisui["Analysis interface"]
  node_draftui["Draft interface"]
end

subgraph group_career["Career features"]
  node_profile["Candidate profile"]
  node_jobs["Job intake"]
  node_tracking["Application tracking"]
  node_matching["Job matching<br/>[match-service.ts]"]
end

subgraph group_processing["AI processing"]
  node_analysis["Job analysis"]
  node_drafts["Draft generation"]
  node_worker["Background worker<br/>[analysis-worker.ts]"]
end

subgraph group_platform["Platform infrastructure"]
  node_auth["Identity<br/>[server.ts]"]
  node_ai["AI providers"]
  node_queue["Job queue<br/>[queue.ts]"]
  node_database[("PostgreSQL data<br/>[db.ts]")]
  node_authservice["Authentication<br/>[auth.ts]"]
end

node_candidate(("Candidate"))

node_candidate -->|"uses"| node_web
node_web -->|"requires identity"| node_auth
node_web -->|"loads jobs"| node_jobs
node_web -->|"renders"| node_analysisui
node_web -->|"renders"| node_draftui
node_candidate -->|"maintains profile"| node_profile
node_candidate -->|"adds opportunities"| node_jobs
node_jobs -->|"supports tracking"| node_tracking
node_analysisui -->|"requests analysis"| node_analysis
node_analysisui -->|"reads job text"| node_jobs
node_candidate -->|"reviews fit"| node_analysisui
node_candidate -->|"reviews drafts"| node_draftui
node_draftui -->|"requests drafts"| node_drafts
node_analysis -->|"processed by"| node_worker
node_drafts -->|"processed by"| node_worker
node_worker -->|"registers handlers"| node_queue
node_worker -->|"uses local gateway"| node_ai
node_analysisui -->|"enqueues runs"| node_queue
node_draftui -->|"enqueues runs"| node_queue
node_auth -->|"checks user"| node_authservice
node_authservice -->|"uses database"| node_database
node_analysis -->|"stores runs"| node_database
node_drafts -->|"stores drafts"| node_database

click node_web "https://github.com/romanshrestha20/jobpilot/tree/main/src/app"
click node_auth "https://github.com/romanshrestha20/jobpilot/blob/main/src/features/identity/server.ts"
click node_profile "https://github.com/romanshrestha20/jobpilot/tree/main/src/features/candidate-profile"
click node_jobs "https://github.com/romanshrestha20/jobpilot/tree/main/src/features/job-intake"
click node_tracking "https://github.com/romanshrestha20/jobpilot/tree/main/src/features/job-intake/tracking"
click node_analysisui "https://github.com/romanshrestha20/jobpilot/tree/main/src/app/(app)/jobs/%5Bid%5D/_analysis"
click node_analysis "https://github.com/romanshrestha20/jobpilot/tree/main/src/features/job-analysis"
click node_matching "https://github.com/romanshrestha20/jobpilot/blob/main/src/features/job-matching/application/match-service.ts"
click node_draftui "https://github.com/romanshrestha20/jobpilot/tree/main/src/app/(app)/jobs/%5Bid%5D/_drafts"
click node_drafts "https://github.com/romanshrestha20/jobpilot/tree/main/src/features/job-drafts"
click node_worker "https://github.com/romanshrestha20/jobpilot/blob/main/src/worker/analysis-worker.ts"
click node_ai "https://github.com/romanshrestha20/jobpilot/tree/main/src/lib/ai"
click node_queue "https://github.com/romanshrestha20/jobpilot/blob/main/src/lib/queue.ts"
click node_database "https://github.com/romanshrestha20/jobpilot/blob/main/src/lib/db.ts"
click node_authservice "https://github.com/romanshrestha20/jobpilot/blob/main/src/lib/auth.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_web,node_analysisui,node_draftui toneBlue
class node_profile,node_jobs,node_tracking,node_matching toneAmber
class node_analysis,node_drafts,node_worker toneMint
class node_auth,node_ai,node_queue,node_database,node_authservice toneRose
class node_candidate toneIndigo
```

## Components

### Web experience

- [App pages](https://github.com/romanshrestha20/jobpilot/tree/main/src/app): `src/app`
- [Analysis interface](https://github.com/romanshrestha20/jobpilot/tree/main/src/app/(app)/jobs/%5Bid%5D/_analysis): `src/app/(app)/jobs/[id]/_analysis`
- [Draft interface](https://github.com/romanshrestha20/jobpilot/tree/main/src/app/(app)/jobs/%5Bid%5D/_drafts): `src/app/(app)/jobs/[id]/_drafts`

### Career features

- [Candidate profile](https://github.com/romanshrestha20/jobpilot/tree/main/src/features/candidate-profile): `src/features/candidate-profile`
- [Job intake](https://github.com/romanshrestha20/jobpilot/tree/main/src/features/job-intake): `src/features/job-intake`
- [Application tracking](https://github.com/romanshrestha20/jobpilot/tree/main/src/features/job-intake/tracking): `src/features/job-intake/tracking`
- [Job matching](https://github.com/romanshrestha20/jobpilot/blob/main/src/features/job-matching/application/match-service.ts): `src/features/job-matching/application/match-service.ts`

### AI processing

- [Job analysis](https://github.com/romanshrestha20/jobpilot/tree/main/src/features/job-analysis): `src/features/job-analysis`
- [Draft generation](https://github.com/romanshrestha20/jobpilot/tree/main/src/features/job-drafts): `src/features/job-drafts`
- [Background worker](https://github.com/romanshrestha20/jobpilot/blob/main/src/worker/analysis-worker.ts): `src/worker/analysis-worker.ts`

### Platform infrastructure

- [Identity](https://github.com/romanshrestha20/jobpilot/blob/main/src/features/identity/server.ts): `src/features/identity/server.ts`
- [AI providers](https://github.com/romanshrestha20/jobpilot/tree/main/src/lib/ai): `src/lib/ai`
- [Job queue](https://github.com/romanshrestha20/jobpilot/blob/main/src/lib/queue.ts): `src/lib/queue.ts`
- [PostgreSQL data](https://github.com/romanshrestha20/jobpilot/blob/main/src/lib/db.ts): `src/lib/db.ts`
- [Authentication](https://github.com/romanshrestha20/jobpilot/blob/main/src/lib/auth.ts): `src/lib/auth.ts`

### Other components

- **Candidate**

## Connections

- Candidate → App pages: uses
- App pages → Identity: requires identity (evidence: `src/features/identity/server.ts`)
- App pages → Job intake: loads jobs (evidence: `src/app/(app)/jobs/page.tsx`)
- App pages → Analysis interface: renders (evidence: `src/app/(app)/jobs/[id]/page.tsx`)
- App pages → Draft interface: renders (evidence: `src/app/(app)/jobs/[id]/page.tsx`)
- Candidate → Candidate profile: maintains profile
- Candidate → Job intake: adds opportunities
- Job intake → Application tracking: supports tracking (evidence: `src/features/job-intake/tracking/repository.ts`)
- Analysis interface → Job analysis: requests analysis (evidence: `src/app/(app)/jobs/[id]/_analysis/server.ts`)
- Analysis interface → Job intake: reads job text (evidence: `src/app/(app)/jobs/[id]/_analysis/server.ts`)
- Candidate → Analysis interface: reviews fit
- Candidate → Draft interface: reviews drafts
- Draft interface → Draft generation: requests drafts (evidence: `src/app/(app)/jobs/[id]/_drafts/server.ts`)
- Job analysis → Background worker: processed by (evidence: `src/worker/index.ts`)
- Draft generation → Background worker: processed by (evidence: `src/worker/index.ts`)
- Background worker → Job queue: registers handlers (evidence: `src/worker/index.ts`)
- Background worker → AI providers: uses local gateway (evidence: `src/worker/index.ts`)
- Analysis interface → Job queue: enqueues runs (evidence: `src/app/(app)/jobs/[id]/_analysis/server.ts`)
- Draft interface → Job queue: enqueues runs (evidence: `src/app/(app)/jobs/[id]/_drafts/server.ts`)
- Identity → Authentication: checks user (evidence: `src/features/identity/server.ts`)
- Authentication → PostgreSQL data: uses database (evidence: `src/lib/auth.ts`)
- Job analysis → PostgreSQL data: stores runs (evidence: `src/features/job-analysis/repository.ts`)
- Draft generation → PostgreSQL data: stores drafts (evidence: `src/features/job-drafts/repository.ts`)
