# naturalmoods/zajszuro architecture

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

- Interactive diagram: https://gitdiagram.com/naturalmoods/zajszuro
- Repository: https://github.com/naturalmoods/zajszuro

## Overview

Zajszűrő is a Chrome extension that finds news headlines, scores them with TypeSafe’s Jev model, and presents scoring and interest-based filtering in a browser panel. Its main workflow runs from page or icon activation, through headline discovery and background scoring, to results shown on the page. The README also documents selection scoring, topic filters, speed and cost reporting, and dynamic headline handling. The sampled files show the content/background messaging and scoring/API path; some UI behavior and integrations are documented rather than fully sampled.

Main entry points: [`src/background.js`](https://github.com/naturalmoods/zajszuro/blob/main/src/background.js) (Run coordinator), [`src/content.js`](https://github.com/naturalmoods/zajszuro/blob/main/src/content.js) (Results panel), [`options.js`](https://github.com/naturalmoods/zajszuro/blob/main/options.js) (Settings page), [`src/scorers.js`](https://github.com/naturalmoods/zajszuro/blob/main/src/scorers.js) (Scoring prompts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_page["Page experience"]
  node_news_page["News page"]
  node_headline_discovery["Headline discovery<br/>[content.js]"]
  node_panel["Results panel<br/>[content.js]"]
  node_score_view["Clickbait view<br/>[content.js]"]
  node_interest_topics["Interest and topics<br/>[content.js]"]
  node_speed_view["Speed and costs<br/>[content.js]"]
end

subgraph group_processing["Scoring pipeline"]
  node_background["Run coordinator<br/>[background.js]"]
  node_cache[("Score cache<br/>[background.js]")]
  node_scoring["Scoring prompts<br/>[scorers.js]"]
  node_selection_score["Selection scoring<br/>[background.js]"]
end

subgraph group_configuration["Settings"]
  node_settings_ui["Settings page<br/>[options.js]"]
  node_defaults["Default settings<br/>[settings.js]"]
end

subgraph group_platform["Browser and service"]
  node_jev{{"TypeSafe Jev"}}
  node_browser_storage[("Browser storage")]
  node_extension(("Chrome extension"))
end

node_reader(("Reader"))

node_reader -->|"opens"| node_news_page
node_reader -->|"clicks icon"| node_extension
node_extension -->|"activates"| node_headline_discovery
node_news_page -->|"provides links"| node_headline_discovery
node_headline_discovery -->|"displays headlines"| node_panel
node_headline_discovery -->|"sends scoring run"| node_background
node_background -->|"calls scorers"| node_scoring
node_scoring -->|"posts questions"| node_jev
node_background -->|"reads and writes"| node_cache
node_cache -->|"persists results"| node_browser_storage
node_background -->|"loads settings"| node_browser_storage
node_panel -->|"shows scores"| node_score_view
node_panel -->|"offers filters"| node_interest_topics
node_interest_topics -->|"requests interest match"| node_background
node_panel -->|"shows run metrics"| node_speed_view
node_reader -->|"configures extension"| node_settings_ui
node_settings_ui -->|"uses defaults"| node_defaults
node_settings_ui -->|"loads and saves"| node_browser_storage
node_extension -->|"handles context action"| node_selection_score
node_selection_score -->|"calls scorer"| node_scoring
node_selection_score -->|"shows result toast"| node_news_page

click node_headline_discovery "https://github.com/naturalmoods/zajszuro/blob/main/src/content.js"
click node_panel "https://github.com/naturalmoods/zajszuro/blob/main/src/content.js"
click node_score_view "https://github.com/naturalmoods/zajszuro/blob/main/src/content.js"
click node_interest_topics "https://github.com/naturalmoods/zajszuro/blob/main/src/content.js"
click node_speed_view "https://github.com/naturalmoods/zajszuro/blob/main/src/content.js"
click node_background "https://github.com/naturalmoods/zajszuro/blob/main/src/background.js"
click node_cache "https://github.com/naturalmoods/zajszuro/blob/main/src/background.js"
click node_scoring "https://github.com/naturalmoods/zajszuro/blob/main/src/scorers.js"
click node_selection_score "https://github.com/naturalmoods/zajszuro/blob/main/src/background.js"
click node_settings_ui "https://github.com/naturalmoods/zajszuro/blob/main/options.js"
click node_defaults "https://github.com/naturalmoods/zajszuro/blob/main/src/settings.js"

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_news_page,node_headline_discovery,node_panel,node_score_view,node_interest_topics,node_speed_view toneBlue
class node_background,node_cache,node_scoring,node_selection_score toneAmber
class node_settings_ui,node_defaults toneMint
class node_jev,node_browser_storage,node_extension toneRose
class node_reader toneIndigo
```

## Components

### Page experience

- **News page**
- [Headline discovery](https://github.com/naturalmoods/zajszuro/blob/main/src/content.js): `src/content.js`
- [Results panel](https://github.com/naturalmoods/zajszuro/blob/main/src/content.js): `src/content.js`
- [Clickbait view](https://github.com/naturalmoods/zajszuro/blob/main/src/content.js): `src/content.js`
- [Interest and topics](https://github.com/naturalmoods/zajszuro/blob/main/src/content.js): `src/content.js`
- [Speed and costs](https://github.com/naturalmoods/zajszuro/blob/main/src/content.js): `src/content.js`

### Scoring pipeline

- [Run coordinator](https://github.com/naturalmoods/zajszuro/blob/main/src/background.js): `src/background.js`
- [Score cache](https://github.com/naturalmoods/zajszuro/blob/main/src/background.js): `src/background.js`
- [Scoring prompts](https://github.com/naturalmoods/zajszuro/blob/main/src/scorers.js): `src/scorers.js`
- [Selection scoring](https://github.com/naturalmoods/zajszuro/blob/main/src/background.js): `src/background.js`

### Settings

- [Settings page](https://github.com/naturalmoods/zajszuro/blob/main/options.js): `options.js`
- [Default settings](https://github.com/naturalmoods/zajszuro/blob/main/src/settings.js): `src/settings.js`

### Browser and service

- **TypeSafe Jev**
- **Browser storage**
- **Chrome extension**

### Other components

- **Reader**

## Connections

- Reader → News page: opens (evidence: `README.md`)
- Reader → Chrome extension: clicks icon (evidence: `README.md`)
- Chrome extension → Headline discovery: activates (evidence: `README.md`)
- News page → Headline discovery: provides links (evidence: `README.md`)
- Headline discovery → Results panel: displays headlines (evidence: `src/content.js`)
- Headline discovery → Run coordinator: sends scoring run (evidence: `src/content.js`)
- Run coordinator → Scoring prompts: calls scorers (evidence: `src/background.js`)
- Scoring prompts → TypeSafe Jev: posts questions (evidence: `src/scorers.js`)
- Run coordinator → Score cache: reads and writes (evidence: `src/background.js`)
- Score cache → Browser storage: persists results (evidence: `src/background.js`)
- Run coordinator → Browser storage: loads settings (evidence: `src/background.js`)
- Results panel → Clickbait view: shows scores (evidence: `README.md`)
- Results panel → Interest and topics: offers filters (evidence: `README.md`)
- Interest and topics → Run coordinator: requests interest match (evidence: `src/background.js`)
- Results panel → Speed and costs: shows run metrics (evidence: `README.md`)
- Reader → Settings page: configures extension (evidence: `README.md`)
- Settings page → Default settings: uses defaults (evidence: `options.js`)
- Settings page → Browser storage: loads and saves (evidence: `options.js`)
- Chrome extension → Selection scoring: handles context action (evidence: `README.md`)
- Selection scoring → Scoring prompts: calls scorer (evidence: `src/background.js`)
- Selection scoring → News page: shows result toast (evidence: `README.md`)
