# pluto-atom-4/ats-showcase architecture

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

- Interactive diagram: https://gitdiagram.com/pluto-atom-4/ats-showcase
- Repository: https://github.com/pluto-atom-4/ats-showcase

## Overview

#### Purpose and entry points
ATS Playground is a Python job-assessment pipeline: crawl company career sites, locally reduce job text, obtain user approval, assess CV fit through Claude, and persist/search/export results. The operational entry point is `src/cli.py`; it exposes individual phases plus the `all` orchestrator. Interactive terminal mode is implemented separately in `src/tui/dashboard.py`.

#### Configuration and domain boundary
Company URLs, selectors, and selective processing configuration enter through `config/companies.json` and are validated/modelled in `src/config/models.py`. Core job and assessment records are represented by `src/models/job.py` and `src/models/assessment.py`. This boundary normalizes external site data and CV/LLM outputs before storage or presentation.

#### Crawl stage
`src/browser/crawler.py` drives asynchronous Playwright/Chromium crawling, JavaScript rendering, extraction, retries, and rate control. Site-specific CSS extraction logic resides in `src/browser/selectors.py`. The crawler turns configured company sources into raw job postings; it is the network/browser boundary and should not leak browser-specific HTML concerns downstream.

#### Local preprocessing and cost gate
`src/parsers/html_cleaner.py` converts raw HTML to usable text using MarkItDown with HTML-parser fallback. `src/tokenization/preprocessor.py` coordinates spaCy-backed semantic cleanup/chunking, while `src/tokenization/counter.py` counts tiktoken tokens. This stage materially reduces prompt payloads and produces token/cost inputs before any paid API work.

#### Review and LLM assessment
`src/verification/reviewer.py` provides the approval/edit/reject gate between preprocessing and assessment. Approved jobs and CV content are passed to `src/llm/client.py`, which uses model/provider abstractions in `src/llm/provider.py` and prompts in `src/llm/prompts.py`. Anthropic Claude (Haiku/Sonnet/Opus), authenticated through environment configuration, is the external assessment boundary; returned scores, recommendations, usage, and cost become structured assessments.

#### Persistence, query, export, and lifecycle
SQLite is initialized and accessed through `src/storage/db.py`; persistence/query logic is centered in `src/storage/assessment_store.py` and `src/storage/queries.py`, including FTS5-backed search. Markdown/report output is handled by `src/storage/export.py`. Data-health and retention operations are isolated under `src/integrity/inspector.py`, `src/integrity/purger.py`, and `src/integrity/exporter.py`, preserving safe inspection, repair-oriented reporting, and confirmed purge behavior.

#### Interaction and runtime topology
The CLI supports noninteractive automation and conditionally routes interactive terminals into the TUI. `src/tui/models/state.py` is the workflow-facing UI state boundary; phase panels such as `src/tui/panels/crawl_panel.py` and `src/tui/panels/assess_panel.py` display progress and cost without owning pipeline logic. Runtime dependencies are Python 3.12+ (per project setup), Playwright Chromium, spaCy `en_core_web_md`, tiktoken, SQLite, and the Anthropic API. Persistent output is a local SQLite database plus optional Markdown exports.

Main entry points: [`src/browser/crawler.py`](https://github.com/pluto-atom-4/ats-showcase/blob/main/src/browser/crawler.py) (Playwright crawler), [`src/llm/client.py`](https://github.com/pluto-atom-4/ats-showcase/blob/main/src/llm/client.py) (Assessment client), [`src/storage/assessment_store.py`](https://github.com/pluto-atom-4/ats-showcase/blob/main/src/storage/assessment_store.py) (Assessment store), [`src/tui/dashboard.py`](https://github.com/pluto-atom-4/ats-showcase/blob/main/src/tui/dashboard.py) (Interactive dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Ingest &amp; preparation"]
  node_company_config["Company configuration<br/>JSON source config<br/>[companies.json]"]
  node_config_models["Configuration models<br/>validated config<br/>[models.py]"]
  node_crawler["Playwright crawler<br/>browser boundary<br/>[crawler.py]"]
  node_selectors["Site selectors<br/>CSS extraction rules<br/>[selectors.py]"]
  node_job_model["Job records<br/>domain model<br/>[job.py]"]
  node_html_cleaner["HTML cleaner<br/>text extraction<br/>[html_cleaner.py]"]
  node_preprocessor["Semantic preprocessor<br/>spaCy cleanup and chunking<br/>[preprocessor.py]"]
  node_token_counter["Token counter<br/>tiktoken cost input<br/>[counter.py]"]
end

subgraph group_assessment["Review &amp; assessment"]
  node_reviewer["Approval gate<br/>interactive review<br/>[reviewer.py]"]
  node_llm_client["Assessment client<br/>LLM orchestration<br/>[client.py]"]
  node_llm_provider["Model providers<br/>provider abstraction<br/>[provider.py]"]
  node_prompts["Assessment prompts<br/>prompt templates<br/>[prompts.py]"]
  node_anthropic{{"Anthropic Claude<br/>external LLM API"}}
  node_assessment_model["Assessment records<br/>domain model<br/>[assessment.py]"]
end

subgraph group_data["Data lifecycle"]
  node_assessment_store["Assessment store<br/>persistence service"]
  node_database[("SQLite database<br/>local persistent store<br/>[db.py]")]
  node_queries["Search queries<br/>FTS5 query layer<br/>[queries.py]"]
  node_export["Markdown export<br/>report output<br/>[export.py]"]
  node_integrity["Data integrity lifecycle<br/>inspection, purge, export<br/>[inspector.py]"]
end

subgraph group_ui["Interfaces"]
  node_cli["CLI orchestrator<br/>Python entry point<br/>[cli.py]"]
  node_tui["Interactive dashboard<br/>terminal UI<br/>[dashboard.py]"]
  node_ui_state["Workflow UI state<br/>[state.py]"]
  node_ui_panels["Phase progress panels<br/>terminal UI panels<br/>[crawl_panel.py]"]
end

node_cli -->|"loads"| node_company_config
node_company_config -->|"validated by"| node_config_models
node_config_models -->|"company sources"| node_crawler
node_crawler -->|"uses"| node_selectors
node_crawler -->|"raw postings"| node_job_model
node_job_model -->|"raw HTML"| node_html_cleaner
node_html_cleaner -->|"clean text"| node_preprocessor
node_preprocessor -->|"chunks"| node_token_counter
node_token_counter -->|"token and cost inputs"| node_reviewer
node_reviewer -->|"approved jobs and CV"| node_llm_client
node_llm_client -->|"selects"| node_llm_provider
node_llm_client -->|"uses"| node_prompts
node_llm_provider -->|"API request"| node_anthropic
node_anthropic -->|"structured result"| node_assessment_model
node_assessment_model -->|"persists"| node_assessment_store
node_assessment_store -->|"reads and writes"| node_database
node_queries -->|"FTS5 search"| node_database
node_assessment_store -->|"report data"| node_export
node_integrity -->|"inspect and retain"| node_database
node_cli -.->|"interactive terminals"| node_tui
node_tui -->|"manages"| node_ui_state
node_tui -->|"renders"| node_ui_panels
node_ui_state -.->|"review workflow"| node_reviewer
node_ui_panels -.->|"crawl progress"| node_crawler
node_ui_panels -.->|"assessment cost"| node_llm_client

click node_cli "https://github.com/pluto-atom-4/ats-showcase/blob/main/src/cli.py"
click node_tui "https://github.com/pluto-atom-4/ats-showcase/blob/main/src/tui/dashboard.py"
click node_ui_state "https://github.com/pluto-atom-4/ats-showcase/blob/main/src/tui/models/state.py"
click node_ui_panels "https://github.com/pluto-atom-4/ats-showcase/blob/main/src/tui/panels/crawl_panel.py"
click node_company_config "https://github.com/pluto-atom-4/ats-showcase/blob/main/config/companies.json"
click node_config_models "https://github.com/pluto-atom-4/ats-showcase/blob/main/src/config/models.py"
click node_crawler "https://github.com/pluto-atom-4/ats-showcase/blob/main/src/browser/crawler.py"
click node_selectors "https://github.com/pluto-atom-4/ats-showcase/blob/main/src/browser/selectors.py"
click node_job_model "https://github.com/pluto-atom-4/ats-showcase/blob/main/src/models/job.py"
click node_html_cleaner "https://github.com/pluto-atom-4/ats-showcase/blob/main/src/parsers/html_cleaner.py"
click node_preprocessor "https://github.com/pluto-atom-4/ats-showcase/blob/main/src/tokenization/preprocessor.py"
click node_token_counter "https://github.com/pluto-atom-4/ats-showcase/blob/main/src/tokenization/counter.py"
click node_reviewer "https://github.com/pluto-atom-4/ats-showcase/blob/main/src/verification/reviewer.py"
click node_llm_client "https://github.com/pluto-atom-4/ats-showcase/blob/main/src/llm/client.py"
click node_llm_provider "https://github.com/pluto-atom-4/ats-showcase/blob/main/src/llm/provider.py"
click node_prompts "https://github.com/pluto-atom-4/ats-showcase/blob/main/src/llm/prompts.py"
click node_assessment_model "https://github.com/pluto-atom-4/ats-showcase/blob/main/src/models/assessment.py"
click node_assessment_store "https://github.com/pluto-atom-4/ats-showcase/blob/main/src/storage/assessment_store.py"
click node_database "https://github.com/pluto-atom-4/ats-showcase/blob/main/src/storage/db.py"
click node_queries "https://github.com/pluto-atom-4/ats-showcase/blob/main/src/storage/queries.py"
click node_export "https://github.com/pluto-atom-4/ats-showcase/blob/main/src/storage/export.py"
click node_integrity "https://github.com/pluto-atom-4/ats-showcase/blob/main/src/integrity/inspector.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_company_config,node_config_models,node_crawler,node_selectors,node_job_model,node_html_cleaner,node_preprocessor,node_token_counter toneBlue
class node_reviewer,node_llm_client,node_llm_provider,node_prompts,node_anthropic,node_assessment_model toneAmber
class node_assessment_store,node_database,node_queries,node_export,node_integrity toneMint
class node_cli,node_tui,node_ui_state,node_ui_panels toneRose
```

## Components

### Ingest & preparation

- [Company configuration](https://github.com/pluto-atom-4/ats-showcase/blob/main/config/companies.json): JSON source config · `config/companies.json`
- [Configuration models](https://github.com/pluto-atom-4/ats-showcase/blob/main/src/config/models.py): validated config · `src/config/models.py`
- [Playwright crawler](https://github.com/pluto-atom-4/ats-showcase/blob/main/src/browser/crawler.py): browser boundary · Renders sites, extracts postings, and applies retries and rate control. · `src/browser/crawler.py`
- [Site selectors](https://github.com/pluto-atom-4/ats-showcase/blob/main/src/browser/selectors.py): CSS extraction rules · `src/browser/selectors.py`
- [Job records](https://github.com/pluto-atom-4/ats-showcase/blob/main/src/models/job.py): domain model · Normalizes external posting data for downstream stages. · `src/models/job.py`
- [HTML cleaner](https://github.com/pluto-atom-4/ats-showcase/blob/main/src/parsers/html_cleaner.py): text extraction · Uses MarkItDown with an HTML-parser fallback. · `src/parsers/html_cleaner.py`
- [Semantic preprocessor](https://github.com/pluto-atom-4/ats-showcase/blob/main/src/tokenization/preprocessor.py): spaCy cleanup and chunking · `src/tokenization/preprocessor.py`
- [Token counter](https://github.com/pluto-atom-4/ats-showcase/blob/main/src/tokenization/counter.py): tiktoken cost input · `src/tokenization/counter.py`

### Review & assessment

- [Approval gate](https://github.com/pluto-atom-4/ats-showcase/blob/main/src/verification/reviewer.py): interactive review · Approves, edits, or rejects reduced jobs before paid assessment. · `src/verification/reviewer.py`
- [Assessment client](https://github.com/pluto-atom-4/ats-showcase/blob/main/src/llm/client.py): LLM orchestration · Sends approved jobs and CV content for structured fit assessment. · `src/llm/client.py`
- [Model providers](https://github.com/pluto-atom-4/ats-showcase/blob/main/src/llm/provider.py): provider abstraction · `src/llm/provider.py`
- [Assessment prompts](https://github.com/pluto-atom-4/ats-showcase/blob/main/src/llm/prompts.py): prompt templates · `src/llm/prompts.py`
- **Anthropic Claude**: external LLM API · Haiku, Sonnet, or Opus assessment boundary.
- [Assessment records](https://github.com/pluto-atom-4/ats-showcase/blob/main/src/models/assessment.py): domain model · Structured scores, recommendations, usage, and cost. · `src/models/assessment.py`

### Data lifecycle

- [Assessment store](https://github.com/pluto-atom-4/ats-showcase/blob/main/src/storage/assessment_store.py): persistence service · `src/storage/assessment_store.py`
- [SQLite database](https://github.com/pluto-atom-4/ats-showcase/blob/main/src/storage/db.py): local persistent store · Stores assessment data and FTS5 search indexes. · `src/storage/db.py`
- [Search queries](https://github.com/pluto-atom-4/ats-showcase/blob/main/src/storage/queries.py): FTS5 query layer · `src/storage/queries.py`
- [Markdown export](https://github.com/pluto-atom-4/ats-showcase/blob/main/src/storage/export.py): report output · `src/storage/export.py`
- [Data integrity lifecycle](https://github.com/pluto-atom-4/ats-showcase/blob/main/src/integrity/inspector.py): inspection, purge, export · Provides health reporting and confirmed retention operations. · `src/integrity/inspector.py`

### Interfaces

- [CLI orchestrator](https://github.com/pluto-atom-4/ats-showcase/blob/main/src/cli.py): Python entry point · Runs individual phases or the end-to-end pipeline. · `src/cli.py`
- [Interactive dashboard](https://github.com/pluto-atom-4/ats-showcase/blob/main/src/tui/dashboard.py): terminal UI · `src/tui/dashboard.py`
- [Workflow UI state](https://github.com/pluto-atom-4/ats-showcase/blob/main/src/tui/models/state.py): UI state · `src/tui/models/state.py`
- [Phase progress panels](https://github.com/pluto-atom-4/ats-showcase/blob/main/src/tui/panels/crawl_panel.py): terminal UI panels · Show crawl and assessment progress without pipeline ownership. · `src/tui/panels/crawl_panel.py`

## Connections

- CLI orchestrator → Company configuration: loads
- Company configuration → Configuration models: validated by
- Configuration models → Playwright crawler: company sources
- Playwright crawler → Site selectors: uses
- Playwright crawler → Job records: raw postings
- Job records → HTML cleaner: raw HTML
- HTML cleaner → Semantic preprocessor: clean text
- Semantic preprocessor → Token counter: chunks
- Token counter → Approval gate: token and cost inputs
- Approval gate → Assessment client: approved jobs and CV
- Assessment client → Model providers: selects
- Assessment client → Assessment prompts: uses
- Model providers → Anthropic Claude: API request
- Anthropic Claude → Assessment records: structured result
- Assessment records → Assessment store: persists
- Assessment store → SQLite database: reads and writes
- Search queries → SQLite database: FTS5 search
- Assessment store → Markdown export: report data
- Data integrity lifecycle → SQLite database: inspect and retain
- CLI orchestrator → Interactive dashboard: interactive terminals
- Interactive dashboard → Workflow UI state: manages
- Interactive dashboard → Phase progress panels: renders
- Workflow UI state → Approval gate: review workflow
- Phase progress panels → Playwright crawler: crawl progress
- Phase progress panels → Assessment client: assessment cost
