# ssaillesh/news_engine architecture

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

- Interactive diagram: https://gitdiagram.com/ssaillesh/news_engine
- Repository: https://github.com/ssaillesh/news_engine

## Overview

Trump News Archive captures public government and syndication records into a normalized archive, then provides offline enrichment and a searchable dashboard/API. CLI commands initiate ingest, analysis, and serving; source modules fetch and normalize records, while shared HTTP and storage layers support those workflows. README capabilities guide inclusion of unsampled source adapters and summarization; their internal call links are omitted where source was not shown.

Main entry points: [`src/archiver/cli.py`](https://github.com/ssaillesh/news_engine/blob/main/src/archiver/cli.py) (Archiver CLI), [`src/archiver/sources/publishers.py`](https://github.com/ssaillesh/news_engine/blob/main/src/archiver/sources/publishers.py) (Publisher RSS), [`src/archiver/storage/repositories.py`](https://github.com/ssaillesh/news_engine/blob/main/src/archiver/storage/repositories.py) (Repositories), [`src/archiver/sources/federal_register.py`](https://github.com/ssaillesh/news_engine/blob/main/src/archiver/sources/federal_register.py) (Federal Register)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Source capture"]
  node_fedreg["Federal Register"]
  node_cpd["Presidential documents"]
  node_whitehouse["White House RSS<br/>[white_house.py]"]
  node_google["Google News RSS<br/>[trump_news.py]"]
  node_publishers["Publisher RSS<br/>[publishers.py]"]
end

subgraph group_core["Archive core"]
  node_http["HTTP client<br/>[base.py]"]
  node_limiter["Rate limiter<br/>[rate_limit.py]"]
  node_rss["RSS parsing<br/>[rss.py]"]
  node_text["Text parsing<br/>[text.py]"]
  node_hash["Content hashing<br/>[hashing.py]"]
  node_db["Database sessions<br/>[db.py]"]
  node_models[("Archive schema<br/>[models.py]")]
  node_repos["Repositories<br/>[repositories.py]"]
end

subgraph group_enrich["Analysis and briefings"]
  node_classify["Story classification<br/>[classify.py]"]
  node_signals["Impact signals<br/>[signals.py]"]
  node_sentiment["Sentiment scoring<br/>[pipeline.py]"]
  node_summarize["AI summarization<br/>[pipeline.py]"]
  node_briefing["Story briefings<br/>[generator.py]"]
end

subgraph group_access["Reader access"]
  node_cli["Archiver CLI<br/>[cli.py]"]
  node_web["Dashboard and API<br/>[app.py]"]
  node_page["Dashboard page<br/>[page.py]"]
end

node_researcher(("Researcher"))
node_analyst["Analysis provider"]

node_researcher -->|"runs commands"| node_cli
node_cli -->|"starts ingest"| node_fedreg
node_cli -->|"starts ingest"| node_cpd
node_cli -->|"starts ingest"| node_whitehouse
node_cli -->|"starts ingest"| node_google
node_cli -->|"starts ingest"| node_publishers
node_fedreg -->|"fetches records"| node_http
node_fedreg -->|"extracts body"| node_text
node_fedreg -->|"hashes content"| node_hash
node_fedreg -->|"upserts records"| node_repos
node_whitehouse -->|"fetches feed"| node_http
node_whitehouse -->|"parses feed"| node_rss
node_whitehouse -->|"cleans text"| node_text
node_whitehouse -->|"upserts records"| node_repos
node_publishers -->|"fetches feeds"| node_http
node_publishers -->|"parses feeds"| node_rss
node_publishers -->|"cleans text"| node_text
node_publishers -->|"hashes content"| node_hash
node_publishers -->|"upserts records"| node_repos
node_http -->|"paces requests"| node_limiter
node_repos -->|"writes archive"| node_models
node_db -->|"creates schema"| node_models
node_cli -->|"starts scoring"| node_sentiment
node_cli -->|"starts summarization"| node_summarize
node_sentiment -->|"reads statuses"| node_db
node_sentiment -->|"stores readings"| node_repos
node_summarize -->|"reads statuses"| node_db
node_summarize -->|"stores summaries"| node_repos
node_cli -->|"starts classification"| node_classify
node_classify -->|"uses signals"| node_signals
node_researcher -->|"browses archive"| node_web
node_web -->|"renders dashboard"| node_page
node_web -->|"queries archive"| node_db
node_web -->|"requests analysis"| node_briefing
node_briefing -.->|"requests generation"| node_analyst

click node_cli "https://github.com/ssaillesh/news_engine/blob/main/src/archiver/cli.py"
click node_fedreg "https://github.com/ssaillesh/news_engine/blob/main/src/archiver/sources/federal_register.py"
click node_cpd "https://github.com/ssaillesh/news_engine/blob/main/src/archiver/sources/presidential_documents.py"
click node_whitehouse "https://github.com/ssaillesh/news_engine/blob/main/src/archiver/sources/white_house.py"
click node_google "https://github.com/ssaillesh/news_engine/blob/main/src/archiver/sources/trump_news.py"
click node_publishers "https://github.com/ssaillesh/news_engine/blob/main/src/archiver/sources/publishers.py"
click node_http "https://github.com/ssaillesh/news_engine/blob/main/src/archiver/clients/base.py"
click node_limiter "https://github.com/ssaillesh/news_engine/blob/main/src/archiver/clients/rate_limit.py"
click node_rss "https://github.com/ssaillesh/news_engine/blob/main/src/archiver/parsing/rss.py"
click node_text "https://github.com/ssaillesh/news_engine/blob/main/src/archiver/parsing/text.py"
click node_hash "https://github.com/ssaillesh/news_engine/blob/main/src/archiver/domain/hashing.py"
click node_db "https://github.com/ssaillesh/news_engine/blob/main/src/archiver/storage/db.py"
click node_models "https://github.com/ssaillesh/news_engine/blob/main/src/archiver/storage/models.py"
click node_repos "https://github.com/ssaillesh/news_engine/blob/main/src/archiver/storage/repositories.py"
click node_classify "https://github.com/ssaillesh/news_engine/blob/main/src/archiver/analysis/classify.py"
click node_signals "https://github.com/ssaillesh/news_engine/blob/main/src/archiver/analysis/signals.py"
click node_sentiment "https://github.com/ssaillesh/news_engine/blob/main/src/archiver/analysis/pipeline.py"
click node_summarize "https://github.com/ssaillesh/news_engine/blob/main/src/archiver/analysis/pipeline.py"
click node_briefing "https://github.com/ssaillesh/news_engine/blob/main/src/archiver/briefings/generator.py"
click node_web "https://github.com/ssaillesh/news_engine/blob/main/src/archiver/web/app.py"
click node_page "https://github.com/ssaillesh/news_engine/blob/main/src/archiver/web/page.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_fedreg,node_cpd,node_whitehouse,node_google,node_publishers toneBlue
class node_http,node_limiter,node_rss,node_text,node_hash,node_db,node_models,node_repos toneAmber
class node_classify,node_signals,node_sentiment,node_summarize,node_briefing toneMint
class node_cli,node_web,node_page toneRose
class node_researcher,node_analyst toneIndigo
```

## Components

### Source capture

- [Federal Register](https://github.com/ssaillesh/news_engine/blob/main/src/archiver/sources/federal_register.py): `src/archiver/sources/federal_register.py`
- [Presidential documents](https://github.com/ssaillesh/news_engine/blob/main/src/archiver/sources/presidential_documents.py): `src/archiver/sources/presidential_documents.py`
- [White House RSS](https://github.com/ssaillesh/news_engine/blob/main/src/archiver/sources/white_house.py): `src/archiver/sources/white_house.py`
- [Google News RSS](https://github.com/ssaillesh/news_engine/blob/main/src/archiver/sources/trump_news.py): `src/archiver/sources/trump_news.py`
- [Publisher RSS](https://github.com/ssaillesh/news_engine/blob/main/src/archiver/sources/publishers.py): `src/archiver/sources/publishers.py`

### Archive core

- [HTTP client](https://github.com/ssaillesh/news_engine/blob/main/src/archiver/clients/base.py): `src/archiver/clients/base.py`
- [Rate limiter](https://github.com/ssaillesh/news_engine/blob/main/src/archiver/clients/rate_limit.py): `src/archiver/clients/rate_limit.py`
- [RSS parsing](https://github.com/ssaillesh/news_engine/blob/main/src/archiver/parsing/rss.py): `src/archiver/parsing/rss.py`
- [Text parsing](https://github.com/ssaillesh/news_engine/blob/main/src/archiver/parsing/text.py): `src/archiver/parsing/text.py`
- [Content hashing](https://github.com/ssaillesh/news_engine/blob/main/src/archiver/domain/hashing.py): `src/archiver/domain/hashing.py`
- [Database sessions](https://github.com/ssaillesh/news_engine/blob/main/src/archiver/storage/db.py): `src/archiver/storage/db.py`
- [Archive schema](https://github.com/ssaillesh/news_engine/blob/main/src/archiver/storage/models.py): `src/archiver/storage/models.py`
- [Repositories](https://github.com/ssaillesh/news_engine/blob/main/src/archiver/storage/repositories.py): `src/archiver/storage/repositories.py`

### Analysis and briefings

- [Story classification](https://github.com/ssaillesh/news_engine/blob/main/src/archiver/analysis/classify.py): `src/archiver/analysis/classify.py`
- [Impact signals](https://github.com/ssaillesh/news_engine/blob/main/src/archiver/analysis/signals.py): `src/archiver/analysis/signals.py`
- [Sentiment scoring](https://github.com/ssaillesh/news_engine/blob/main/src/archiver/analysis/pipeline.py): `src/archiver/analysis/pipeline.py`
- [AI summarization](https://github.com/ssaillesh/news_engine/blob/main/src/archiver/analysis/pipeline.py): `src/archiver/analysis/pipeline.py`
- [Story briefings](https://github.com/ssaillesh/news_engine/blob/main/src/archiver/briefings/generator.py): `src/archiver/briefings/generator.py`

### Reader access

- [Archiver CLI](https://github.com/ssaillesh/news_engine/blob/main/src/archiver/cli.py): `src/archiver/cli.py`
- [Dashboard and API](https://github.com/ssaillesh/news_engine/blob/main/src/archiver/web/app.py): `src/archiver/web/app.py`
- [Dashboard page](https://github.com/ssaillesh/news_engine/blob/main/src/archiver/web/page.py): `src/archiver/web/page.py`

### Other components

- **Researcher**
- **Analysis provider**

## Connections

- Researcher → Archiver CLI: runs commands (evidence: `README.md`)
- Archiver CLI → Federal Register: starts ingest (evidence: `src/archiver/cli.py`)
- Archiver CLI → Presidential documents: starts ingest (evidence: `src/archiver/cli.py`)
- Archiver CLI → White House RSS: starts ingest (evidence: `src/archiver/cli.py`)
- Archiver CLI → Google News RSS: starts ingest (evidence: `src/archiver/cli.py`)
- Archiver CLI → Publisher RSS: starts ingest (evidence: `src/archiver/cli.py`)
- Federal Register → HTTP client: fetches records (evidence: `src/archiver/sources/federal_register.py`)
- Federal Register → Text parsing: extracts body (evidence: `src/archiver/sources/federal_register.py`)
- Federal Register → Content hashing: hashes content (evidence: `src/archiver/sources/federal_register.py`)
- Federal Register → Repositories: upserts records (evidence: `src/archiver/sources/federal_register.py`)
- White House RSS → HTTP client: fetches feed (evidence: `src/archiver/sources/white_house.py`)
- White House RSS → RSS parsing: parses feed (evidence: `src/archiver/sources/white_house.py`)
- White House RSS → Text parsing: cleans text (evidence: `src/archiver/sources/white_house.py`)
- White House RSS → Repositories: upserts records (evidence: `src/archiver/sources/white_house.py`)
- Publisher RSS → HTTP client: fetches feeds (evidence: `src/archiver/sources/publishers.py`)
- Publisher RSS → RSS parsing: parses feeds (evidence: `src/archiver/sources/publishers.py`)
- Publisher RSS → Text parsing: cleans text (evidence: `src/archiver/sources/publishers.py`)
- Publisher RSS → Content hashing: hashes content (evidence: `src/archiver/sources/publishers.py`)
- Publisher RSS → Repositories: upserts records (evidence: `src/archiver/sources/publishers.py`)
- HTTP client → Rate limiter: paces requests (evidence: `src/archiver/clients/base.py`)
- Repositories → Archive schema: writes archive (evidence: `src/archiver/storage/repositories.py`)
- Database sessions → Archive schema: creates schema (evidence: `src/archiver/storage/db.py`)
- Archiver CLI → Sentiment scoring: starts scoring (evidence: `src/archiver/cli.py`)
- Archiver CLI → AI summarization: starts summarization (evidence: `src/archiver/cli.py`)
- Sentiment scoring → Database sessions: reads statuses (evidence: `src/archiver/analysis/pipeline.py`)
- Sentiment scoring → Repositories: stores readings (evidence: `src/archiver/analysis/pipeline.py`)
- AI summarization → Database sessions: reads statuses (evidence: `src/archiver/analysis/pipeline.py`)
- AI summarization → Repositories: stores summaries (evidence: `src/archiver/analysis/pipeline.py`)
- Archiver CLI → Story classification: starts classification (evidence: `src/archiver/cli.py`)
- Story classification → Impact signals: uses signals (evidence: `src/archiver/analysis/classify.py`)
- Researcher → Dashboard and API: browses archive (evidence: `README.md`)
- Dashboard and API → Dashboard page: renders dashboard (evidence: `src/archiver/web/app.py`)
- Dashboard and API → Database sessions: queries archive (evidence: `src/archiver/web/app.py`)
- Dashboard and API → Story briefings: requests analysis (evidence: `src/archiver/web/app.py`)
- Story briefings → Analysis provider: requests generation (evidence: `README.md`)
