# krissh007/jobpilot architecture

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

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

## Overview

JobPilot is a local job-search and application dashboard backed by a SQLite pipeline. Its main workflow discovers LinkedIn and Naukri jobs, scores them against a master resume, generates checked application documents, then prepares applications for user review or configured auto-submit. The README documents the stage order and approval safeguards; sampled source also shows discovery orchestration, database status history, and dashboard composition. Several agent and API internals were not excerpted, so their connections below rely on README statements or SOURCE INDEX references rather than claims about unsampled implementation details.

Main entry points: [`jobpilot/discovery/pipeline.py`](https://github.com/krissh007/jobpilot/blob/main/jobpilot/discovery/pipeline.py) (Job discovery), [`jobpilot/agents/shortlist.py`](https://github.com/krissh007/jobpilot/blob/main/jobpilot/agents/shortlist.py) (Scoring agent), [`jobpilot/agents/apply/runner.py`](https://github.com/krissh007/jobpilot/blob/main/jobpilot/agents/apply/runner.py) (Application agent), [`jobpilot/db/repo.py`](https://github.com/krissh007/jobpilot/blob/main/jobpilot/db/repo.py) (Job repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Dashboard"]
  node_dashboard["Dashboard views<br/>[App.tsx]"]
  node_webstate["UI state and data<br/>[state.tsx]"]
  node_webclient["API client<br/>[api.ts]"]
end

subgraph group_control["API and scheduling"]
  node_api["Local API<br/>[main.py]"]
  node_apiroutes["API routes"]
  node_scheduler["Agent scheduler<br/>[scheduled.py]"]
end

subgraph group_pipeline["Job pipeline"]
  node_discovery["Job discovery<br/>[pipeline.py]"]
  node_sources["Portal search sources"]
  node_cards["Job cards and ranking<br/>[cards.py]"]
  node_discoveryconfig["Search configuration<br/>[config.py]"]
  node_titles["Title matching<br/>[titles.py]"]
  node_scoring["Scoring agent<br/>[shortlist.py]"]
  node_scoregates["Eligibility gates<br/>[gates.py]"]
end

subgraph group_apply["Documents and apply"]
  node_documents["Documents agent<br/>[documents.py]"]
  node_tailoring["Resume tailoring<br/>[tailor.py]"]
  node_docwriter["Document writer<br/>[docx_writer.py]"]
  node_applyagent["Application agent<br/>[runner.py]"]
  node_answerbank["Answers and form filling<br/>[answers.py]"]
end

subgraph group_shared["Shared services"]
  node_dbsession["Database sessions<br/>[session.py]"]
  node_dbmodels[("Pipeline records<br/>[models.py]")]
  node_dbrepo["Job repository<br/>[repo.py]"]
  node_dedupe["Job deduplication<br/>[dedupe.py]"]
  node_resume["Master resume<br/>[resume.py]"]
  node_experience["Experience parsing<br/>[experience.py]"]
  node_gemini["Gemini client<br/>[gemini.py]"]
  node_config["Runtime configuration<br/>[config.py]"]
end

node_user(("Job seeker"))
node_portals{{"Job portals"}}
node_geminiservice{{"Google Gemini"}}

node_user -->|"uses"| node_dashboard
node_dashboard -->|"reads UI data"| node_webstate
node_webstate -->|"calls"| node_webclient
node_webclient -->|"requests data"| node_api
node_api -->|"registers routes"| node_apiroutes
node_user -->|"starts and reviews"| node_apiroutes
node_scheduler -->|"runs first"| node_discovery
node_scheduler -->|"runs second"| node_scoring
node_scheduler -->|"runs third"| node_documents
node_scheduler -->|"runs fourth"| node_applyagent
node_discovery -->|"fetches and enriches"| node_sources
node_discovery -->|"dedupes and ranks"| node_cards
node_discovery -->|"uses queries"| node_discoveryconfig
node_discovery -->|"parses experience"| node_experience
node_discovery -->|"saves jobs"| node_dbrepo
node_sources -->|"searches"| node_portals
node_discoveryconfig -->|"uses title rules"| node_titles
node_scoring -->|"checks eligibility"| node_scoregates
node_scoring -->|"scores jobs"| node_gemini
node_scoring -->|"compares against"| node_resume
node_scoring -->|"updates status"| node_dbrepo
node_documents -->|"generates tailored content"| node_tailoring
node_documents -->|"loads source resume"| node_resume
node_documents -->|"updates job status"| node_dbrepo
node_tailoring -->|"requests text"| node_gemini
node_tailoring -->|"writes documents"| node_docwriter
node_applyagent -->|"fills application fields"| node_answerbank
node_applyagent -->|"prepares applications"| node_portals
node_user -->|"approves applications"| node_applyagent
node_applyagent -->|"records applications"| node_dbmodels
node_dbsession -->|"gets database URL"| node_config
node_dbrepo -->|"finds duplicates"| node_dedupe
node_dbrepo -->|"reads and writes"| node_dbmodels
node_dbsession -.->|"persists records"| node_dbmodels
node_gemini -->|"loads settings"| node_config
node_gemini -->|"calls model API"| node_geminiservice

click node_dashboard "https://github.com/krissh007/jobpilot/blob/main/web/src/App.tsx"
click node_webstate "https://github.com/krissh007/jobpilot/blob/main/web/src/state.tsx"
click node_webclient "https://github.com/krissh007/jobpilot/blob/main/web/src/api.ts"
click node_api "https://github.com/krissh007/jobpilot/blob/main/jobpilot/api/main.py"
click node_apiroutes "https://github.com/krissh007/jobpilot/tree/main/jobpilot/api/routers"
click node_scheduler "https://github.com/krissh007/jobpilot/blob/main/jobpilot/scheduled.py"
click node_discovery "https://github.com/krissh007/jobpilot/blob/main/jobpilot/discovery/pipeline.py"
click node_sources "https://github.com/krissh007/jobpilot/tree/main/jobpilot/discovery/sources"
click node_cards "https://github.com/krissh007/jobpilot/blob/main/jobpilot/discovery/cards.py"
click node_discoveryconfig "https://github.com/krissh007/jobpilot/blob/main/jobpilot/discovery/config.py"
click node_titles "https://github.com/krissh007/jobpilot/blob/main/jobpilot/discovery/titles.py"
click node_scoring "https://github.com/krissh007/jobpilot/blob/main/jobpilot/agents/shortlist.py"
click node_scoregates "https://github.com/krissh007/jobpilot/blob/main/jobpilot/scoring/gates.py"
click node_documents "https://github.com/krissh007/jobpilot/blob/main/jobpilot/agents/documents.py"
click node_tailoring "https://github.com/krissh007/jobpilot/blob/main/jobpilot/tailoring/tailor.py"
click node_docwriter "https://github.com/krissh007/jobpilot/blob/main/jobpilot/tailoring/docx_writer.py"
click node_applyagent "https://github.com/krissh007/jobpilot/blob/main/jobpilot/agents/apply/runner.py"
click node_answerbank "https://github.com/krissh007/jobpilot/blob/main/jobpilot/agents/apply/answers.py"
click node_dbsession "https://github.com/krissh007/jobpilot/blob/main/jobpilot/db/session.py"
click node_dbmodels "https://github.com/krissh007/jobpilot/blob/main/jobpilot/db/models.py"
click node_dbrepo "https://github.com/krissh007/jobpilot/blob/main/jobpilot/db/repo.py"
click node_dedupe "https://github.com/krissh007/jobpilot/blob/main/jobpilot/db/dedupe.py"
click node_resume "https://github.com/krissh007/jobpilot/blob/main/jobpilot/resume.py"
click node_experience "https://github.com/krissh007/jobpilot/blob/main/jobpilot/experience.py"
click node_gemini "https://github.com/krissh007/jobpilot/blob/main/jobpilot/llm/gemini.py"
click node_config "https://github.com/krissh007/jobpilot/blob/main/jobpilot/config.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_dashboard,node_webstate,node_webclient toneBlue
class node_api,node_apiroutes,node_scheduler toneAmber
class node_discovery,node_sources,node_cards,node_discoveryconfig,node_titles,node_scoring,node_scoregates toneMint
class node_documents,node_tailoring,node_docwriter,node_applyagent,node_answerbank toneRose
class node_dbsession,node_dbmodels,node_dbrepo,node_dedupe,node_resume,node_experience,node_gemini,node_config,node_user,node_portals,node_geminiservice toneIndigo
```

## Components

### Dashboard

- [Dashboard views](https://github.com/krissh007/jobpilot/blob/main/web/src/App.tsx): `web/src/App.tsx`
- [UI state and data](https://github.com/krissh007/jobpilot/blob/main/web/src/state.tsx): `web/src/state.tsx`
- [API client](https://github.com/krissh007/jobpilot/blob/main/web/src/api.ts): `web/src/api.ts`

### API and scheduling

- [Local API](https://github.com/krissh007/jobpilot/blob/main/jobpilot/api/main.py): `jobpilot/api/main.py`
- [API routes](https://github.com/krissh007/jobpilot/tree/main/jobpilot/api/routers): `jobpilot/api/routers`
- [Agent scheduler](https://github.com/krissh007/jobpilot/blob/main/jobpilot/scheduled.py): `jobpilot/scheduled.py`

### Job pipeline

- [Job discovery](https://github.com/krissh007/jobpilot/blob/main/jobpilot/discovery/pipeline.py): `jobpilot/discovery/pipeline.py`
- [Portal search sources](https://github.com/krissh007/jobpilot/tree/main/jobpilot/discovery/sources): `jobpilot/discovery/sources`
- [Job cards and ranking](https://github.com/krissh007/jobpilot/blob/main/jobpilot/discovery/cards.py): `jobpilot/discovery/cards.py`
- [Search configuration](https://github.com/krissh007/jobpilot/blob/main/jobpilot/discovery/config.py): `jobpilot/discovery/config.py`
- [Title matching](https://github.com/krissh007/jobpilot/blob/main/jobpilot/discovery/titles.py): `jobpilot/discovery/titles.py`
- [Scoring agent](https://github.com/krissh007/jobpilot/blob/main/jobpilot/agents/shortlist.py): `jobpilot/agents/shortlist.py`
- [Eligibility gates](https://github.com/krissh007/jobpilot/blob/main/jobpilot/scoring/gates.py): `jobpilot/scoring/gates.py`

### Documents and apply

- [Documents agent](https://github.com/krissh007/jobpilot/blob/main/jobpilot/agents/documents.py): `jobpilot/agents/documents.py`
- [Resume tailoring](https://github.com/krissh007/jobpilot/blob/main/jobpilot/tailoring/tailor.py): `jobpilot/tailoring/tailor.py`
- [Document writer](https://github.com/krissh007/jobpilot/blob/main/jobpilot/tailoring/docx_writer.py): `jobpilot/tailoring/docx_writer.py`
- [Application agent](https://github.com/krissh007/jobpilot/blob/main/jobpilot/agents/apply/runner.py): `jobpilot/agents/apply/runner.py`
- [Answers and form filling](https://github.com/krissh007/jobpilot/blob/main/jobpilot/agents/apply/answers.py): `jobpilot/agents/apply/answers.py`

### Shared services

- [Database sessions](https://github.com/krissh007/jobpilot/blob/main/jobpilot/db/session.py): `jobpilot/db/session.py`
- [Pipeline records](https://github.com/krissh007/jobpilot/blob/main/jobpilot/db/models.py): `jobpilot/db/models.py`
- [Job repository](https://github.com/krissh007/jobpilot/blob/main/jobpilot/db/repo.py): `jobpilot/db/repo.py`
- [Job deduplication](https://github.com/krissh007/jobpilot/blob/main/jobpilot/db/dedupe.py): `jobpilot/db/dedupe.py`
- [Master resume](https://github.com/krissh007/jobpilot/blob/main/jobpilot/resume.py): `jobpilot/resume.py`
- [Experience parsing](https://github.com/krissh007/jobpilot/blob/main/jobpilot/experience.py): `jobpilot/experience.py`
- [Gemini client](https://github.com/krissh007/jobpilot/blob/main/jobpilot/llm/gemini.py): `jobpilot/llm/gemini.py`
- [Runtime configuration](https://github.com/krissh007/jobpilot/blob/main/jobpilot/config.py): `jobpilot/config.py`

### Other components

- **Job seeker**
- **Job portals**
- **Google Gemini**

## Connections

- Job seeker → Dashboard views: uses (evidence: `README.md`)
- Dashboard views → UI state and data: reads UI data (evidence: `web/src/App.tsx`)
- UI state and data → API client: calls (evidence: `web/src/state.tsx`)
- API client → Local API: requests data (evidence: `README.md`)
- Local API → API routes: registers routes (evidence: `jobpilot/api/main.py`)
- Job seeker → API routes: starts and reviews (evidence: `README.md`)
- Agent scheduler → Job discovery: runs first (evidence: `jobpilot/scheduled.py`)
- Agent scheduler → Scoring agent: runs second (evidence: `jobpilot/scheduled.py`)
- Agent scheduler → Documents agent: runs third (evidence: `jobpilot/scheduled.py`)
- Agent scheduler → Application agent: runs fourth (evidence: `jobpilot/scheduled.py`)
- Job discovery → Portal search sources: fetches and enriches (evidence: `jobpilot/discovery/pipeline.py`)
- Job discovery → Job cards and ranking: dedupes and ranks (evidence: `jobpilot/discovery/pipeline.py`)
- Job discovery → Search configuration: uses queries (evidence: `jobpilot/discovery/pipeline.py`)
- Job discovery → Experience parsing: parses experience (evidence: `jobpilot/discovery/pipeline.py`)
- Job discovery → Job repository: saves jobs (evidence: `README.md`)
- Portal search sources → Job portals: searches (evidence: `README.md`)
- Search configuration → Title matching: uses title rules (evidence: `jobpilot/discovery/config.py`)
- Scoring agent → Eligibility gates: checks eligibility (evidence: `jobpilot/agents/shortlist.py`)
- Scoring agent → Gemini client: scores jobs (evidence: `README.md`)
- Scoring agent → Master resume: compares against (evidence: `README.md`)
- Scoring agent → Job repository: updates status (evidence: `jobpilot/agents/shortlist.py`)
- Documents agent → Resume tailoring: generates tailored content (evidence: `jobpilot/agents/documents.py`)
- Documents agent → Master resume: loads source resume (evidence: `jobpilot/agents/documents.py`)
- Documents agent → Job repository: updates job status (evidence: `jobpilot/agents/documents.py`)
- Resume tailoring → Gemini client: requests text (evidence: `jobpilot/tailoring/tailor.py`)
- Resume tailoring → Document writer: writes documents (evidence: `jobpilot/tailoring/generator.py`)
- Application agent → Answers and form filling: fills application fields (evidence: `jobpilot/agents/apply/runner.py`)
- Application agent → Job portals: prepares applications (evidence: `README.md`)
- Job seeker → Application agent: approves applications (evidence: `README.md`)
- Application agent → Pipeline records: records applications (evidence: `jobpilot/agents/apply/runner.py`)
- Database sessions → Runtime configuration: gets database URL (evidence: `jobpilot/db/session.py`)
- Job repository → Job deduplication: finds duplicates (evidence: `jobpilot/db/repo.py`)
- Job repository → Pipeline records: reads and writes (evidence: `jobpilot/db/repo.py`)
- Database sessions → Pipeline records: persists records
- Gemini client → Runtime configuration: loads settings (evidence: `jobpilot/llm/gemini.py`)
- Gemini client → Google Gemini: calls model API (evidence: `jobpilot/llm/gemini.py`)
