# enisthebiker/zapper-tv architecture

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

- Interactive diagram: https://gitdiagram.com/enisthebiker/zapper-tv
- Repository: https://github.com/enisthebiker/zapper-tv

## Overview

Zapper is a browser-based live-TV player. Users browse a configurable channel list or use the virtual remote—including numeric selection—to choose a channel; the player then routes the configured source to HLS video, an embedded site, or YouTube. The list can be reordered, and the interface supports responsive layouts. The excerpts show channel-list construction and playback routing, but not the full page markup or every remote-control handler, so some UI connections rely on README documentation.

Main entry points: [`player.js`](https://github.com/enisthebiker/zapper-tv/blob/main/player.js) (Source Routing), [`channels.js`](https://github.com/enisthebiker/zapper-tv/blob/main/channels.js) (Channel List), [`index.html`](https://github.com/enisthebiker/zapper-tv/blob/main/index.html) (Player Interface), [`style.css`](https://github.com/enisthebiker/zapper-tv/blob/main/style.css) (Responsive Layout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_catalog["Channel Catalog"]
  node_channel_data["Channel Definitions<br/>[channels.js]"]
end

subgraph group_controls["Browsing And Controls"]
  node_channel_list["Channel List<br/>[channels.js]"]
  node_channel_order["Channel Ordering<br/>[player.js]"]
  node_remote["Virtual Remote<br/>[index.html]"]
  node_number_select["Number Selection<br/>[player.js]"]
end

subgraph group_playback["Playback"]
  node_channel_switch["Channel Switching<br/>[player.js]"]
  node_source_router["Source Routing<br/>[player.js]"]
  node_hls_player["HLS Playback<br/>[player.js]"]
  node_iframe_player["Embedded Site Playback<br/>[player.js]"]
  node_youtube_player["YouTube Playback<br/>[player.js]"]
end

subgraph group_presentation["Interface"]
  node_player_interface["Player Interface<br/>[index.html]"]
  node_responsive_layout["Responsive Layout<br/>[style.css]"]
  node_playback_status["Playback Status<br/>[player.js]"]
end

node_viewer(("Viewer"))
node_stream_hosts{{"Stream Hosts"}}
node_youtube{{"YouTube"}}
node_site_hosts{{"Channel Sites"}}

node_viewer -->|"uses"| node_player_interface
node_viewer -->|"controls"| node_remote
node_channel_data -->|"builds"| node_channel_list
node_viewer -->|"browses"| node_channel_list
node_channel_list -->|"selects"| node_channel_switch
node_channel_order -->|"reads order"| node_channel_list
node_remote -->|"accepts numbers"| node_number_select
node_number_select -->|"selects channel"| node_channel_switch
node_channel_switch -->|"reads source"| node_channel_data
node_channel_switch -->|"routes source"| node_source_router
node_source_router -->|"plays stream"| node_hls_player
node_source_router -->|"embeds site"| node_iframe_player
node_source_router -->|"embeds video"| node_youtube_player
node_hls_player -->|"loads stream"| node_stream_hosts
node_iframe_player -->|"loads page"| node_site_hosts
node_youtube_player -->|"embeds video"| node_youtube
node_player_interface -->|"uses layout"| node_responsive_layout
node_hls_player -->|"reports errors"| node_playback_status
node_playback_status -->|"updates display"| node_player_interface

click node_channel_data "https://github.com/enisthebiker/zapper-tv/blob/main/channels.js"
click node_channel_list "https://github.com/enisthebiker/zapper-tv/blob/main/channels.js"
click node_channel_order "https://github.com/enisthebiker/zapper-tv/blob/main/player.js"
click node_remote "https://github.com/enisthebiker/zapper-tv/blob/main/index.html"
click node_number_select "https://github.com/enisthebiker/zapper-tv/blob/main/player.js"
click node_channel_switch "https://github.com/enisthebiker/zapper-tv/blob/main/player.js"
click node_source_router "https://github.com/enisthebiker/zapper-tv/blob/main/player.js"
click node_hls_player "https://github.com/enisthebiker/zapper-tv/blob/main/player.js"
click node_iframe_player "https://github.com/enisthebiker/zapper-tv/blob/main/player.js"
click node_youtube_player "https://github.com/enisthebiker/zapper-tv/blob/main/player.js"
click node_player_interface "https://github.com/enisthebiker/zapper-tv/blob/main/index.html"
click node_responsive_layout "https://github.com/enisthebiker/zapper-tv/blob/main/style.css"
click node_playback_status "https://github.com/enisthebiker/zapper-tv/blob/main/player.js"

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_channel_data,node_viewer toneBlue
class node_channel_list,node_channel_order,node_remote,node_number_select toneAmber
class node_channel_switch,node_source_router,node_hls_player,node_iframe_player,node_youtube_player toneMint
class node_player_interface,node_responsive_layout,node_playback_status toneRose
class node_stream_hosts,node_youtube,node_site_hosts toneIndigo
```

## Components

### Channel Catalog

- [Channel Definitions](https://github.com/enisthebiker/zapper-tv/blob/main/channels.js): `channels.js`

### Browsing And Controls

- [Channel List](https://github.com/enisthebiker/zapper-tv/blob/main/channels.js): `channels.js`
- [Channel Ordering](https://github.com/enisthebiker/zapper-tv/blob/main/player.js): `player.js`
- [Virtual Remote](https://github.com/enisthebiker/zapper-tv/blob/main/index.html): `index.html`
- [Number Selection](https://github.com/enisthebiker/zapper-tv/blob/main/player.js): `player.js`

### Playback

- [Channel Switching](https://github.com/enisthebiker/zapper-tv/blob/main/player.js): `player.js`
- [Source Routing](https://github.com/enisthebiker/zapper-tv/blob/main/player.js): `player.js`
- [HLS Playback](https://github.com/enisthebiker/zapper-tv/blob/main/player.js): `player.js`
- [Embedded Site Playback](https://github.com/enisthebiker/zapper-tv/blob/main/player.js): `player.js`
- [YouTube Playback](https://github.com/enisthebiker/zapper-tv/blob/main/player.js): `player.js`

### Interface

- [Player Interface](https://github.com/enisthebiker/zapper-tv/blob/main/index.html): `index.html`
- [Responsive Layout](https://github.com/enisthebiker/zapper-tv/blob/main/style.css): `style.css`
- [Playback Status](https://github.com/enisthebiker/zapper-tv/blob/main/player.js): `player.js`

### Other components

- **Viewer**
- **Stream Hosts**
- **YouTube**
- **Channel Sites**

## Connections

- Viewer → Player Interface: uses (evidence: `README.md`)
- Viewer → Virtual Remote: controls (evidence: `README.md`)
- Channel Definitions → Channel List: builds (evidence: `channels.js`)
- Viewer → Channel List: browses (evidence: `README.md`)
- Channel List → Channel Switching: selects (evidence: `channels.js`)
- Channel Ordering → Channel List: reads order (evidence: `player.js`)
- Virtual Remote → Number Selection: accepts numbers (evidence: `README.md`)
- Number Selection → Channel Switching: selects channel (evidence: `player.js`)
- Channel Switching → Channel Definitions: reads source (evidence: `player.js`)
- Channel Switching → Source Routing: routes source (evidence: `player.js`)
- Source Routing → HLS Playback: plays stream (evidence: `player.js`)
- Source Routing → Embedded Site Playback: embeds site (evidence: `player.js`)
- Source Routing → YouTube Playback: embeds video (evidence: `player.js`)
- HLS Playback → Stream Hosts: loads stream
- Embedded Site Playback → Channel Sites: loads page (evidence: `player.js`)
- YouTube Playback → YouTube: embeds video (evidence: `player.js`)
- Player Interface → Responsive Layout: uses layout (evidence: `README.md`)
- HLS Playback → Playback Status: reports errors (evidence: `player.js`)
- Playback Status → Player Interface: updates display (evidence: `player.js`)
