# apanzinc/classnews architecture

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

- Interactive diagram: https://gitdiagram.com/apanzinc/classnews
- Repository: https://github.com/apanzinc/classnews

## Overview

ClassNEWS is a desktop CCTV news app: users browse news sources and episodes, then play videos, with configurable playback and system notifications. Its runtime also supports classnews:// requests and an HTTP plugin API. The plugin manager dispatches news operations to source plugins; video lookup and HLS downloading are separate stages. UI pages and player components are represented at their exact tree paths, but their wiring is not shown in the sampled source, so those links are left out. Other unsampled README capabilities, including themes and settings, are preserved without asserting implementation details.

Main entry points: [`core/plugin_manager.py`](https://github.com/apanzinc/classnews/blob/main/core/plugin_manager.py) (Plugin manager), [`main.qml`](https://github.com/apanzinc/classnews/blob/main/main.qml) (Main window), [`pages/VideoPlayerWindow.qml`](https://github.com/apanzinc/classnews/blob/main/pages/VideoPlayerWindow.qml) (Video player UI), [`download_manager.py`](https://github.com/apanzinc/classnews/blob/main/download_manager.py) (Download manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop app"]
  node_main["App runtime<br/>[main.py]"]
  node_window["Main window<br/>[main.qml]"]
  node_news_pages["News pages"]
  node_settings["Settings and themes<br/>[Settings.qml]"]
  node_notifications["System notifications"]
end

subgraph group_news["News sources"]
  node_plugin_manager["Plugin manager<br/>[plugin_manager.py]"]
  node_plugin_interface["Plugin interface"]
  node_morning_news["Morning news source<br/>[plugin.py]"]
end

subgraph group_playback["Video playback"]
  node_video_ui["Video player UI"]
  node_cctv_lookup["CCTV video lookup<br/>[cctv_video.py]"]
  node_download_manager["Download manager"]
  node_hls_downloader["HLS downloader<br/>[hls_downloader.py]"]
  node_download_dialog["Download dialog<br/>[DownloadDialog.qml]"]
  node_video_dialog["Video notification dialog"]
end

subgraph group_integrations["External interfaces"]
  node_plugin_api["Plugin HTTP API<br/>[plugin_api.py]"]
  node_protocol["classnews protocol<br/>[main.py]"]
end

node_user(("App user"))
node_external_client(("External API client"))
node_third_party_app(("Third-party app"))

node_user -->|"uses"| node_window
node_window -.->|"presents"| node_news_pages
node_window -.->|"configures"| node_settings
node_news_pages -.->|"opens playback"| node_video_ui
node_main -->|"initializes"| node_plugin_manager
node_plugin_manager -->|"implements contract"| node_plugin_interface
node_plugin_manager -->|"dispatches news"| node_morning_news
node_plugin_api -->|"routes requests"| node_plugin_manager
node_external_client -.->|"calls HTTP API"| node_plugin_api
node_third_party_app -->|"invokes playback"| node_protocol
node_protocol -.->|"resolves video"| node_cctv_lookup
node_video_ui -.->|"requests downloads"| node_download_manager
node_download_dialog -.->|"controls downloads"| node_download_manager
node_download_manager -->|"downloads HLS"| node_hls_downloader
node_main -.->|"sends alerts"| node_notifications
node_video_ui -.->|"shows alerts"| node_video_dialog

click node_main "https://github.com/apanzinc/classnews/blob/main/main.py"
click node_window "https://github.com/apanzinc/classnews/blob/main/main.qml"
click node_news_pages "https://github.com/apanzinc/classnews/tree/main/pages"
click node_settings "https://github.com/apanzinc/classnews/blob/main/pages/Settings.qml"
click node_video_ui "https://github.com/apanzinc/classnews/blob/main/pages/VideoPlayerWindow.qml"
click node_notifications "https://github.com/apanzinc/classnews/blob/main/components/VideoNotificationWindow.qml"
click node_plugin_manager "https://github.com/apanzinc/classnews/blob/main/core/plugin_manager.py"
click node_plugin_interface "https://github.com/apanzinc/classnews/blob/main/core/plugin_interface.py"
click node_morning_news "https://github.com/apanzinc/classnews/blob/main/plugins/morning_news/plugin.py"
click node_plugin_api "https://github.com/apanzinc/classnews/blob/main/api/plugin_api.py"
click node_protocol "https://github.com/apanzinc/classnews/blob/main/main.py"
click node_cctv_lookup "https://github.com/apanzinc/classnews/blob/main/cctv_video.py"
click node_download_manager "https://github.com/apanzinc/classnews/blob/main/download_manager.py"
click node_hls_downloader "https://github.com/apanzinc/classnews/blob/main/hls_downloader.py"
click node_download_dialog "https://github.com/apanzinc/classnews/blob/main/components/DownloadDialog.qml"
click node_video_dialog "https://github.com/apanzinc/classnews/blob/main/components/VideoNotificationDialog.qml"

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_main,node_window,node_news_pages,node_settings,node_notifications,node_user,node_external_client toneBlue
class node_plugin_manager,node_plugin_interface,node_morning_news toneAmber
class node_video_ui,node_cctv_lookup,node_download_manager,node_hls_downloader,node_download_dialog,node_video_dialog toneMint
class node_plugin_api,node_protocol toneRose
class node_third_party_app toneIndigo
```

## Components

### Desktop app

- [App runtime](https://github.com/apanzinc/classnews/blob/main/main.py): `main.py`
- [Main window](https://github.com/apanzinc/classnews/blob/main/main.qml): `main.qml`
- [News pages](https://github.com/apanzinc/classnews/tree/main/pages): `pages`
- [Settings and themes](https://github.com/apanzinc/classnews/blob/main/pages/Settings.qml): `pages/Settings.qml`
- [System notifications](https://github.com/apanzinc/classnews/blob/main/components/VideoNotificationWindow.qml): `components/VideoNotificationWindow.qml`

### News sources

- [Plugin manager](https://github.com/apanzinc/classnews/blob/main/core/plugin_manager.py): `core/plugin_manager.py`
- [Plugin interface](https://github.com/apanzinc/classnews/blob/main/core/plugin_interface.py): `core/plugin_interface.py`
- [Morning news source](https://github.com/apanzinc/classnews/blob/main/plugins/morning_news/plugin.py): `plugins/morning_news/plugin.py`

### Video playback

- [Video player UI](https://github.com/apanzinc/classnews/blob/main/pages/VideoPlayerWindow.qml): `pages/VideoPlayerWindow.qml`
- [CCTV video lookup](https://github.com/apanzinc/classnews/blob/main/cctv_video.py): `cctv_video.py`
- [Download manager](https://github.com/apanzinc/classnews/blob/main/download_manager.py): `download_manager.py`
- [HLS downloader](https://github.com/apanzinc/classnews/blob/main/hls_downloader.py): `hls_downloader.py`
- [Download dialog](https://github.com/apanzinc/classnews/blob/main/components/DownloadDialog.qml): `components/DownloadDialog.qml`
- [Video notification dialog](https://github.com/apanzinc/classnews/blob/main/components/VideoNotificationDialog.qml): `components/VideoNotificationDialog.qml`

### External interfaces

- [Plugin HTTP API](https://github.com/apanzinc/classnews/blob/main/api/plugin_api.py): `api/plugin_api.py`
- [classnews protocol](https://github.com/apanzinc/classnews/blob/main/main.py): `main.py`

### Other components

- **App user**
- **External API client**
- **Third-party app**

## Connections

- App user → Main window: uses (evidence: `README.md`)
- Main window → News pages: presents
- Main window → Settings and themes: configures
- News pages → Video player UI: opens playback
- App runtime → Plugin manager: initializes
- Plugin manager → Plugin interface: implements contract (evidence: `core/plugin_manager.py`)
- Plugin manager → Morning news source: dispatches news (evidence: `core/plugin_manager.py`)
- Plugin HTTP API → Plugin manager: routes requests (evidence: `api/plugin_api.py`)
- External API client → Plugin HTTP API: calls HTTP API
- Third-party app → classnews protocol: invokes playback (evidence: `README.md`)
- classnews protocol → CCTV video lookup: resolves video (evidence: `main.py`)
- Video player UI → Download manager: requests downloads
- Download dialog → Download manager: controls downloads
- Download manager → HLS downloader: downloads HLS (evidence: `download_manager.py`)
- App runtime → System notifications: sends alerts
- Video player UI → Video notification dialog: shows alerts
