# bsd-001/jobcopilot architecture

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

- Interactive diagram: https://gitdiagram.com/bsd-001/jobcopilot
- Repository: https://github.com/bsd-001/jobcopilot

## Overview

JobCopilot is a local AI job-search assistant. A user submits a résumé and job description in the browser; the web API reads the documents and invokes the analysis pipeline, which parses both inputs, evaluates fit, prepares résumé advice, interview questions and a learning plan, and—when given a DOCX—can produce a tailored résumé. It then assembles a report and greeting, which the browser presents and can save to local history. The CLI also exposes the pipeline. Relationships reflect the README and sampled entry-point code; some internal agent calls are documented but not fully excerpted.

Main entry points: [`main.py`](https://github.com/bsd-001/jobcopilot/blob/main/main.py) (Analysis pipeline), [`agents/base.py`](https://github.com/bsd-001/jobcopilot/blob/main/agents/base.py) (Structured agent base), [`webapp.py`](https://github.com/bsd-001/jobcopilot/blob/main/webapp.py) (Web API), [`web/app.js`](https://github.com/bsd-001/jobcopilot/blob/main/web/app.js) (Browser UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_browser["Browser UI<br/>[app.js]"]
  node_webapi["Web API<br/>[webapp.py]"]
  node_cli["CLI entry<br/>[main.py]"]
end

subgraph group_workflow["Analysis workflow"]
  node_reader["Document reader<br/>[document_reader.py]"]
  node_pipeline["Analysis pipeline<br/>[main.py]"]
  node_llm["DeepSeek client<br/>[llm_client.py]"]
  node_writing["Writing checks<br/>[resume_writing.py]"]
  node_template["Word template writer<br/>[resume_template.py]"]
end

subgraph group_agents["Analysis agents"]
  node_resumeparse["Résumé parser<br/>[resume_parser.py]"]
  node_jdparse["JD parser<br/>[jd_parser.py]"]
  node_matching["Match analysis<br/>[match_agent.py]"]
  node_optimizer["Résumé optimizer"]
  node_interview["Interview prep<br/>[interview_agent.py]"]
  node_learning["Learning plan<br/>[learning_plan.py]"]
  node_tailored["Tailored résumé"]
  node_greeting["Greeting writer<br/>[greeting_agent.py]"]
  node_report["Report writer<br/>[report_agent.py]"]
  node_structured["Structured agent base<br/>[base.py]"]
  node_prompts["Prompt templates"]
end

subgraph group_storage["Local storage"]
  node_history["History store<br/>[history_store.py]"]
  node_disk[("Local history files")]
end

node_user(("Job seeker"))
node_deepseek{{"DeepSeek API"}}

node_user -->|"submits materials"| node_browser
node_browser -->|"sends requests"| node_webapi
node_webapi -->|"reads uploads"| node_reader
node_webapi -->|"starts analysis"| node_pipeline
node_cli -->|"reads files"| node_reader
node_cli -->|"runs analysis"| node_pipeline
node_pipeline -->|"parses résumé"| node_resumeparse
node_pipeline -->|"parses JD"| node_jdparse
node_pipeline -->|"scores fit"| node_matching
node_pipeline -->|"optimizes résumé"| node_optimizer
node_pipeline -->|"predicts questions"| node_interview
node_pipeline -->|"plans learning"| node_learning
node_pipeline -->|"tailors DOCX"| node_tailored
node_pipeline -->|"writes template"| node_template
node_pipeline -->|"creates greeting"| node_greeting
node_pipeline -->|"assembles report"| node_report
node_structured -->|"builds prompts"| node_prompts
node_structured -->|"requests JSON"| node_llm
node_resumeparse -->|"uses base"| node_structured
node_jdparse -->|"uses base"| node_structured
node_tailored -->|"uses base"| node_structured
node_tailored -->|"checks writing"| node_writing
node_optimizer -->|"checks writing"| node_writing
node_llm -->|"calls API"| node_deepseek
node_webapi -->|"manages records"| node_history
node_history -->|"reads and writes"| node_disk
node_browser -->|"browses history"| node_history

click node_browser "https://github.com/bsd-001/jobcopilot/blob/main/web/app.js"
click node_webapi "https://github.com/bsd-001/jobcopilot/blob/main/webapp.py"
click node_cli "https://github.com/bsd-001/jobcopilot/blob/main/main.py"
click node_reader "https://github.com/bsd-001/jobcopilot/blob/main/core/document_reader.py"
click node_pipeline "https://github.com/bsd-001/jobcopilot/blob/main/main.py"
click node_resumeparse "https://github.com/bsd-001/jobcopilot/blob/main/agents/resume_parser.py"
click node_jdparse "https://github.com/bsd-001/jobcopilot/blob/main/agents/jd_parser.py"
click node_matching "https://github.com/bsd-001/jobcopilot/blob/main/agents/match_agent.py"
click node_optimizer "https://github.com/bsd-001/jobcopilot/blob/main/agents/resume_optimizer.py"
click node_interview "https://github.com/bsd-001/jobcopilot/blob/main/agents/interview_agent.py"
click node_learning "https://github.com/bsd-001/jobcopilot/blob/main/agents/learning_plan.py"
click node_tailored "https://github.com/bsd-001/jobcopilot/blob/main/agents/tailored_resume_agent.py"
click node_greeting "https://github.com/bsd-001/jobcopilot/blob/main/agents/greeting_agent.py"
click node_report "https://github.com/bsd-001/jobcopilot/blob/main/agents/report_agent.py"
click node_structured "https://github.com/bsd-001/jobcopilot/blob/main/agents/base.py"
click node_prompts "https://github.com/bsd-001/jobcopilot/blob/main/core/prompt_templates.py"
click node_llm "https://github.com/bsd-001/jobcopilot/blob/main/core/llm_client.py"
click node_writing "https://github.com/bsd-001/jobcopilot/blob/main/core/resume_writing.py"
click node_template "https://github.com/bsd-001/jobcopilot/blob/main/core/resume_template.py"
click node_history "https://github.com/bsd-001/jobcopilot/blob/main/core/history_store.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_browser,node_webapi,node_cli toneBlue
class node_reader,node_pipeline,node_llm,node_writing,node_template toneAmber
class node_resumeparse,node_jdparse,node_matching,node_optimizer,node_interview,node_learning,node_tailored,node_greeting,node_report,node_structured,node_prompts,node_deepseek toneMint
class node_history,node_disk toneRose
class node_user toneIndigo
```

## Components

### User interface

- [Browser UI](https://github.com/bsd-001/jobcopilot/blob/main/web/app.js): `web/app.js`
- [Web API](https://github.com/bsd-001/jobcopilot/blob/main/webapp.py): `webapp.py`
- [CLI entry](https://github.com/bsd-001/jobcopilot/blob/main/main.py): `main.py`

### Analysis workflow

- [Document reader](https://github.com/bsd-001/jobcopilot/blob/main/core/document_reader.py): `core/document_reader.py`
- [Analysis pipeline](https://github.com/bsd-001/jobcopilot/blob/main/main.py): `main.py`
- [DeepSeek client](https://github.com/bsd-001/jobcopilot/blob/main/core/llm_client.py): `core/llm_client.py`
- [Writing checks](https://github.com/bsd-001/jobcopilot/blob/main/core/resume_writing.py): `core/resume_writing.py`
- [Word template writer](https://github.com/bsd-001/jobcopilot/blob/main/core/resume_template.py): `core/resume_template.py`

### Analysis agents

- [Résumé parser](https://github.com/bsd-001/jobcopilot/blob/main/agents/resume_parser.py): `agents/resume_parser.py`
- [JD parser](https://github.com/bsd-001/jobcopilot/blob/main/agents/jd_parser.py): `agents/jd_parser.py`
- [Match analysis](https://github.com/bsd-001/jobcopilot/blob/main/agents/match_agent.py): `agents/match_agent.py`
- [Résumé optimizer](https://github.com/bsd-001/jobcopilot/blob/main/agents/resume_optimizer.py): `agents/resume_optimizer.py`
- [Interview prep](https://github.com/bsd-001/jobcopilot/blob/main/agents/interview_agent.py): `agents/interview_agent.py`
- [Learning plan](https://github.com/bsd-001/jobcopilot/blob/main/agents/learning_plan.py): `agents/learning_plan.py`
- [Tailored résumé](https://github.com/bsd-001/jobcopilot/blob/main/agents/tailored_resume_agent.py): `agents/tailored_resume_agent.py`
- [Greeting writer](https://github.com/bsd-001/jobcopilot/blob/main/agents/greeting_agent.py): `agents/greeting_agent.py`
- [Report writer](https://github.com/bsd-001/jobcopilot/blob/main/agents/report_agent.py): `agents/report_agent.py`
- [Structured agent base](https://github.com/bsd-001/jobcopilot/blob/main/agents/base.py): `agents/base.py`
- [Prompt templates](https://github.com/bsd-001/jobcopilot/blob/main/core/prompt_templates.py): `core/prompt_templates.py`

### Local storage

- [History store](https://github.com/bsd-001/jobcopilot/blob/main/core/history_store.py): `core/history_store.py`
- **Local history files**

### Other components

- **Job seeker**
- **DeepSeek API**

## Connections

- Job seeker → Browser UI: submits materials (evidence: `README.md`)
- Browser UI → Web API: sends requests (evidence: `README.md`)
- Web API → Document reader: reads uploads (evidence: `webapp.py`)
- Web API → Analysis pipeline: starts analysis (evidence: `webapp.py`)
- CLI entry → Document reader: reads files (evidence: `main.py`)
- CLI entry → Analysis pipeline: runs analysis (evidence: `main.py`)
- Analysis pipeline → Résumé parser: parses résumé (evidence: `main.py`)
- Analysis pipeline → JD parser: parses JD (evidence: `main.py`)
- Analysis pipeline → Match analysis: scores fit (evidence: `README.md`)
- Analysis pipeline → Résumé optimizer: optimizes résumé (evidence: `README.md`)
- Analysis pipeline → Interview prep: predicts questions (evidence: `README.md`)
- Analysis pipeline → Learning plan: plans learning (evidence: `main.py`)
- Analysis pipeline → Tailored résumé: tailors DOCX (evidence: `main.py`)
- Analysis pipeline → Word template writer: writes template (evidence: `main.py`)
- Analysis pipeline → Greeting writer: creates greeting (evidence: `main.py`)
- Analysis pipeline → Report writer: assembles report (evidence: `main.py`)
- Structured agent base → Prompt templates: builds prompts (evidence: `agents/base.py`)
- Structured agent base → DeepSeek client: requests JSON (evidence: `agents/base.py`)
- Résumé parser → Structured agent base: uses base (evidence: `agents/resume_parser.py`)
- JD parser → Structured agent base: uses base (evidence: `agents/jd_parser.py`)
- Tailored résumé → Structured agent base: uses base (evidence: `agents/tailored_resume_agent.py`)
- Tailored résumé → Writing checks: checks writing (evidence: `agents/tailored_resume_agent.py`)
- Résumé optimizer → Writing checks: checks writing (evidence: `agents/resume_optimizer.py`)
- DeepSeek client → DeepSeek API: calls API (evidence: `core/llm_client.py`)
- Web API → History store: manages records (evidence: `webapp.py`)
- History store → Local history files: reads and writes (evidence: `core/history_store.py`)
- Browser UI → History store: browses history (evidence: `README.md`)
