# jspear01/milemoa-intelligence architecture

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

- Interactive diagram: https://gitdiagram.com/jspear01/milemoa-intelligence
- Repository: https://github.com/jspear01/milemoa-intelligence

## Overview

MileMoa Insight is a community-intelligence dashboard: users browse recent MileMoa posts, summaries, importance scores, and actionable deals. The main workflow syncs listings and post details, stores posts, then scores and summarizes unsummarized records for dashboard queries and filtering. CLI and dashboard controls invoke the pipeline; checkpoints support resumption. The README also documents scheduled GitHub Actions updates. Edges are limited to calls, storage access, external fetching, or README-documented behavior; unsampled workflow details are omitted.

Main entry points: [`pipeline/summarizer.py`](https://github.com/jspear01/milemoa-intelligence/blob/main/pipeline/summarizer.py) (Batch summarizer), [`pipeline/scraper.py`](https://github.com/jspear01/milemoa-intelligence/blob/main/pipeline/scraper.py) (Incremental scraper), [`ui/app.py`](https://github.com/jspear01/milemoa-intelligence/blob/main/ui/app.py) (Streamlit dashboard), [`core/harness.py`](https://github.com/jspear01/milemoa-intelligence/blob/main/core/harness.py) (Pipeline harness)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry points"]
  node_scheduled["Scheduled sync<br/>[scrape.yml]"]
  node_cli["CLI commands<br/>[run.py]"]
  node_harness["Pipeline harness<br/>[harness.py]"]
  node_config["Pipeline configuration<br/>[config.py]"]
end

subgraph group_collection["Post collection"]
  node_scraper["Incremental scraper<br/>[scraper.py]"]
  node_http["HTTP fetch client<br/>[scraper.py]"]
  node_listing["Listing parser<br/>[scraper.py]"]
end

subgraph group_analysis["Scoring and summaries"]
  node_summarizer["Batch summarizer<br/>[summarizer.py]"]
  node_scoring["Importance scoring<br/>[summarizer.py]"]
  node_classification["Category and deal detection<br/>[summarizer.py]"]
  node_extraction["Key sentence extraction<br/>[summarizer.py]"]
end

subgraph group_state["Persistence and status"]
  node_posts[("Post database<br/>[milemoa.db]")]
  node_summaries[("Summary records<br/>[milemoa.db]")]
  node_checkpoint["Checkpoint state<br/>[checkpoint.py]"]
  node_checkpointfile["Checkpoint file<br/>[checkpoint.json]"]
  node_statusfile["Status report<br/>[STATUS.md]"]
end

subgraph group_presentation["Dashboard"]
  node_dashboard["Streamlit dashboard<br/>[app.py]"]
end

node_user(("Community reader"))
node_milemoa["MileMoa board"]

node_user -->|"browses"| node_dashboard
node_dashboard -->|"starts sync"| node_cli
node_cli -->|"dispatches"| node_harness
node_scheduled -.->|"runs sync"| node_harness
node_harness -->|"invokes"| node_scraper
node_harness -->|"invokes"| node_summarizer
node_scraper -->|"fetches pages"| node_http
node_http -->|"requests HTML"| node_milemoa
node_scraper -->|"parses listings"| node_listing
node_scraper -->|"writes posts"| node_posts
node_summarizer -->|"reads posts"| node_posts
node_summarizer -->|"scores posts"| node_scoring
node_summarizer -->|"classifies deals"| node_classification
node_summarizer -->|"extracts takeaways"| node_extraction
node_summarizer -->|"writes summaries"| node_summaries
node_dashboard -->|"queries posts"| node_posts
node_dashboard -->|"queries summaries"| node_summaries
node_harness -->|"loads and saves"| node_checkpoint
node_dashboard -->|"loads status"| node_checkpoint
node_checkpoint -->|"persists state"| node_checkpointfile
node_checkpoint -->|"writes report"| node_statusfile
node_scraper -->|"uses settings"| node_config
node_summarizer -->|"uses rules"| node_config

click node_scheduled "https://github.com/jspear01/milemoa-intelligence/blob/main/.github/workflows/scrape.yml"
click node_cli "https://github.com/jspear01/milemoa-intelligence/blob/main/run.py"
click node_dashboard "https://github.com/jspear01/milemoa-intelligence/blob/main/ui/app.py"
click node_harness "https://github.com/jspear01/milemoa-intelligence/blob/main/core/harness.py"
click node_scraper "https://github.com/jspear01/milemoa-intelligence/blob/main/pipeline/scraper.py"
click node_http "https://github.com/jspear01/milemoa-intelligence/blob/main/pipeline/scraper.py"
click node_listing "https://github.com/jspear01/milemoa-intelligence/blob/main/pipeline/scraper.py"
click node_posts "https://github.com/jspear01/milemoa-intelligence/blob/main/data/milemoa.db"
click node_summarizer "https://github.com/jspear01/milemoa-intelligence/blob/main/pipeline/summarizer.py"
click node_scoring "https://github.com/jspear01/milemoa-intelligence/blob/main/pipeline/summarizer.py"
click node_classification "https://github.com/jspear01/milemoa-intelligence/blob/main/pipeline/summarizer.py"
click node_extraction "https://github.com/jspear01/milemoa-intelligence/blob/main/pipeline/summarizer.py"
click node_summaries "https://github.com/jspear01/milemoa-intelligence/blob/main/data/milemoa.db"
click node_checkpoint "https://github.com/jspear01/milemoa-intelligence/blob/main/core/checkpoint.py"
click node_checkpointfile "https://github.com/jspear01/milemoa-intelligence/blob/main/.state/checkpoint.json"
click node_statusfile "https://github.com/jspear01/milemoa-intelligence/blob/main/STATUS.md"
click node_config "https://github.com/jspear01/milemoa-intelligence/blob/main/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_scheduled,node_cli,node_harness,node_config toneBlue
class node_scraper,node_http,node_listing toneAmber
class node_summarizer,node_scoring,node_classification,node_extraction toneMint
class node_posts,node_summaries,node_checkpoint,node_checkpointfile,node_statusfile toneRose
class node_dashboard,node_user,node_milemoa toneIndigo
```

## Components

### User entry points

- [Scheduled sync](https://github.com/jspear01/milemoa-intelligence/blob/main/.github/workflows/scrape.yml): `.github/workflows/scrape.yml`
- [CLI commands](https://github.com/jspear01/milemoa-intelligence/blob/main/run.py): `run.py`
- [Pipeline harness](https://github.com/jspear01/milemoa-intelligence/blob/main/core/harness.py): `core/harness.py`
- [Pipeline configuration](https://github.com/jspear01/milemoa-intelligence/blob/main/config.py): `config.py`

### Post collection

- [Incremental scraper](https://github.com/jspear01/milemoa-intelligence/blob/main/pipeline/scraper.py): `pipeline/scraper.py`
- [HTTP fetch client](https://github.com/jspear01/milemoa-intelligence/blob/main/pipeline/scraper.py): `pipeline/scraper.py`
- [Listing parser](https://github.com/jspear01/milemoa-intelligence/blob/main/pipeline/scraper.py): `pipeline/scraper.py`

### Scoring and summaries

- [Batch summarizer](https://github.com/jspear01/milemoa-intelligence/blob/main/pipeline/summarizer.py): `pipeline/summarizer.py`
- [Importance scoring](https://github.com/jspear01/milemoa-intelligence/blob/main/pipeline/summarizer.py): `pipeline/summarizer.py`
- [Category and deal detection](https://github.com/jspear01/milemoa-intelligence/blob/main/pipeline/summarizer.py): `pipeline/summarizer.py`
- [Key sentence extraction](https://github.com/jspear01/milemoa-intelligence/blob/main/pipeline/summarizer.py): `pipeline/summarizer.py`

### Persistence and status

- [Post database](https://github.com/jspear01/milemoa-intelligence/blob/main/data/milemoa.db): `data/milemoa.db`
- [Summary records](https://github.com/jspear01/milemoa-intelligence/blob/main/data/milemoa.db): `data/milemoa.db`
- [Checkpoint state](https://github.com/jspear01/milemoa-intelligence/blob/main/core/checkpoint.py): `core/checkpoint.py`
- [Checkpoint file](https://github.com/jspear01/milemoa-intelligence/blob/main/.state/checkpoint.json): `.state/checkpoint.json`
- [Status report](https://github.com/jspear01/milemoa-intelligence/blob/main/STATUS.md): `STATUS.md`

### Dashboard

- [Streamlit dashboard](https://github.com/jspear01/milemoa-intelligence/blob/main/ui/app.py): `ui/app.py`

### Other components

- **Community reader**
- **MileMoa board**

## Connections

- Community reader → Streamlit dashboard: browses (evidence: `README.md`)
- Streamlit dashboard → CLI commands: starts sync (evidence: `ui/app.py`)
- CLI commands → Pipeline harness: dispatches (evidence: `run.py`)
- Scheduled sync → Pipeline harness: runs sync (evidence: `README.md`)
- Pipeline harness → Incremental scraper: invokes (evidence: `core/harness.py`)
- Pipeline harness → Batch summarizer: invokes (evidence: `core/harness.py`)
- Incremental scraper → HTTP fetch client: fetches pages (evidence: `pipeline/scraper.py`)
- HTTP fetch client → MileMoa board: requests HTML (evidence: `pipeline/scraper.py`)
- Incremental scraper → Listing parser: parses listings (evidence: `pipeline/scraper.py`)
- Incremental scraper → Post database: writes posts (evidence: `pipeline/scraper.py`)
- Batch summarizer → Post database: reads posts (evidence: `pipeline/summarizer.py`)
- Batch summarizer → Importance scoring: scores posts (evidence: `pipeline/summarizer.py`)
- Batch summarizer → Category and deal detection: classifies deals (evidence: `pipeline/summarizer.py`)
- Batch summarizer → Key sentence extraction: extracts takeaways (evidence: `pipeline/summarizer.py`)
- Batch summarizer → Summary records: writes summaries (evidence: `pipeline/summarizer.py`)
- Streamlit dashboard → Post database: queries posts (evidence: `ui/app.py`)
- Streamlit dashboard → Summary records: queries summaries (evidence: `ui/app.py`)
- Pipeline harness → Checkpoint state: loads and saves (evidence: `core/harness.py`)
- Streamlit dashboard → Checkpoint state: loads status (evidence: `ui/app.py`)
- Checkpoint state → Checkpoint file: persists state (evidence: `core/checkpoint.py`)
- Checkpoint state → Status report: writes report (evidence: `core/checkpoint.py`)
- Incremental scraper → Pipeline configuration: uses settings (evidence: `pipeline/scraper.py`)
- Batch summarizer → Pipeline configuration: uses rules (evidence: `pipeline/summarizer.py`)
