# chaoticsponge/covermail architecture

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

- Interactive diagram: https://gitdiagram.com/chaoticsponge/covermail
- Repository: https://github.com/chaoticsponge/covermail

## Overview

CoverMail is a local CLI generator: an applicant supplies a profile and either a Seek URL or pasted job details; the app asks a local Ollama model for a tailored email and cover letter, then saves a PDF. The graph separates intake, generation, and output, with the Seek parser shown as an internal layer. The README documents the manual-input option and Ollama workflow. Source excerpts support the main call relationships; unsampled files and runtime integrations are not inferred.

Main entry points: [`main.py`](https://github.com/chaoticsponge/covermail/blob/main/main.py) (Interactive CLI), [`scraper.py`](https://github.com/chaoticsponge/covermail/blob/main/scraper.py) (Seek Scraper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Job Intake"]
  node_cli["Interactive CLI<br/>[main.py]"]
  node_profile["Profile Loader<br/>[main.py]"]
  node_seek_scraper["Seek Scraper<br/>[scraper.py]"]
end

subgraph group_generation["Content Generation"]
  node_prompt["Prompt Builder<br/>[main.py]"]
  node_ollama_call["Ollama Client<br/>[main.py]"]
end

subgraph group_output["Output"]
  node_section_parser["Output Parser<br/>[main.py]"]
  node_pdf_export["PDF Exporter<br/>[main.py]"]
end

node_applicant(("Applicant"))
node_seek_site["Seek"]
node_profile_file["Profile File"]
node_ollama["Local Ollama"]
node_pdf_file["Generated PDF"]

node_applicant -->|"provides input"| node_cli
node_profile_file -->|"provides profile"| node_profile
node_cli -->|"loads profile"| node_profile
node_cli -->|"scrapes URL"| node_seek_scraper
node_seek_scraper -->|"fetches listing"| node_seek_site
node_cli -->|"builds prompt"| node_prompt
node_cli -->|"requests generation"| node_ollama_call
node_ollama_call -->|"sends chat"| node_ollama
node_cli -->|"parses response"| node_section_parser
node_cli -->|"saves letter"| node_pdf_export
node_pdf_export -->|"writes PDF"| node_pdf_file

click node_cli "https://github.com/chaoticsponge/covermail/blob/main/main.py"
click node_profile "https://github.com/chaoticsponge/covermail/blob/main/main.py"
click node_seek_scraper "https://github.com/chaoticsponge/covermail/blob/main/scraper.py"
click node_prompt "https://github.com/chaoticsponge/covermail/blob/main/main.py"
click node_ollama_call "https://github.com/chaoticsponge/covermail/blob/main/main.py"
click node_section_parser "https://github.com/chaoticsponge/covermail/blob/main/main.py"
click node_pdf_export "https://github.com/chaoticsponge/covermail/blob/main/main.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_cli,node_profile,node_seek_scraper toneBlue
class node_prompt,node_ollama_call toneAmber
class node_section_parser,node_pdf_export toneMint
class node_applicant,node_seek_site,node_profile_file,node_ollama,node_pdf_file toneIndigo
```

## Components

### Job Intake

- [Interactive CLI](https://github.com/chaoticsponge/covermail/blob/main/main.py): `main.py`
- [Profile Loader](https://github.com/chaoticsponge/covermail/blob/main/main.py): `main.py`
- [Seek Scraper](https://github.com/chaoticsponge/covermail/blob/main/scraper.py): `scraper.py`

### Content Generation

- [Prompt Builder](https://github.com/chaoticsponge/covermail/blob/main/main.py): `main.py`
- [Ollama Client](https://github.com/chaoticsponge/covermail/blob/main/main.py): `main.py`

### Output

- [Output Parser](https://github.com/chaoticsponge/covermail/blob/main/main.py): `main.py`
- [PDF Exporter](https://github.com/chaoticsponge/covermail/blob/main/main.py): `main.py`

### Other components

- **Applicant**
- **Seek**
- **Profile File**
- **Local Ollama**
- **Generated PDF**

## Connections

- Applicant → Interactive CLI: provides input (evidence: `README.md`)
- Profile File → Profile Loader: provides profile (evidence: `main.py`)
- Interactive CLI → Profile Loader: loads profile (evidence: `main.py`)
- Interactive CLI → Seek Scraper: scrapes URL (evidence: `main.py`)
- Seek Scraper → Seek: fetches listing (evidence: `scraper.py`)
- Interactive CLI → Prompt Builder: builds prompt (evidence: `main.py`)
- Interactive CLI → Ollama Client: requests generation (evidence: `main.py`)
- Ollama Client → Local Ollama: sends chat (evidence: `main.py`)
- Interactive CLI → Output Parser: parses response (evidence: `main.py`)
- Interactive CLI → PDF Exporter: saves letter (evidence: `main.py`)
- PDF Exporter → Generated PDF: writes PDF (evidence: `main.py`)
