# suryavamshikusam/warwatch architecture

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

- Interactive diagram: https://gitdiagram.com/suryavamshikusam/warwatch
- Repository: https://github.com/suryavamshikusam/warwatch

## Overview

WarWatch is a conflict-news monitoring dashboard with a parallel commodity and Indian-market tracker. The main workflow is the bot fetching and deduplicating RSS articles, then rebuilding dashboard data; a separate price fetch produces market data for the site. The dashboard also presents report-derived alerts, analysis, history, and India impacts. Source excerpts establish the bot’s calls and the data-generation steps, but do not show browser-side wiring for most pages. Email delivery is implemented separately; no caller was shown.

Main entry points: [`live_data.js`](https://github.com/suryavamshikusam/warwatch/blob/main/live_data.js) (Live dashboard data), [`bot.py`](https://github.com/suryavamshikusam/warwatch/blob/main/bot.py) (Monitor bot), [`prices_fetcher.py`](https://github.com/suryavamshikusam/warwatch/blob/main/prices_fetcher.py) (Price fetcher), [`dashboard.py`](https://github.com/suryavamshikusam/warwatch/blob/main/dashboard.py) (Dashboard builder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["News collection"]
  node_bot["Monitor bot<br/>[bot.py]"]
  node_scraper["RSS scraper<br/>[scraper.py]"]
  node_seen[("Seen URLs<br/>[seen_urls.json]")]
end

subgraph group_dashboard["Dashboard data"]
  node_dashboard_builder["Dashboard builder<br/>[dashboard.py]"]
  node_reports[("Report history")]
  node_live_data["Live dashboard data<br/>[live_data.js]"]
  node_emailer["Report emailer<br/>[emailer.py]"]
end

subgraph group_markets["Market tracking"]
  node_price_fetcher["Price fetcher<br/>[prices_fetcher.py]"]
  node_price_history[("Price history")]
  node_prices_data["Market data feed<br/>[prices_data.js]"]
end

subgraph group_presentation["Web experience"]
  node_home["Main dashboard<br/>[index.html]"]
  node_warwatch["WarWatch view<br/>[warwatch.html]"]
  node_india["India view<br/>[india.html]"]
  node_economy["Economy view<br/>[economy.html]"]
  node_history_view["History view<br/>[history.html]"]
  node_records["Records view<br/>[records.html]"]
  node_reports_view["Reports view<br/>[dashboard.html]"]
end

node_operator(("Operator"))
node_feeds["RSS feeds"]
node_gmail["Gmail SMTP"]
node_market_data["Yahoo market data"]

node_operator -->|"runs"| node_bot
node_bot -->|"fetches articles"| node_scraper
node_scraper -->|"fetches feeds"| node_feeds
node_bot -->|"reads and writes"| node_seen
node_bot -->|"invokes build"| node_dashboard_builder
node_dashboard_builder -->|"reads reports"| node_reports
node_dashboard_builder -->|"writes data"| node_live_data
node_bot -->|"invokes build"| node_price_fetcher
node_price_fetcher -->|"downloads prices"| node_market_data
node_price_fetcher -->|"updates history"| node_price_history
node_price_fetcher -->|"writes feed"| node_prices_data
node_emailer -->|"sends email"| node_gmail
node_home -.->|"consumes data"| node_live_data
node_warwatch -.->|"consumes data"| node_live_data
node_india -.->|"consumes data"| node_live_data
node_economy -->|"consumes feed"| node_prices_data
node_history_view -.->|"consumes data"| node_live_data
node_records -.->|"consumes data"| node_live_data
node_reports_view -.->|"consumes data"| node_live_data

click node_bot "https://github.com/suryavamshikusam/warwatch/blob/main/bot.py"
click node_scraper "https://github.com/suryavamshikusam/warwatch/blob/main/scraper.py"
click node_seen "https://github.com/suryavamshikusam/warwatch/blob/main/seen_urls.json"
click node_dashboard_builder "https://github.com/suryavamshikusam/warwatch/blob/main/dashboard.py"
click node_reports "https://github.com/suryavamshikusam/warwatch/tree/main/reports"
click node_live_data "https://github.com/suryavamshikusam/warwatch/blob/main/live_data.js"
click node_emailer "https://github.com/suryavamshikusam/warwatch/blob/main/emailer.py"
click node_price_fetcher "https://github.com/suryavamshikusam/warwatch/blob/main/prices_fetcher.py"
click node_price_history "https://github.com/suryavamshikusam/warwatch/blob/main/prices_history.json"
click node_prices_data "https://github.com/suryavamshikusam/warwatch/blob/main/prices_data.js"
click node_home "https://github.com/suryavamshikusam/warwatch/blob/main/index.html"
click node_warwatch "https://github.com/suryavamshikusam/warwatch/blob/main/warwatch.html"
click node_india "https://github.com/suryavamshikusam/warwatch/blob/main/india.html"
click node_economy "https://github.com/suryavamshikusam/warwatch/blob/main/economy.html"
click node_history_view "https://github.com/suryavamshikusam/warwatch/blob/main/history.html"
click node_records "https://github.com/suryavamshikusam/warwatch/blob/main/records.html"
click node_reports_view "https://github.com/suryavamshikusam/warwatch/blob/main/dashboard.html"

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_bot,node_scraper,node_seen toneBlue
class node_dashboard_builder,node_reports,node_live_data,node_emailer toneAmber
class node_price_fetcher,node_price_history,node_prices_data toneMint
class node_home,node_warwatch,node_india,node_economy,node_history_view,node_records,node_reports_view toneRose
class node_operator,node_feeds,node_gmail,node_market_data toneIndigo
```

## Components

### News collection

- [Monitor bot](https://github.com/suryavamshikusam/warwatch/blob/main/bot.py): `bot.py`
- [RSS scraper](https://github.com/suryavamshikusam/warwatch/blob/main/scraper.py): `scraper.py`
- [Seen URLs](https://github.com/suryavamshikusam/warwatch/blob/main/seen_urls.json): `seen_urls.json`

### Dashboard data

- [Dashboard builder](https://github.com/suryavamshikusam/warwatch/blob/main/dashboard.py): `dashboard.py`
- [Report history](https://github.com/suryavamshikusam/warwatch/tree/main/reports): `reports`
- [Live dashboard data](https://github.com/suryavamshikusam/warwatch/blob/main/live_data.js): `live_data.js`
- [Report emailer](https://github.com/suryavamshikusam/warwatch/blob/main/emailer.py): `emailer.py`

### Market tracking

- [Price fetcher](https://github.com/suryavamshikusam/warwatch/blob/main/prices_fetcher.py): `prices_fetcher.py`
- [Price history](https://github.com/suryavamshikusam/warwatch/blob/main/prices_history.json): `prices_history.json`
- [Market data feed](https://github.com/suryavamshikusam/warwatch/blob/main/prices_data.js): `prices_data.js`

### Web experience

- [Main dashboard](https://github.com/suryavamshikusam/warwatch/blob/main/index.html): `index.html`
- [WarWatch view](https://github.com/suryavamshikusam/warwatch/blob/main/warwatch.html): `warwatch.html`
- [India view](https://github.com/suryavamshikusam/warwatch/blob/main/india.html): `india.html`
- [Economy view](https://github.com/suryavamshikusam/warwatch/blob/main/economy.html): `economy.html`
- [History view](https://github.com/suryavamshikusam/warwatch/blob/main/history.html): `history.html`
- [Records view](https://github.com/suryavamshikusam/warwatch/blob/main/records.html): `records.html`
- [Reports view](https://github.com/suryavamshikusam/warwatch/blob/main/dashboard.html): `dashboard.html`

### Other components

- **Operator**
- **RSS feeds**
- **Gmail SMTP**
- **Yahoo market data**

## Connections

- Operator → Monitor bot: runs (evidence: `bot.py`)
- Monitor bot → RSS scraper: fetches articles (evidence: `bot.py`)
- RSS scraper → RSS feeds: fetches feeds (evidence: `scraper.py`)
- Monitor bot → Seen URLs: reads and writes (evidence: `bot.py`)
- Monitor bot → Dashboard builder: invokes build (evidence: `bot.py`)
- Dashboard builder → Report history: reads reports (evidence: `dashboard.py`)
- Dashboard builder → Live dashboard data: writes data (evidence: `dashboard.py`)
- Monitor bot → Price fetcher: invokes build (evidence: `bot.py`)
- Price fetcher → Yahoo market data: downloads prices (evidence: `prices_fetcher.py`)
- Price fetcher → Price history: updates history (evidence: `prices_fetcher.py`)
- Price fetcher → Market data feed: writes feed (evidence: `prices_fetcher.py`)
- Report emailer → Gmail SMTP: sends email (evidence: `emailer.py`)
- Main dashboard → Live dashboard data: consumes data
- WarWatch view → Live dashboard data: consumes data
- India view → Live dashboard data: consumes data
- Economy view → Market data feed: consumes feed
- History view → Live dashboard data: consumes data
- Records view → Live dashboard data: consumes data
- Reports view → Live dashboard data: consumes data
