# hansjd/kvflive architecture

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

- Interactive diagram: https://gitdiagram.com/hansjd/kvflive
- Repository: https://github.com/hansjd/kvflive

## Overview

KvfLive is a four-platform TV app scaffold for watching a live stream. The main workflow loads a startup stream URL, starts playback, reports playback status, and lets viewers return to the live edge; the web apps also hide the Go Live control after inactivity. Shared configuration is documented as the common source copied into platform-specific assets. The platform implementations are mostly self-contained rather than separate service layers. Relationships below rely on the excerpts and README; unsampled platform details are not inferred.

Main entry points: [`packages/shared/app-config.json`](https://github.com/hansjd/kvflive/blob/main/packages/shared/app-config.json) (Shared Stream Config), [`android-tv/app/src/main/java/com/kvflive/tv/MainActivity.kt`](https://github.com/hansjd/kvflive/blob/main/android-tv/app/src/main/java/com/kvflive/tv/MainActivity.kt) (Android Playback App), [`apple-tv/TVApp/Sources/KvfLiveAppleTVApp.swift`](https://github.com/hansjd/kvflive/blob/main/apple-tv/TVApp/Sources/KvfLiveAppleTVApp.swift) (Apple Playback App), [`webos/main.js`](https://github.com/hansjd/kvflive/blob/main/webos/main.js) (webOS Playback App)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_config["Shared Configuration"]
  node_shared_config["Shared Stream Config<br/>[app-config.json]"]
  node_android_config["Android Config Asset<br/>[app-config.json]"]
  node_apple_config["Apple Config Asset<br/>[app-config.json]"]
  node_webos_config["webOS Config Asset<br/>[app-config.json]"]
  node_tizen_config["Tizen Config Asset<br/>[app-config.json]"]
end

subgraph group_native["Native TV Apps"]
  node_android_app["Android Playback App<br/>[MainActivity.kt]"]
  node_apple_app["Apple Playback App"]
end

subgraph group_web["Web TV Apps"]
  node_webos_app["webOS Playback App<br/>[main.js]"]
  node_tizen_app["Tizen Playback App<br/>[main.js]"]
end

node_viewer(("TV Viewer"))
node_stream["Live Stream"]

node_shared_config -->|"syncs to"| node_android_config
node_shared_config -->|"syncs to"| node_apple_config
node_shared_config -->|"syncs to"| node_webos_config
node_shared_config -->|"syncs to"| node_tizen_config
node_viewer -->|"controls"| node_android_app
node_viewer -->|"controls"| node_apple_app
node_viewer -->|"controls"| node_webos_app
node_viewer -->|"controls"| node_tizen_app
node_android_app -->|"reads URL"| node_android_config
node_apple_app -->|"reads URL"| node_apple_config
node_webos_app -->|"loads config"| node_webos_config
node_tizen_app -->|"loads config"| node_tizen_config
node_android_app -->|"plays stream"| node_stream
node_apple_app -->|"plays stream"| node_stream
node_webos_app -->|"plays stream"| node_stream
node_tizen_app -->|"plays stream"| node_stream

click node_shared_config "https://github.com/hansjd/kvflive/blob/main/packages/shared/app-config.json"
click node_android_config "https://github.com/hansjd/kvflive/blob/main/android-tv/app/src/main/assets/shared/app-config.json"
click node_apple_config "https://github.com/hansjd/kvflive/blob/main/apple-tv/TVApp/Resources/shared/app-config.json"
click node_webos_config "https://github.com/hansjd/kvflive/blob/main/webos/shared/app-config.json"
click node_tizen_config "https://github.com/hansjd/kvflive/blob/main/tizen/shared/app-config.json"
click node_android_app "https://github.com/hansjd/kvflive/blob/main/android-tv/app/src/main/java/com/kvflive/tv/MainActivity.kt"
click node_apple_app "https://github.com/hansjd/kvflive/blob/main/apple-tv/TVApp/Sources/KvfLiveAppleTVApp.swift"
click node_webos_app "https://github.com/hansjd/kvflive/blob/main/webos/main.js"
click node_tizen_app "https://github.com/hansjd/kvflive/blob/main/tizen/js/main.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_shared_config,node_android_config,node_apple_config,node_webos_config,node_tizen_config,node_viewer toneBlue
class node_android_app,node_apple_app toneAmber
class node_webos_app,node_tizen_app toneMint
class node_stream toneIndigo
```

## Components

### Shared Configuration

- [Shared Stream Config](https://github.com/hansjd/kvflive/blob/main/packages/shared/app-config.json): `packages/shared/app-config.json`
- [Android Config Asset](https://github.com/hansjd/kvflive/blob/main/android-tv/app/src/main/assets/shared/app-config.json): `android-tv/app/src/main/assets/shared/app-config.json`
- [Apple Config Asset](https://github.com/hansjd/kvflive/blob/main/apple-tv/TVApp/Resources/shared/app-config.json): `apple-tv/TVApp/Resources/shared/app-config.json`
- [webOS Config Asset](https://github.com/hansjd/kvflive/blob/main/webos/shared/app-config.json): `webos/shared/app-config.json`
- [Tizen Config Asset](https://github.com/hansjd/kvflive/blob/main/tizen/shared/app-config.json): `tizen/shared/app-config.json`

### Native TV Apps

- [Android Playback App](https://github.com/hansjd/kvflive/blob/main/android-tv/app/src/main/java/com/kvflive/tv/MainActivity.kt): `android-tv/app/src/main/java/com/kvflive/tv/MainActivity.kt`
- [Apple Playback App](https://github.com/hansjd/kvflive/blob/main/apple-tv/TVApp/Sources/KvfLiveAppleTVApp.swift): `apple-tv/TVApp/Sources/KvfLiveAppleTVApp.swift`

### Web TV Apps

- [webOS Playback App](https://github.com/hansjd/kvflive/blob/main/webos/main.js): `webos/main.js`
- [Tizen Playback App](https://github.com/hansjd/kvflive/blob/main/tizen/js/main.js): `tizen/js/main.js`

### Other components

- **TV Viewer**
- **Live Stream**

## Connections

- Shared Stream Config → Android Config Asset: syncs to (evidence: `README.md`)
- Shared Stream Config → Apple Config Asset: syncs to (evidence: `README.md`)
- Shared Stream Config → webOS Config Asset: syncs to (evidence: `README.md`)
- Shared Stream Config → Tizen Config Asset: syncs to (evidence: `README.md`)
- TV Viewer → Android Playback App: controls (evidence: `android-tv/app/src/main/java/com/kvflive/tv/MainActivity.kt`)
- TV Viewer → Apple Playback App: controls (evidence: `apple-tv/TVApp/Sources/KvfLiveAppleTVApp.swift`)
- TV Viewer → webOS Playback App: controls (evidence: `webos/main.js`)
- TV Viewer → Tizen Playback App: controls (evidence: `tizen/js/main.js`)
- Android Playback App → Android Config Asset: reads URL (evidence: `android-tv/app/src/main/java/com/kvflive/tv/MainActivity.kt`)
- Apple Playback App → Apple Config Asset: reads URL (evidence: `apple-tv/TVApp/Sources/KvfLiveAppleTVApp.swift`)
- webOS Playback App → webOS Config Asset: loads config (evidence: `webos/main.js`)
- Tizen Playback App → Tizen Config Asset: loads config (evidence: `tizen/js/main.js`)
- Android Playback App → Live Stream: plays stream (evidence: `README.md`)
- Apple Playback App → Live Stream: plays stream (evidence: `README.md`)
- webOS Playback App → Live Stream: plays stream (evidence: `webos/main.js`)
- Tizen Playback App → Live Stream: plays stream (evidence: `tizen/js/main.js`)
