# snippe187/peaktv architecture

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

- Interactive diagram: https://gitdiagram.com/snippe187/peaktv
- Repository: https://github.com/snippe187/peaktv

## Overview

PeakTV is a tailored Android TV launcher plus companion casting receiver, phone remote, and Windows mirroring sender. The primary launcher workflow selects a profile, builds its app home, and exposes controls and settings; the cast workflow accepts an authenticated sender and presents incoming media. The graph retains documented cast media types, updates, profiles, and remote capabilities. Some links are supported only by README statements; unsampled implementation details are not inferred.

Main entry points: [`launcher/src/main/kotlin/de/peaktv/launcher/HomeActivity.kt`](https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/HomeActivity.kt) (Home screen), [`remote/src/main/kotlin/de/peaktv/remote/MainActivity.kt`](https://github.com/snippe187/peaktv/blob/main/remote/src/main/kotlin/de/peaktv/remote/MainActivity.kt) (Phone remote), [`launcher/src/main/kotlin/de/peaktv/launcher/ControlCenterActivity.kt`](https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/ControlCenterActivity.kt) (Control center), [`cast/src/main/kotlin/de/peaktv/cast/ReceiverActivity.kt`](https://github.com/snippe187/peaktv/blob/main/cast/src/main/kotlin/de/peaktv/cast/ReceiverActivity.kt) (Cast receiver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_launch["TV Launcher"]
  node_launcher_home["Home screen<br/>[HomeActivity.kt]"]
  node_profile_ui["Profile picker<br/>[ProfileActivity.kt]"]
  node_profile_data[("Profiles<br/>[Profile.kt]")]
  node_app_repo["Installed apps<br/>[AppRepo.kt]"]
  node_home_grid["App grid<br/>[HomeGrid.kt]"]
  node_layout["Home layout<br/>[Layout.kt]"]
  node_dock["Edge dock<br/>[DockService.kt]"]
  node_control["Control center"]
  node_settings["Settings"]
  node_prefs[("Preferences<br/>[Prefs.kt]")]
  node_weather["Weather<br/>[Weather.kt]"]
  node_net["Network client<br/>[Net.kt]"]
  node_updater["Release updater<br/>[Updater.kt]"]
  node_standby["Standby policy<br/>[Standby.kt]"]
  node_perf["Performance overlay"]
  node_rootkeys["Root key input<br/>[RootKeys.kt]"]
end

subgraph group_cast["Casting"]
  node_cast_receiver["Cast receiver"]
  node_cast_service["Cast listener<br/>[CastService.kt]"]
  node_cast_overview["Receiver overview<br/>[Overview.kt]"]
  node_cast_share["Media sharing<br/>[Share.kt]"]
  node_photo["Photo viewer<br/>[PhotoActivity.kt]"]
end

subgraph group_remote["Remote Control"]
  node_remote_app["Phone remote<br/>[MainActivity.kt]"]
  node_remote_conn["Remote connection<br/>[Conn.kt]"]
  node_remote_share["Remote sharing<br/>[ShareClient.kt]"]
end

subgraph group_pc["PC Sender"]
  node_sender["Windows sender<br/>[PeakTVCast.cs]"]
end

node_viewer(("TV user"))
node_ffmpeg["FFmpeg"]
node_phone(("Phone user"))

node_viewer -->|"chooses profile"| node_profile_ui
node_profile_ui -->|"selects and saves"| node_profile_data
node_profile_ui -->|"opens home"| node_launcher_home
node_launcher_home -->|"loads profile"| node_profile_data
node_launcher_home -->|"loads apps"| node_app_repo
node_launcher_home -->|"builds grid"| node_home_grid
node_home_grid -->|"uses layout"| node_layout
node_launcher_home -->|"refreshes weather"| node_weather
node_weather -->|"fetches data"| node_net
node_launcher_home -->|"starts dock"| node_dock
node_dock -->|"opens controls"| node_control
node_control -->|"opens settings"| node_settings
node_settings -->|"updates preferences"| node_prefs
node_settings -->|"invokes updater"| node_updater
node_updater -->|"reads configuration"| node_prefs
node_updater -->|"checks releases"| node_net
node_control -->|"requests standby"| node_standby
node_standby -->|"reads timeout"| node_prefs
node_launcher_home -->|"syncs overlay"| node_perf
node_perf -->|"checks enabled"| node_prefs
node_control -->|"dispatches key"| node_rootkeys
node_cast_service -->|"opens on sender"| node_cast_receiver
node_cast_receiver -->|"starts listener"| node_cast_service
node_cast_receiver -->|"shows overview"| node_cast_overview
node_cast_share -->|"opens photos"| node_photo
node_sender -.->|"streams media"| node_cast_receiver
node_sender -.->|"uses encoder"| node_ffmpeg
node_phone -->|"controls box"| node_remote_app
node_remote_app -->|"uses connection"| node_remote_conn
node_remote_app -->|"shares media"| node_remote_share
node_remote_app -.->|"requests standby"| node_standby
node_remote_app -.->|"shares to receiver"| node_cast_share

click node_launcher_home "https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/HomeActivity.kt"
click node_profile_ui "https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/ProfileActivity.kt"
click node_profile_data "https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/Profile.kt"
click node_app_repo "https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/AppRepo.kt"
click node_home_grid "https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/HomeGrid.kt"
click node_layout "https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/Layout.kt"
click node_dock "https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/DockService.kt"
click node_control "https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/ControlCenterActivity.kt"
click node_settings "https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/SettingsActivity.kt"
click node_prefs "https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/Prefs.kt"
click node_weather "https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/Weather.kt"
click node_net "https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/Net.kt"
click node_updater "https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/Updater.kt"
click node_standby "https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/Standby.kt"
click node_perf "https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/PerfOverlayService.kt"
click node_rootkeys "https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/RootKeys.kt"
click node_cast_receiver "https://github.com/snippe187/peaktv/blob/main/cast/src/main/kotlin/de/peaktv/cast/ReceiverActivity.kt"
click node_cast_service "https://github.com/snippe187/peaktv/blob/main/cast/src/main/kotlin/de/peaktv/cast/CastService.kt"
click node_cast_overview "https://github.com/snippe187/peaktv/blob/main/cast/src/main/kotlin/de/peaktv/cast/Overview.kt"
click node_cast_share "https://github.com/snippe187/peaktv/blob/main/cast/src/main/kotlin/de/peaktv/cast/Share.kt"
click node_photo "https://github.com/snippe187/peaktv/blob/main/cast/src/main/kotlin/de/peaktv/cast/PhotoActivity.kt"
click node_sender "https://github.com/snippe187/peaktv/blob/main/pc/PeakTVCast.cs"
click node_remote_app "https://github.com/snippe187/peaktv/blob/main/remote/src/main/kotlin/de/peaktv/remote/MainActivity.kt"
click node_remote_conn "https://github.com/snippe187/peaktv/blob/main/remote/src/main/kotlin/de/peaktv/remote/Conn.kt"
click node_remote_share "https://github.com/snippe187/peaktv/blob/main/remote/src/main/kotlin/de/peaktv/remote/ShareClient.kt"

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_launcher_home,node_profile_ui,node_profile_data,node_app_repo,node_home_grid,node_layout,node_dock,node_control,node_settings,node_prefs,node_weather,node_net,node_updater,node_standby,node_perf,node_rootkeys,node_viewer,node_phone toneBlue
class node_cast_receiver,node_cast_service,node_cast_overview,node_cast_share,node_photo toneAmber
class node_remote_app,node_remote_conn,node_remote_share toneMint
class node_sender toneRose
class node_ffmpeg toneIndigo
```

## Components

### TV Launcher

- [Home screen](https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/HomeActivity.kt): `launcher/src/main/kotlin/de/peaktv/launcher/HomeActivity.kt`
- [Profile picker](https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/ProfileActivity.kt): `launcher/src/main/kotlin/de/peaktv/launcher/ProfileActivity.kt`
- [Profiles](https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/Profile.kt): `launcher/src/main/kotlin/de/peaktv/launcher/Profile.kt`
- [Installed apps](https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/AppRepo.kt): `launcher/src/main/kotlin/de/peaktv/launcher/AppRepo.kt`
- [App grid](https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/HomeGrid.kt): `launcher/src/main/kotlin/de/peaktv/launcher/HomeGrid.kt`
- [Home layout](https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/Layout.kt): `launcher/src/main/kotlin/de/peaktv/launcher/Layout.kt`
- [Edge dock](https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/DockService.kt): `launcher/src/main/kotlin/de/peaktv/launcher/DockService.kt`
- [Control center](https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/ControlCenterActivity.kt): `launcher/src/main/kotlin/de/peaktv/launcher/ControlCenterActivity.kt`
- [Settings](https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/SettingsActivity.kt): `launcher/src/main/kotlin/de/peaktv/launcher/SettingsActivity.kt`
- [Preferences](https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/Prefs.kt): `launcher/src/main/kotlin/de/peaktv/launcher/Prefs.kt`
- [Weather](https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/Weather.kt): `launcher/src/main/kotlin/de/peaktv/launcher/Weather.kt`
- [Network client](https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/Net.kt): `launcher/src/main/kotlin/de/peaktv/launcher/Net.kt`
- [Release updater](https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/Updater.kt): `launcher/src/main/kotlin/de/peaktv/launcher/Updater.kt`
- [Standby policy](https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/Standby.kt): `launcher/src/main/kotlin/de/peaktv/launcher/Standby.kt`
- [Performance overlay](https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/PerfOverlayService.kt): `launcher/src/main/kotlin/de/peaktv/launcher/PerfOverlayService.kt`
- [Root key input](https://github.com/snippe187/peaktv/blob/main/launcher/src/main/kotlin/de/peaktv/launcher/RootKeys.kt): `launcher/src/main/kotlin/de/peaktv/launcher/RootKeys.kt`

### Casting

- [Cast receiver](https://github.com/snippe187/peaktv/blob/main/cast/src/main/kotlin/de/peaktv/cast/ReceiverActivity.kt): `cast/src/main/kotlin/de/peaktv/cast/ReceiverActivity.kt`
- [Cast listener](https://github.com/snippe187/peaktv/blob/main/cast/src/main/kotlin/de/peaktv/cast/CastService.kt): `cast/src/main/kotlin/de/peaktv/cast/CastService.kt`
- [Receiver overview](https://github.com/snippe187/peaktv/blob/main/cast/src/main/kotlin/de/peaktv/cast/Overview.kt): `cast/src/main/kotlin/de/peaktv/cast/Overview.kt`
- [Media sharing](https://github.com/snippe187/peaktv/blob/main/cast/src/main/kotlin/de/peaktv/cast/Share.kt): `cast/src/main/kotlin/de/peaktv/cast/Share.kt`
- [Photo viewer](https://github.com/snippe187/peaktv/blob/main/cast/src/main/kotlin/de/peaktv/cast/PhotoActivity.kt): `cast/src/main/kotlin/de/peaktv/cast/PhotoActivity.kt`

### Remote Control

- [Phone remote](https://github.com/snippe187/peaktv/blob/main/remote/src/main/kotlin/de/peaktv/remote/MainActivity.kt): `remote/src/main/kotlin/de/peaktv/remote/MainActivity.kt`
- [Remote connection](https://github.com/snippe187/peaktv/blob/main/remote/src/main/kotlin/de/peaktv/remote/Conn.kt): `remote/src/main/kotlin/de/peaktv/remote/Conn.kt`
- [Remote sharing](https://github.com/snippe187/peaktv/blob/main/remote/src/main/kotlin/de/peaktv/remote/ShareClient.kt): `remote/src/main/kotlin/de/peaktv/remote/ShareClient.kt`

### PC Sender

- [Windows sender](https://github.com/snippe187/peaktv/blob/main/pc/PeakTVCast.cs): `pc/PeakTVCast.cs`

### Other components

- **TV user**
- **FFmpeg**
- **Phone user**

## Connections

- TV user → Profile picker: chooses profile (evidence: `launcher/src/main/kotlin/de/peaktv/launcher/ProfileActivity.kt`)
- Profile picker → Profiles: selects and saves (evidence: `launcher/src/main/kotlin/de/peaktv/launcher/ProfileActivity.kt`)
- Profile picker → Home screen: opens home (evidence: `launcher/src/main/kotlin/de/peaktv/launcher/ProfileActivity.kt`)
- Home screen → Profiles: loads profile (evidence: `launcher/src/main/kotlin/de/peaktv/launcher/HomeActivity.kt`)
- Home screen → Installed apps: loads apps (evidence: `launcher/src/main/kotlin/de/peaktv/launcher/HomeActivity.kt`)
- Home screen → App grid: builds grid (evidence: `launcher/src/main/kotlin/de/peaktv/launcher/HomeActivity.kt`)
- App grid → Home layout: uses layout (evidence: `launcher/src/main/kotlin/de/peaktv/launcher/HomeGrid.kt`)
- Home screen → Weather: refreshes weather (evidence: `launcher/src/main/kotlin/de/peaktv/launcher/HomeActivity.kt`)
- Weather → Network client: fetches data (evidence: `launcher/src/main/kotlin/de/peaktv/launcher/Weather.kt`)
- Home screen → Edge dock: starts dock (evidence: `launcher/src/main/kotlin/de/peaktv/launcher/HomeActivity.kt`)
- Edge dock → Control center: opens controls (evidence: `launcher/src/main/kotlin/de/peaktv/launcher/DockService.kt`)
- Control center → Settings: opens settings (evidence: `launcher/src/main/kotlin/de/peaktv/launcher/ControlCenterActivity.kt`)
- Settings → Preferences: updates preferences (evidence: `launcher/src/main/kotlin/de/peaktv/launcher/SettingsActivity.kt`)
- Settings → Release updater: invokes updater (evidence: `launcher/src/main/kotlin/de/peaktv/launcher/SettingsActivity.kt`)
- Release updater → Preferences: reads configuration (evidence: `launcher/src/main/kotlin/de/peaktv/launcher/Updater.kt`)
- Release updater → Network client: checks releases (evidence: `launcher/src/main/kotlin/de/peaktv/launcher/Updater.kt`)
- Control center → Standby policy: requests standby (evidence: `launcher/src/main/kotlin/de/peaktv/launcher/ControlCenterActivity.kt`)
- Standby policy → Preferences: reads timeout (evidence: `launcher/src/main/kotlin/de/peaktv/launcher/Standby.kt`)
- Home screen → Performance overlay: syncs overlay (evidence: `launcher/src/main/kotlin/de/peaktv/launcher/HomeActivity.kt`)
- Performance overlay → Preferences: checks enabled (evidence: `launcher/src/main/kotlin/de/peaktv/launcher/PerfOverlayService.kt`)
- Control center → Root key input: dispatches key (evidence: `launcher/src/main/kotlin/de/peaktv/launcher/ControlCenterActivity.kt`)
- Cast listener → Cast receiver: opens on sender (evidence: `cast/src/main/kotlin/de/peaktv/cast/CastService.kt`)
- Cast receiver → Cast listener: starts listener (evidence: `cast/src/main/kotlin/de/peaktv/cast/ReceiverActivity.kt`)
- Cast receiver → Receiver overview: shows overview (evidence: `cast/src/main/kotlin/de/peaktv/cast/ReceiverActivity.kt`)
- Media sharing → Photo viewer: opens photos (evidence: `cast/src/main/kotlin/de/peaktv/cast/Share.kt`)
- Windows sender → Cast receiver: streams media (evidence: `README.md`)
- Windows sender → FFmpeg: uses encoder (evidence: `README.md`)
- Phone user → Phone remote: controls box (evidence: `README.md`)
- Phone remote → Remote connection: uses connection (evidence: `remote/src/main/kotlin/de/peaktv/remote/MainActivity.kt`)
- Phone remote → Remote sharing: shares media (evidence: `remote/src/main/kotlin/de/peaktv/remote/MainActivity.kt`)
- Phone remote → Standby policy: requests standby (evidence: `remote/src/main/kotlin/de/peaktv/remote/MainActivity.kt`)
- Phone remote → Media sharing: shares to receiver (evidence: `README.md`)
