# pokurilahari/intelligent-website-change-detection architecture

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

- Interactive diagram: https://gitdiagram.com/pokurilahari/intelligent-website-change-detection
- Repository: https://github.com/pokurilahari/intelligent-website-change-detection

## Overview

WatchDog is a local website-monitoring app: users manage monitored URLs through a dashboard, checks retrieve and compare site content, and meaningful changes can trigger email alerts. The Flask app contains its own checking and persistence logic, while the separate CLI monitor uses the fetcher and differ modules. The README documents scheduling, classifications, history, and alerts; some app internals are omitted from the excerpts, so only directly evidenced module relationships are shown.

Main entry points: [`app.py`](https://github.com/pokurilahari/intelligent-website-change-detection/blob/main/app.py) (App check workflow), [`alerts.py`](https://github.com/pokurilahari/intelligent-website-change-detection/blob/main/alerts.py) (Email alerts), [`monitor.py`](https://github.com/pokurilahari/intelligent-website-change-detection/blob/main/monitor.py) (CLI monitor), [`templates/index.html`](https://github.com/pokurilahari/intelligent-website-change-detection/blob/main/templates/index.html) (Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web dashboard"]
  node_dashboard["Dashboard<br/>[index.html]"]
  node_flask_app["Flask app and API<br/>[app.py]"]
end

subgraph group_checks["Monitoring and alerts"]
  node_app_checker["App check workflow<br/>[app.py]"]
  node_cli_monitor["CLI monitor<br/>[monitor.py]"]
  node_fetcher["Content fetcher<br/>[fetcher.py]"]
  node_differ["Change detection<br/>[differ.py]"]
  node_alerts["Email alerts<br/>[alerts.py]"]
end

subgraph group_storage["Local state"]
  node_site_store[("Site settings<br/>[sites.json]")]
  node_history_store[("Change history<br/>[history.json]")]
  node_snapshots[("Snapshots")]
end

node_user(("User"))
node_site(("Monitored website"))
node_smtp(("SMTP service"))

node_user -->|"uses"| node_dashboard
node_dashboard -->|"requests pages"| node_flask_app
node_user -->|"manages sites"| node_flask_app
node_flask_app -->|"runs checks"| node_app_checker
node_app_checker -.->|"fetches content"| node_site
node_app_checker -->|"reads and updates"| node_site_store
node_app_checker -->|"records changes"| node_history_store
node_app_checker -->|"reads and saves"| node_snapshots
node_app_checker -->|"sends alerts"| node_alerts
node_cli_monitor -->|"fetches and saves"| node_fetcher
node_cli_monitor -->|"computes changes"| node_differ
node_cli_monitor -->|"sends alerts"| node_alerts
node_alerts -->|"formats preview"| node_differ
node_alerts -->|"sends email"| node_smtp

click node_dashboard "https://github.com/pokurilahari/intelligent-website-change-detection/blob/main/templates/index.html"
click node_flask_app "https://github.com/pokurilahari/intelligent-website-change-detection/blob/main/app.py"
click node_app_checker "https://github.com/pokurilahari/intelligent-website-change-detection/blob/main/app.py"
click node_cli_monitor "https://github.com/pokurilahari/intelligent-website-change-detection/blob/main/monitor.py"
click node_fetcher "https://github.com/pokurilahari/intelligent-website-change-detection/blob/main/fetcher.py"
click node_differ "https://github.com/pokurilahari/intelligent-website-change-detection/blob/main/differ.py"
click node_alerts "https://github.com/pokurilahari/intelligent-website-change-detection/blob/main/alerts.py"
click node_site_store "https://github.com/pokurilahari/intelligent-website-change-detection/blob/main/data/sites.json"
click node_history_store "https://github.com/pokurilahari/intelligent-website-change-detection/blob/main/data/history.json"
click node_snapshots "https://github.com/pokurilahari/intelligent-website-change-detection/tree/main/snapshots"

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_dashboard,node_flask_app,node_user toneBlue
class node_app_checker,node_cli_monitor,node_fetcher,node_differ,node_alerts toneAmber
class node_site_store,node_history_store,node_snapshots toneMint
class node_site,node_smtp toneIndigo
```

## Components

### Web dashboard

- [Dashboard](https://github.com/pokurilahari/intelligent-website-change-detection/blob/main/templates/index.html): `templates/index.html`
- [Flask app and API](https://github.com/pokurilahari/intelligent-website-change-detection/blob/main/app.py): `app.py`

### Monitoring and alerts

- [App check workflow](https://github.com/pokurilahari/intelligent-website-change-detection/blob/main/app.py): `app.py`
- [CLI monitor](https://github.com/pokurilahari/intelligent-website-change-detection/blob/main/monitor.py): `monitor.py`
- [Content fetcher](https://github.com/pokurilahari/intelligent-website-change-detection/blob/main/fetcher.py): `fetcher.py`
- [Change detection](https://github.com/pokurilahari/intelligent-website-change-detection/blob/main/differ.py): `differ.py`
- [Email alerts](https://github.com/pokurilahari/intelligent-website-change-detection/blob/main/alerts.py): `alerts.py`

### Local state

- [Site settings](https://github.com/pokurilahari/intelligent-website-change-detection/blob/main/data/sites.json): `data/sites.json`
- [Change history](https://github.com/pokurilahari/intelligent-website-change-detection/blob/main/data/history.json): `data/history.json`
- [Snapshots](https://github.com/pokurilahari/intelligent-website-change-detection/tree/main/snapshots): `snapshots`

### Other components

- **User**
- **Monitored website**
- **SMTP service**

## Connections

- User → Dashboard: uses (evidence: `README.md`)
- Dashboard → Flask app and API: requests pages (evidence: `app.py`)
- User → Flask app and API: manages sites (evidence: `README.md`)
- Flask app and API → App check workflow: runs checks (evidence: `app.py`)
- App check workflow → Monitored website: fetches content
- App check workflow → Site settings: reads and updates (evidence: `app.py`)
- App check workflow → Change history: records changes (evidence: `app.py`)
- App check workflow → Snapshots: reads and saves (evidence: `app.py`)
- App check workflow → Email alerts: sends alerts (evidence: `app.py`)
- CLI monitor → Content fetcher: fetches and saves (evidence: `monitor.py`)
- CLI monitor → Change detection: computes changes (evidence: `monitor.py`)
- CLI monitor → Email alerts: sends alerts (evidence: `monitor.py`)
- Email alerts → Change detection: formats preview (evidence: `alerts.py`)
- Email alerts → SMTP service: sends email (evidence: `alerts.py`)
