# ahmadsajjad-logix/pak-broadcast-dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/ahmadsajjad-logix/pak-broadcast-dashboard
- Repository: https://github.com/ahmadsajjad-logix/pak-broadcast-dashboard

## Overview

PakBroadcast gathers Pakistani TV channel and satellite telemetry from directory listings, enriches records with channel-profile and mux-page details, stores them in SQLite, and presents a technical dashboard. The principal workflow runs from the directory source through the scraper’s enrichment and persistence steps, then the Flask route reads records for the dashboard. README capabilities include filtering, satellite sorting, and printable cards. The excerpts show scraper-to-source requests and route-to-database reads; unsampled template and scraper sections limit certainty about dashboard wiring and some extraction details.

Main entry points: [`parse_channels.py`](https://github.com/ahmadsajjad-logix/pak-broadcast-dashboard/blob/main/parse_channels.py) (Pipeline runner), [`app.py`](https://github.com/ahmadsajjad-logix/pak-broadcast-dashboard/blob/main/app.py) (Flask application), [`templates/index.html`](https://github.com/ahmadsajjad-logix/pak-broadcast-dashboard/blob/main/templates/index.html) (Technical dashboard), [`static/logos`](https://github.com/ahmadsajjad-logix/pak-broadcast-dashboard/tree/main/static/logos) (Local logos)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Telemetry collection"]
  node_scraper["Pipeline runner<br/>[parse_channels.py]"]
  node_profile["Profile parser<br/>[parse_channels.py]"]
  node_mux["Mux lock lookup<br/>[parse_channels.py]"]
  node_logo["Logo downloader<br/>[parse_channels.py]"]
end

subgraph group_storage["Registry storage"]
  node_logos["Local logos"]
  node_registry[("Channel registry<br/>[parse_channels.py]")]
end

subgraph group_dashboard["Dashboard"]
  node_web["Flask application<br/>[app.py]"]
  node_query["Channel reader<br/>[app.py]"]
  node_template["Technical dashboard<br/>[index.html]"]
end

node_operator(("Operator"))
node_directory["Satellite directory"]
node_browser(("Dashboard user"))

node_scraper -->|"requests listings"| node_directory
node_scraper -->|"parses profiles"| node_profile
node_scraper -->|"checks lock"| node_mux
node_scraper -->|"downloads logos"| node_logo
node_logo -->|"writes images"| node_logos
node_scraper -->|"inserts records"| node_registry
node_browser -->|"opens dashboard"| node_web
node_web -->|"calls reader"| node_query
node_query -->|"reads channels"| node_registry
node_web -->|"renders records"| node_template
node_template -->|"displays dashboard"| node_browser

click node_scraper "https://github.com/ahmadsajjad-logix/pak-broadcast-dashboard/blob/main/parse_channels.py"
click node_profile "https://github.com/ahmadsajjad-logix/pak-broadcast-dashboard/blob/main/parse_channels.py"
click node_mux "https://github.com/ahmadsajjad-logix/pak-broadcast-dashboard/blob/main/parse_channels.py"
click node_logo "https://github.com/ahmadsajjad-logix/pak-broadcast-dashboard/blob/main/parse_channels.py"
click node_logos "https://github.com/ahmadsajjad-logix/pak-broadcast-dashboard/tree/main/static/logos"
click node_registry "https://github.com/ahmadsajjad-logix/pak-broadcast-dashboard/blob/main/parse_channels.py"
click node_web "https://github.com/ahmadsajjad-logix/pak-broadcast-dashboard/blob/main/app.py"
click node_query "https://github.com/ahmadsajjad-logix/pak-broadcast-dashboard/blob/main/app.py"
click node_template "https://github.com/ahmadsajjad-logix/pak-broadcast-dashboard/blob/main/templates/index.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_scraper,node_profile,node_mux,node_logo,node_browser toneBlue
class node_logos,node_registry toneAmber
class node_web,node_query,node_template toneMint
class node_operator,node_directory toneIndigo
```

## Components

### Telemetry collection

- [Pipeline runner](https://github.com/ahmadsajjad-logix/pak-broadcast-dashboard/blob/main/parse_channels.py): `parse_channels.py`
- [Profile parser](https://github.com/ahmadsajjad-logix/pak-broadcast-dashboard/blob/main/parse_channels.py): `parse_channels.py`
- [Mux lock lookup](https://github.com/ahmadsajjad-logix/pak-broadcast-dashboard/blob/main/parse_channels.py): `parse_channels.py`
- [Logo downloader](https://github.com/ahmadsajjad-logix/pak-broadcast-dashboard/blob/main/parse_channels.py): `parse_channels.py`

### Registry storage

- [Local logos](https://github.com/ahmadsajjad-logix/pak-broadcast-dashboard/tree/main/static/logos): `static/logos`
- [Channel registry](https://github.com/ahmadsajjad-logix/pak-broadcast-dashboard/blob/main/parse_channels.py): `parse_channels.py`

### Dashboard

- [Flask application](https://github.com/ahmadsajjad-logix/pak-broadcast-dashboard/blob/main/app.py): `app.py`
- [Channel reader](https://github.com/ahmadsajjad-logix/pak-broadcast-dashboard/blob/main/app.py): `app.py`
- [Technical dashboard](https://github.com/ahmadsajjad-logix/pak-broadcast-dashboard/blob/main/templates/index.html): `templates/index.html`

### Other components

- **Operator**
- **Satellite directory**
- **Dashboard user**

## Connections

- Pipeline runner → Satellite directory: requests listings
- Pipeline runner → Profile parser: parses profiles
- Pipeline runner → Mux lock lookup: checks lock
- Pipeline runner → Logo downloader: downloads logos
- Logo downloader → Local logos: writes images
- Pipeline runner → Channel registry: inserts records
- Dashboard user → Flask application: opens dashboard
- Flask application → Channel reader: calls reader
- Channel reader → Channel registry: reads channels
- Flask application → Technical dashboard: renders records
- Technical dashboard → Dashboard user: displays dashboard
