# tbeezy/ynotv architecture

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

- Interactive diagram: https://gitdiagram.com/tbeezy/ynotv
- Repository: https://github.com/tbeezy/ynotv

## Overview

ynoTV is a Windows desktop IPTV and media player: users configure sources, browse live channels and program guides or VOD catalogs, then play or record streams. The main workflow runs from the React app through source parsing and URL resolution to the embedded mpv player; SQLite-backed state supports channel, guide, and playback features. The README also documents local media, sports, DVR, and optional catalog/server integrations, represented as distinct capabilities. Several of those branches are supported by the README and file tree, but their internal call wiring was not sampled.

Main entry points: [`packages/ui/src/App.tsx`](https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/App.tsx) (App workflow), [`packages/ui/src/db/index.ts`](https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/db/index.ts) (SQLite state), [`packages/local-adapter/src/index.ts`](https://github.com/tbeezy/ynotv/blob/main/packages/local-adapter/src/index.ts) (Playlist adapters), [`packages/ui/src/services/epg-streaming.ts`](https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/services/epg-streaming.ts) (EPG guide)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Desktop client"]
  node_app["App workflow<br/>[App.tsx]"]
  node_settings["Preferences<br/>[settingsStore.ts]"]
  node_database[("SQLite state<br/>[index.ts]")]
end

subgraph group_live["Live TV"]
  node_source_adapters["Playlist adapters<br/>[index.ts]"]
  node_epg["EPG guide<br/>[epg-streaming.ts]"]
  node_channel_admin["Channel management"]
  node_failover["Stream failover<br/>[failover-groups.ts]"]
end

subgraph group_media["Media playback"]
  node_stream_resolution["URL resolution<br/>[stream-resolver.ts]"]
  node_player_ui["Playback controls<br/>[usePlayback.ts]"]
  node_dvr["DVR recording<br/>[mod.rs]"]
  node_cast["Device casting<br/>[cast.rs]"]
end

subgraph group_library["Libraries and discovery"]
  node_vod["VOD catalog<br/>[VodPage.tsx]"]
  node_metadata["Media metadata<br/>[tmdb.ts]"]
  node_local_library["Local library<br/>[local-library.ts]"]
  node_sports["Sports hub<br/>[SportsHub.tsx]"]
  node_stremio["Stremio catalogs<br/>[stremio-api.ts]"]
  node_nuvio["Nuvio integration<br/>[nuvio-api.ts]"]
  node_jellyfin["Jellyfin integration<br/>[jellyfin.ts]"]
end

subgraph group_native["Native services"]
  node_mpv["Embedded mpv<br/>[mpv_core.rs]"]
  node_native_bridge["Tauri bridge<br/>[tauri-bridge.ts]"]
end

node_viewer(("Viewer"))
node_external_services{{"Media services"}}

node_viewer -->|"uses"| node_app
node_app -->|"reads preferences"| node_settings
node_app -->|"reads state"| node_database
node_app -->|"loads sources"| node_source_adapters
node_source_adapters -->|"stores channel data"| node_database
node_app -->|"loads guide"| node_epg
node_epg -->|"stores guide data"| node_database
node_app -->|"opens management"| node_channel_admin
node_channel_admin -->|"updates categories"| node_database
node_app -->|"resolves playback URL"| node_stream_resolution
node_app -->|"controls playback"| node_player_ui
node_player_ui -->|"sends playback commands"| node_native_bridge
node_native_bridge -->|"invokes native player"| node_mpv
node_app -->|"starts or schedules recordings"| node_dvr
node_dvr -->|"stores recordings"| node_database
node_app -->|"casts stream"| node_cast
node_app -->|"browses VOD"| node_vod
node_vod -->|"loads metadata"| node_metadata
node_metadata -.->|"queries catalog services"| node_external_services
node_app -->|"browses local media"| node_local_library
node_local_library -->|"stores library state"| node_database
node_app -->|"opens sports"| node_sports
node_sports -.->|"loads scores and news"| node_external_services
node_app -.->|"uses catalogs"| node_stremio
node_stremio -.->|"contacts addons and account"| node_external_services
node_app -.->|"syncs account data"| node_nuvio
node_nuvio -.->|"syncs cloud data"| node_external_services
node_app -.->|"browses and plays server media"| node_jellyfin
node_jellyfin -.->|"contacts server"| node_external_services
node_stream_resolution -->|"resolves stream sources"| node_external_services

click node_app "https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/App.tsx"
click node_settings "https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/stores/settingsStore.ts"
click node_database "https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/db/index.ts"
click node_source_adapters "https://github.com/tbeezy/ynotv/blob/main/packages/local-adapter/src/index.ts"
click node_epg "https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/services/epg-streaming.ts"
click node_channel_admin "https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/components/settings/CategoryManager.tsx"
click node_failover "https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/services/failover-groups.ts"
click node_stream_resolution "https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/services/stream-resolver.ts"
click node_player_ui "https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/hooks/usePlayback.ts"
click node_mpv "https://github.com/tbeezy/ynotv/blob/main/packages/app/src-tauri/src/mpv_core.rs"
click node_dvr "https://github.com/tbeezy/ynotv/blob/main/packages/app/src-tauri/src/dvr/mod.rs"
click node_cast "https://github.com/tbeezy/ynotv/blob/main/packages/app/src-tauri/src/cast.rs"
click node_vod "https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/components/VodPage.tsx"
click node_metadata "https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/services/tmdb.ts"
click node_local_library "https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/services/local-library/local-library.ts"
click node_sports "https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/components/sports/SportsHub.tsx"
click node_stremio "https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/services/stremio-api.ts"
click node_nuvio "https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/services/nuvio-api.ts"
click node_jellyfin "https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/services/jellyfin.ts"
click node_native_bridge "https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/services/tauri-bridge.ts"

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_app,node_settings,node_database,node_viewer toneBlue
class node_source_adapters,node_epg,node_channel_admin,node_failover toneAmber
class node_stream_resolution,node_player_ui,node_dvr,node_cast toneMint
class node_vod,node_metadata,node_local_library,node_sports,node_stremio,node_nuvio,node_jellyfin toneRose
class node_mpv,node_native_bridge,node_external_services toneIndigo
```

## Components

### Desktop client

- [App workflow](https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/App.tsx): `packages/ui/src/App.tsx`
- [Preferences](https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/stores/settingsStore.ts): `packages/ui/src/stores/settingsStore.ts`
- [SQLite state](https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/db/index.ts): `packages/ui/src/db/index.ts`

### Live TV

- [Playlist adapters](https://github.com/tbeezy/ynotv/blob/main/packages/local-adapter/src/index.ts): `packages/local-adapter/src/index.ts`
- [EPG guide](https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/services/epg-streaming.ts): `packages/ui/src/services/epg-streaming.ts`
- [Channel management](https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/components/settings/CategoryManager.tsx): `packages/ui/src/components/settings/CategoryManager.tsx`
- [Stream failover](https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/services/failover-groups.ts): `packages/ui/src/services/failover-groups.ts`

### Media playback

- [URL resolution](https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/services/stream-resolver.ts): `packages/ui/src/services/stream-resolver.ts`
- [Playback controls](https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/hooks/usePlayback.ts): `packages/ui/src/hooks/usePlayback.ts`
- [DVR recording](https://github.com/tbeezy/ynotv/blob/main/packages/app/src-tauri/src/dvr/mod.rs): `packages/app/src-tauri/src/dvr/mod.rs`
- [Device casting](https://github.com/tbeezy/ynotv/blob/main/packages/app/src-tauri/src/cast.rs): `packages/app/src-tauri/src/cast.rs`

### Libraries and discovery

- [VOD catalog](https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/components/VodPage.tsx): `packages/ui/src/components/VodPage.tsx`
- [Media metadata](https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/services/tmdb.ts): `packages/ui/src/services/tmdb.ts`
- [Local library](https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/services/local-library/local-library.ts): `packages/ui/src/services/local-library/local-library.ts`
- [Sports hub](https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/components/sports/SportsHub.tsx): `packages/ui/src/components/sports/SportsHub.tsx`
- [Stremio catalogs](https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/services/stremio-api.ts): `packages/ui/src/services/stremio-api.ts`
- [Nuvio integration](https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/services/nuvio-api.ts): `packages/ui/src/services/nuvio-api.ts`
- [Jellyfin integration](https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/services/jellyfin.ts): `packages/ui/src/services/jellyfin.ts`

### Native services

- [Embedded mpv](https://github.com/tbeezy/ynotv/blob/main/packages/app/src-tauri/src/mpv_core.rs): `packages/app/src-tauri/src/mpv_core.rs`
- [Tauri bridge](https://github.com/tbeezy/ynotv/blob/main/packages/ui/src/services/tauri-bridge.ts): `packages/ui/src/services/tauri-bridge.ts`

### Other components

- **Viewer**
- **Media services**

## Connections

- Viewer → App workflow: uses
- App workflow → Preferences: reads preferences
- App workflow → SQLite state: reads state
- App workflow → Playlist adapters: loads sources
- Playlist adapters → SQLite state: stores channel data
- App workflow → EPG guide: loads guide
- EPG guide → SQLite state: stores guide data
- App workflow → Channel management: opens management
- Channel management → SQLite state: updates categories
- App workflow → URL resolution: resolves playback URL
- App workflow → Playback controls: controls playback
- Playback controls → Tauri bridge: sends playback commands
- Tauri bridge → Embedded mpv: invokes native player
- App workflow → DVR recording: starts or schedules recordings
- DVR recording → SQLite state: stores recordings
- App workflow → Device casting: casts stream
- App workflow → VOD catalog: browses VOD
- VOD catalog → Media metadata: loads metadata
- Media metadata → Media services: queries catalog services
- App workflow → Local library: browses local media
- Local library → SQLite state: stores library state
- App workflow → Sports hub: opens sports
- Sports hub → Media services: loads scores and news
- App workflow → Stremio catalogs: uses catalogs
- Stremio catalogs → Media services: contacts addons and account
- App workflow → Nuvio integration: syncs account data
- Nuvio integration → Media services: syncs cloud data
- App workflow → Jellyfin integration: browses and plays server media
- Jellyfin integration → Media services: contacts server
- URL resolution → Media services: resolves stream sources
