# crazycoder009/update-watch architecture

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

- Interactive diagram: https://gitdiagram.com/crazycoder009/update-watch
- Repository: https://github.com/crazycoder009/update-watch

## Overview

update-watch is a per-user terminal update-and-news reporter, not an updater: it reads package-manager history, checks pending packages, estimates upgrade time, and presents cached distro news. The main path is CLI → cached status or refresh → distro backend/news → local cache → terminal output. Setup, shell integration, diagnostics, and scheduled refresh are separate product capabilities. Edges reflect shown imports, calls, or README-documented behavior; unsampled implementation details are not inferred.

Main entry points: [`update_watch/fetch.py`](https://github.com/crazycoder009/update-watch/blob/main/update_watch/fetch.py) (Refresh coordinator), [`update_watch/status.py`](https://github.com/crazycoder009/update-watch/blob/main/update_watch/status.py) (Status and news views), [`update_watch/installer.py`](https://github.com/crazycoder009/update-watch/blob/main/update_watch/installer.py) (Setup and diagnostics), [`update_watch/distro.py`](https://github.com/crazycoder009/update-watch/blob/main/update_watch/distro.py) (Distro detection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Command and setup"]
  node_cli["Command router<br/>[cli.py]"]
  node_setup["Setup and diagnostics<br/>[installer.py]"]
  node_shells["Shell hooks<br/>[shells.py]"]
end

subgraph group_collection["Update and news collection"]
  node_fetch["Refresh coordinator<br/>[fetch.py]"]
  node_distro["Distro detection<br/>[distro.py]"]
  node_backend["Backend contract<br/>[base.py]"]
  node_arch["Arch package checks<br/>[arch.py]"]
  node_debian["Debian package checks<br/>[debian.py]"]
  node_fedora["Fedora package checks<br/>[fedora.py]"]
  node_news["Feed parsing and flags<br/>[news.py]"]
end

subgraph group_reporting["Summary and estimates"]
  node_status["Status and news views<br/>[status.py]"]
  node_estimate["Upgrade-time estimate<br/>[estimate.py]"]
end

subgraph group_state["User configuration and cache"]
  node_config[("Config and state files<br/>[config.py]")]
  node_util["Process and formatting helpers<br/>[util.py]"]
end

node_user(("Terminal user"))
node_timer["Systemd user timer"]
node_feeds["Distro RSS/Atom feeds"]
node_terminal["Terminal output"]

node_user -->|"runs command"| node_cli
node_cli -->|"routes status"| node_status
node_cli -->|"routes fetch"| node_fetch
node_cli -->|"routes setup"| node_setup
node_cli -->|"loads config"| node_config
node_setup -->|"configures hooks"| node_shells
node_setup -->|"saves settings"| node_config
node_setup -->|"initial refresh"| node_fetch
node_setup -->|"detects family"| node_distro
node_setup -->|"selects feeds"| node_news
node_timer -->|"runs periodically"| node_fetch
node_status -->|"reads cache"| node_config
node_status -->|"selects backend"| node_distro
node_status -->|"estimates duration"| node_estimate
node_status -->|"spawns stale refresh"| node_fetch
node_status -->|"prints views"| node_terminal
node_fetch -->|"loads and saves state"| node_config
node_fetch -->|"gets backend"| node_distro
node_fetch -->|"refreshes feeds"| node_news
node_fetch -->|"requests package data"| node_backend
node_distro -->|"selects Arch"| node_arch
node_distro -->|"selects Debian"| node_debian
node_distro -->|"selects Fedora"| node_fedora
node_arch -->|"implements contract"| node_backend
node_debian -->|"implements contract"| node_backend
node_fedora -->|"implements contract"| node_backend
node_arch -->|"runs commands"| node_util
node_debian -->|"runs commands"| node_util
node_fedora -->|"runs commands"| node_util
node_news -->|"fetches feeds"| node_feeds
node_fetch -->|"persists refresh results"| node_config
node_status -->|"formats display"| node_util

click node_cli "https://github.com/crazycoder009/update-watch/blob/main/update_watch/cli.py"
click node_setup "https://github.com/crazycoder009/update-watch/blob/main/update_watch/installer.py"
click node_shells "https://github.com/crazycoder009/update-watch/blob/main/update_watch/shells.py"
click node_fetch "https://github.com/crazycoder009/update-watch/blob/main/update_watch/fetch.py"
click node_distro "https://github.com/crazycoder009/update-watch/blob/main/update_watch/distro.py"
click node_backend "https://github.com/crazycoder009/update-watch/blob/main/update_watch/backends/base.py"
click node_arch "https://github.com/crazycoder009/update-watch/blob/main/update_watch/backends/arch.py"
click node_debian "https://github.com/crazycoder009/update-watch/blob/main/update_watch/backends/debian.py"
click node_fedora "https://github.com/crazycoder009/update-watch/blob/main/update_watch/backends/fedora.py"
click node_news "https://github.com/crazycoder009/update-watch/blob/main/update_watch/news.py"
click node_status "https://github.com/crazycoder009/update-watch/blob/main/update_watch/status.py"
click node_estimate "https://github.com/crazycoder009/update-watch/blob/main/update_watch/estimate.py"
click node_config "https://github.com/crazycoder009/update-watch/blob/main/update_watch/config.py"
click node_util "https://github.com/crazycoder009/update-watch/blob/main/update_watch/util.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_cli,node_setup,node_shells,node_user,node_timer toneBlue
class node_fetch,node_distro,node_backend,node_arch,node_debian,node_fedora,node_news toneAmber
class node_status,node_estimate toneMint
class node_config,node_util toneRose
class node_feeds,node_terminal toneIndigo
```

## Components

### Command and setup

- [Command router](https://github.com/crazycoder009/update-watch/blob/main/update_watch/cli.py): `update_watch/cli.py`
- [Setup and diagnostics](https://github.com/crazycoder009/update-watch/blob/main/update_watch/installer.py): `update_watch/installer.py`
- [Shell hooks](https://github.com/crazycoder009/update-watch/blob/main/update_watch/shells.py): `update_watch/shells.py`

### Update and news collection

- [Refresh coordinator](https://github.com/crazycoder009/update-watch/blob/main/update_watch/fetch.py): `update_watch/fetch.py`
- [Distro detection](https://github.com/crazycoder009/update-watch/blob/main/update_watch/distro.py): `update_watch/distro.py`
- [Backend contract](https://github.com/crazycoder009/update-watch/blob/main/update_watch/backends/base.py): `update_watch/backends/base.py`
- [Arch package checks](https://github.com/crazycoder009/update-watch/blob/main/update_watch/backends/arch.py): `update_watch/backends/arch.py`
- [Debian package checks](https://github.com/crazycoder009/update-watch/blob/main/update_watch/backends/debian.py): `update_watch/backends/debian.py`
- [Fedora package checks](https://github.com/crazycoder009/update-watch/blob/main/update_watch/backends/fedora.py): `update_watch/backends/fedora.py`
- [Feed parsing and flags](https://github.com/crazycoder009/update-watch/blob/main/update_watch/news.py): `update_watch/news.py`

### Summary and estimates

- [Status and news views](https://github.com/crazycoder009/update-watch/blob/main/update_watch/status.py): `update_watch/status.py`
- [Upgrade-time estimate](https://github.com/crazycoder009/update-watch/blob/main/update_watch/estimate.py): `update_watch/estimate.py`

### User configuration and cache

- [Config and state files](https://github.com/crazycoder009/update-watch/blob/main/update_watch/config.py): `update_watch/config.py`
- [Process and formatting helpers](https://github.com/crazycoder009/update-watch/blob/main/update_watch/util.py): `update_watch/util.py`

### Other components

- **Terminal user**
- **Systemd user timer**
- **Distro RSS/Atom feeds**
- **Terminal output**

## Connections

- Terminal user → Command router: runs command (evidence: `README.md`)
- Command router → Status and news views: routes status (evidence: `update_watch/cli.py`)
- Command router → Refresh coordinator: routes fetch (evidence: `update_watch/cli.py`)
- Command router → Setup and diagnostics: routes setup (evidence: `update_watch/cli.py`)
- Command router → Config and state files: loads config (evidence: `update_watch/cli.py`)
- Setup and diagnostics → Shell hooks: configures hooks (evidence: `update_watch/installer.py`)
- Setup and diagnostics → Config and state files: saves settings (evidence: `update_watch/installer.py`)
- Setup and diagnostics → Refresh coordinator: initial refresh (evidence: `update_watch/installer.py`)
- Setup and diagnostics → Distro detection: detects family (evidence: `update_watch/installer.py`)
- Setup and diagnostics → Feed parsing and flags: selects feeds (evidence: `update_watch/installer.py`)
- Systemd user timer → Refresh coordinator: runs periodically (evidence: `README.md`)
- Status and news views → Config and state files: reads cache (evidence: `update_watch/status.py`)
- Status and news views → Distro detection: selects backend (evidence: `update_watch/status.py`)
- Status and news views → Upgrade-time estimate: estimates duration (evidence: `update_watch/status.py`)
- Status and news views → Refresh coordinator: spawns stale refresh (evidence: `update_watch/status.py`)
- Status and news views → Terminal output: prints views (evidence: `README.md`)
- Refresh coordinator → Config and state files: loads and saves state (evidence: `update_watch/fetch.py`)
- Refresh coordinator → Distro detection: gets backend (evidence: `update_watch/fetch.py`)
- Refresh coordinator → Feed parsing and flags: refreshes feeds (evidence: `update_watch/fetch.py`)
- Refresh coordinator → Backend contract: requests package data (evidence: `update_watch/fetch.py`)
- Distro detection → Arch package checks: selects Arch (evidence: `update_watch/distro.py`)
- Distro detection → Debian package checks: selects Debian (evidence: `update_watch/distro.py`)
- Distro detection → Fedora package checks: selects Fedora (evidence: `update_watch/distro.py`)
- Arch package checks → Backend contract: implements contract (evidence: `update_watch/backends/arch.py`)
- Debian package checks → Backend contract: implements contract (evidence: `update_watch/backends/debian.py`)
- Fedora package checks → Backend contract: implements contract (evidence: `update_watch/backends/fedora.py`)
- Arch package checks → Process and formatting helpers: runs commands (evidence: `update_watch/backends/arch.py`)
- Debian package checks → Process and formatting helpers: runs commands (evidence: `update_watch/backends/debian.py`)
- Fedora package checks → Process and formatting helpers: runs commands (evidence: `update_watch/backends/fedora.py`)
- Feed parsing and flags → Distro RSS/Atom feeds: fetches feeds (evidence: `update_watch/news.py`)
- Refresh coordinator → Config and state files: persists refresh results (evidence: `update_watch/fetch.py`)
- Status and news views → Process and formatting helpers: formats display (evidence: `update_watch/status.py`)
