# fwb50/cleanyourtv architecture

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

- Interactive diagram: https://gitdiagram.com/fwb50/cleanyourtv
- Repository: https://github.com/fwb50/cleanyourtv

## Overview

CleanYourTV replaces an Android TV’s ad-filled home screen with a launcher; the README’s user workflow is to back up device settings, disable selected preloaded packages, then install and set the launcher as Home. The repository also contains optional TV add-ons, including Frigate camera alerts, sports calendars, screensavers, and display controls. The available excerpts show parts of launcher key handling and several add-on internals, not the launcher’s full home-screen implementation or the setup scripts, so undocumented runtime links are omitted.

Main entry points: [`addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/GlanceService.java`](https://github.com/fwb50/cleanyourtv/blob/main/addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/GlanceService.java) (Glance service), [`addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/KeyService.java`](https://github.com/fwb50/cleanyourtv/blob/main/addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/KeyService.java) (Glance key service), [`launcher/app/src/main/java/com/gathin/tvhome/HomeKeyService.java`](https://github.com/fwb50/cleanyourtv/blob/main/launcher/app/src/main/java/com/gathin/tvhome/HomeKeyService.java) (Home key service), [`launcher/app/src/main/java/com/gathin/tvhome/RemoteKeys.java`](https://github.com/fwb50/cleanyourtv/blob/main/launcher/app/src/main/java/com/gathin/tvhome/RemoteKeys.java) (Remote key routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_launcher["Launcher input"]
  node_home_keys["Home key service"]
  node_input_keys["Input key service"]
  node_remote_keys["Remote key routing<br/>[RemoteKeys.java]"]
end

subgraph group_camera["Camera alerts"]
  node_frigate_service["Glance service<br/>[GlanceService.java]"]
  node_frigate_config["Glance config<br/>[GlanceConfig.java]"]
  node_frigate_store[("Config store<br/>[ConfigStore.java]")]
  node_detection["Detection parsing<br/>[Detection.java]"]
  node_review["Event review<br/>[Review.java]"]
  node_key_service["Glance key service<br/>[KeyService.java]"]
end

subgraph group_addons["TV add-ons"]
  node_dimming["Display dimming<br/>[Dimming.java]"]
  node_game_calendar["Sports calendar<br/>[Calendar.java]"]
  node_news["News screensaver<br/>[News.java]"]
  node_panchang["Panchang engine"]
  node_tatami_view["Floor-plan view math<br/>[View.java]"]
  node_scoreboard["Sports scoreboard"]
end

subgraph group_shared["Shared utility"]
  node_log["URL-safe logging<br/>[Log.kt]"]
end

node_tv_user(("TV user"))

node_tv_user -->|"presses remote"| node_home_keys
node_home_keys -->|"routes keys"| node_remote_keys
node_input_keys -->|"routes keys"| node_remote_keys
node_frigate_service -->|"uses settings"| node_frigate_config
node_frigate_service -->|"loads settings"| node_frigate_store
node_frigate_service -->|"parses messages"| node_detection
node_frigate_service -->|"handles reviews"| node_review
node_key_service -->|"dispatches actions"| node_frigate_service
node_key_service -->|"loads settings"| node_frigate_store
node_game_calendar -->|"supplies calendar"| node_scoreboard
node_news -.-> node_log

click node_home_keys "https://github.com/fwb50/cleanyourtv/blob/main/launcher/app/src/main/java/com/gathin/tvhome/HomeKeyService.java"
click node_input_keys "https://github.com/fwb50/cleanyourtv/blob/main/launcher/app/src/main/java/com/gathin/tvhome/InputKeyService.java"
click node_remote_keys "https://github.com/fwb50/cleanyourtv/blob/main/launcher/app/src/main/java/com/gathin/tvhome/RemoteKeys.java"
click node_frigate_service "https://github.com/fwb50/cleanyourtv/blob/main/addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/GlanceService.java"
click node_frigate_config "https://github.com/fwb50/cleanyourtv/blob/main/addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/GlanceConfig.java"
click node_frigate_store "https://github.com/fwb50/cleanyourtv/blob/main/addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/ConfigStore.java"
click node_detection "https://github.com/fwb50/cleanyourtv/blob/main/addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/Detection.java"
click node_review "https://github.com/fwb50/cleanyourtv/blob/main/addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/Review.java"
click node_key_service "https://github.com/fwb50/cleanyourtv/blob/main/addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/KeyService.java"
click node_dimming "https://github.com/fwb50/cleanyourtv/blob/main/addons/brightness/app/src/main/java/io/github/maxhayim/brightness/Dimming.java"
click node_game_calendar "https://github.com/fwb50/cleanyourtv/blob/main/addons/game-day/app/src/main/java/io/github/justinnewman/gameday/Calendar.java"
click node_news "https://github.com/fwb50/cleanyourtv/blob/main/addons/news-screensaver/app/src/main/java/com/gathin/newsdream/News.java"
click node_panchang "https://github.com/fwb50/cleanyourtv/blob/main/addons/hindi-panchang/app/src/main/java/com/gathin/hindipanchang/PanchangEngine.java"
click node_tatami_view "https://github.com/fwb50/cleanyourtv/blob/main/addons/tatami/plan/src/main/java/io/github/pbanddev/tatami/View.java"
click node_scoreboard "https://github.com/fwb50/cleanyourtv/blob/main/addons/scoreboard/app/src/main/java/com/poppy/scoreboard/ScoreboardActivity.java"
click node_log "https://github.com/fwb50/cleanyourtv/blob/main/addons/tv-hub/app/src/main/java/io/github/maxhayim/tvhub/util/Log.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_home_keys,node_input_keys,node_remote_keys,node_tv_user toneBlue
class node_frigate_service,node_frigate_config,node_frigate_store,node_detection,node_review,node_key_service toneAmber
class node_dimming,node_game_calendar,node_news,node_panchang,node_tatami_view,node_scoreboard toneMint
class node_log toneRose
```

## Components

### Launcher input

- [Home key service](https://github.com/fwb50/cleanyourtv/blob/main/launcher/app/src/main/java/com/gathin/tvhome/HomeKeyService.java): `launcher/app/src/main/java/com/gathin/tvhome/HomeKeyService.java`
- [Input key service](https://github.com/fwb50/cleanyourtv/blob/main/launcher/app/src/main/java/com/gathin/tvhome/InputKeyService.java): `launcher/app/src/main/java/com/gathin/tvhome/InputKeyService.java`
- [Remote key routing](https://github.com/fwb50/cleanyourtv/blob/main/launcher/app/src/main/java/com/gathin/tvhome/RemoteKeys.java): `launcher/app/src/main/java/com/gathin/tvhome/RemoteKeys.java`

### Camera alerts

- [Glance service](https://github.com/fwb50/cleanyourtv/blob/main/addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/GlanceService.java): `addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/GlanceService.java`
- [Glance config](https://github.com/fwb50/cleanyourtv/blob/main/addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/GlanceConfig.java): `addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/GlanceConfig.java`
- [Config store](https://github.com/fwb50/cleanyourtv/blob/main/addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/ConfigStore.java): `addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/ConfigStore.java`
- [Detection parsing](https://github.com/fwb50/cleanyourtv/blob/main/addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/Detection.java): `addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/Detection.java`
- [Event review](https://github.com/fwb50/cleanyourtv/blob/main/addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/Review.java): `addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/Review.java`
- [Glance key service](https://github.com/fwb50/cleanyourtv/blob/main/addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/KeyService.java): `addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/KeyService.java`

### TV add-ons

- [Display dimming](https://github.com/fwb50/cleanyourtv/blob/main/addons/brightness/app/src/main/java/io/github/maxhayim/brightness/Dimming.java): `addons/brightness/app/src/main/java/io/github/maxhayim/brightness/Dimming.java`
- [Sports calendar](https://github.com/fwb50/cleanyourtv/blob/main/addons/game-day/app/src/main/java/io/github/justinnewman/gameday/Calendar.java): `addons/game-day/app/src/main/java/io/github/justinnewman/gameday/Calendar.java`
- [News screensaver](https://github.com/fwb50/cleanyourtv/blob/main/addons/news-screensaver/app/src/main/java/com/gathin/newsdream/News.java): `addons/news-screensaver/app/src/main/java/com/gathin/newsdream/News.java`
- [Panchang engine](https://github.com/fwb50/cleanyourtv/blob/main/addons/hindi-panchang/app/src/main/java/com/gathin/hindipanchang/PanchangEngine.java): `addons/hindi-panchang/app/src/main/java/com/gathin/hindipanchang/PanchangEngine.java`
- [Floor-plan view math](https://github.com/fwb50/cleanyourtv/blob/main/addons/tatami/plan/src/main/java/io/github/pbanddev/tatami/View.java): `addons/tatami/plan/src/main/java/io/github/pbanddev/tatami/View.java`
- [Sports scoreboard](https://github.com/fwb50/cleanyourtv/blob/main/addons/scoreboard/app/src/main/java/com/poppy/scoreboard/ScoreboardActivity.java): `addons/scoreboard/app/src/main/java/com/poppy/scoreboard/ScoreboardActivity.java`

### Shared utility

- [URL-safe logging](https://github.com/fwb50/cleanyourtv/blob/main/addons/tv-hub/app/src/main/java/io/github/maxhayim/tvhub/util/Log.kt): `addons/tv-hub/app/src/main/java/io/github/maxhayim/tvhub/util/Log.kt`

### Other components

- **TV user**

## Connections

- TV user → Home key service: presses remote (evidence: `README.md`)
- Home key service → Remote key routing: routes keys (evidence: `launcher/app/src/main/java/com/gathin/tvhome/HomeKeyService.java`)
- Input key service → Remote key routing: routes keys (evidence: `launcher/app/src/main/java/com/gathin/tvhome/InputKeyService.java`)
- Glance service → Glance config: uses settings (evidence: `addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/GlanceService.java`)
- Glance service → Config store: loads settings (evidence: `addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/GlanceService.java`)
- Glance service → Detection parsing: parses messages (evidence: `addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/GlanceService.java`)
- Glance service → Event review: handles reviews (evidence: `addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/GlanceService.java`)
- Glance key service → Glance service: dispatches actions (evidence: `addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/KeyService.java`)
- Glance key service → Config store: loads settings (evidence: `addons/frigate-glance/app/src/main/java/io/github/nickld/frigateglance/KeyService.java`)
- Sports calendar → Sports scoreboard: supplies calendar (evidence: `addons/scoreboard/app/src/main/java/com/poppy/scoreboard/ScoreboardActivity.java`)
- News screensaver → URL-safe logging (evidence: `addons/news-screensaver/app/src/main/java/com/gathin/newsdream/News.java`)
