# avaneesh-inamdar/stream-tube-desktop architecture

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

- Interactive diagram: https://gitdiagram.com/avaneesh-inamdar/stream-tube-desktop
- Repository: https://github.com/avaneesh-inamdar/stream-tube-desktop

## Overview

Stream Tube is a native desktop YouTube client. Users browse feeds, search, channels, playlists, and Shorts; select a video; then play it with queue, captions, and playback controls. The UI also supports account sign-in, music, downloads, and settings. The diagram follows relationships evidenced by the excerpts, SOURCE INDEX references, or README; some feature implementations are unsampled, so their internal links are omitted. Optional external playback and integrations are documented capabilities, not inferred call chains.

Main entry points: [`src/ui/app.rs`](https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/ui/app.rs) (App shell), [`src/player/controller.rs`](https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/player/controller.rs) (Player controller), [`src/ui/pages/watch.rs`](https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/ui/pages/watch.rs) (Watch page), [`src/api/auth.rs`](https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/api/auth.rs) (Account sign-in)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Browsing and UI"]
  node_shell["App shell<br/>[app.rs]"]
  node_search["Search page<br/>[search.rs]"]
  node_watch["Watch page<br/>[watch.rs]"]
  node_shorts["Shorts<br/>[shorts.rs]"]
  node_subscriptions["Subscriptions<br/>[subscriptions.rs]"]
  node_playlist["Playlist page<br/>[playlist.rs]"]
  node_cards["Content cards<br/>[cards.rs]"]
  node_widgets["UI widgets<br/>[widgets.rs]"]
  node_music["Music mode<br/>[music.rs]"]
end

subgraph group_youtube["YouTube access"]
  node_auth["Account sign-in<br/>[auth.rs]"]
  node_innertube["YouTube API<br/>[innertube.rs]"]
  node_webapi["Website session API<br/>[web.rs]"]
  node_http["HTTP client<br/>[http.rs]"]
  node_services["Video enhancements<br/>[services.rs]"]
end

subgraph group_playback["Playback and media"]
  node_streams["Stream extraction<br/>[streams.rs]"]
  node_controller["Player controller<br/>[controller.rs]"]
  node_proxy["Stream proxy<br/>[proxy.rs]"]
  node_downloads["Download manager<br/>[downloads.rs]"]
  node_externalplayer["External player"]
end

subgraph group_state["Local state"]
  node_store[("SQLite and settings<br/>[store.rs]")]
  node_updater["In-app updates<br/>[updater.rs]"]
end

node_user(("Viewer"))

node_user -->|"uses"| node_shell
node_shell -->|"routes to"| node_search
node_shell -->|"routes to"| node_watch
node_shell -->|"routes to"| node_shorts
node_shell -->|"routes to"| node_subscriptions
node_shell -->|"routes to"| node_playlist
node_search -->|"requests results"| node_innertube
node_search -->|"renders results"| node_cards
node_watch -->|"controls playback"| node_controller
node_watch -->|"requests video data"| node_innertube
node_watch -->|"renders content"| node_cards
node_watch -->|"opens mode"| node_music
node_shell -->|"starts sign-in"| node_auth
node_shell -->|"manages downloads"| node_downloads
node_cards -->|"uses"| node_widgets
node_cards -->|"reads history"| node_store
node_innertube -->|"sends requests"| node_http
node_auth -->|"sends requests"| node_http
node_auth -->|"collects feed items"| node_innertube
node_auth -->|"persists session"| node_store
node_webapi -->|"sends requests"| node_http
node_services -->|"fetches enhancements"| node_http
node_controller -->|"selects streams"| node_streams
node_controller -->|"uses segments"| node_services
node_controller -->|"stores progress"| node_store
node_controller -->|"uses proxy"| node_proxy
node_downloads -->|"gets streams"| node_streams
node_downloads -->|"records state"| node_store
node_controller -.->|"can launch"| node_externalplayer
node_shell -->|"checks updates"| node_updater
node_music -->|"controls playback"| node_controller

click node_shell "https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/ui/app.rs"
click node_search "https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/ui/pages/search.rs"
click node_watch "https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/ui/pages/watch.rs"
click node_shorts "https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/ui/pages/shorts.rs"
click node_subscriptions "https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/ui/pages/subscriptions.rs"
click node_playlist "https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/ui/pages/playlist.rs"
click node_cards "https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/ui/cards.rs"
click node_widgets "https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/ui/widgets.rs"
click node_music "https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/ui/music.rs"
click node_auth "https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/api/auth.rs"
click node_innertube "https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/api/innertube.rs"
click node_webapi "https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/api/web.rs"
click node_http "https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/api/http.rs"
click node_services "https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/api/services.rs"
click node_streams "https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/api/streams.rs"
click node_controller "https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/player/controller.rs"
click node_proxy "https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/player/proxy.rs"
click node_downloads "https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/downloads.rs"
click node_store "https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/store.rs"
click node_updater "https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/updater.rs"

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_shell,node_search,node_watch,node_shorts,node_subscriptions,node_playlist,node_cards,node_widgets,node_music,node_user toneBlue
class node_auth,node_innertube,node_webapi,node_http,node_services toneAmber
class node_streams,node_controller,node_proxy,node_downloads,node_externalplayer toneMint
class node_store,node_updater toneRose
```

## Components

### Browsing and UI

- [App shell](https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/ui/app.rs): `src/ui/app.rs`
- [Search page](https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/ui/pages/search.rs): `src/ui/pages/search.rs`
- [Watch page](https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/ui/pages/watch.rs): `src/ui/pages/watch.rs`
- [Shorts](https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/ui/pages/shorts.rs): `src/ui/pages/shorts.rs`
- [Subscriptions](https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/ui/pages/subscriptions.rs): `src/ui/pages/subscriptions.rs`
- [Playlist page](https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/ui/pages/playlist.rs): `src/ui/pages/playlist.rs`
- [Content cards](https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/ui/cards.rs): `src/ui/cards.rs`
- [UI widgets](https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/ui/widgets.rs): `src/ui/widgets.rs`
- [Music mode](https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/ui/music.rs): `src/ui/music.rs`

### YouTube access

- [Account sign-in](https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/api/auth.rs): `src/api/auth.rs`
- [YouTube API](https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/api/innertube.rs): `src/api/innertube.rs`
- [Website session API](https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/api/web.rs): `src/api/web.rs`
- [HTTP client](https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/api/http.rs): `src/api/http.rs`
- [Video enhancements](https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/api/services.rs): `src/api/services.rs`

### Playback and media

- [Stream extraction](https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/api/streams.rs): `src/api/streams.rs`
- [Player controller](https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/player/controller.rs): `src/player/controller.rs`
- [Stream proxy](https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/player/proxy.rs): `src/player/proxy.rs`
- [Download manager](https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/downloads.rs): `src/downloads.rs`
- **External player**

### Local state

- [SQLite and settings](https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/store.rs): `src/store.rs`
- [In-app updates](https://github.com/avaneesh-inamdar/stream-tube-desktop/blob/main/src/updater.rs): `src/updater.rs`

### Other components

- **Viewer**

## Connections

- Viewer → App shell: uses
- App shell → Search page: routes to (evidence: `src/ui/app.rs`)
- App shell → Watch page: routes to (evidence: `src/ui/app.rs`)
- App shell → Shorts: routes to (evidence: `src/ui/app.rs`)
- App shell → Subscriptions: routes to (evidence: `src/ui/app.rs`)
- App shell → Playlist page: routes to (evidence: `src/ui/app.rs`)
- Search page → YouTube API: requests results (evidence: `src/ui/pages/search.rs`)
- Search page → Content cards: renders results (evidence: `src/ui/pages/search.rs`)
- Watch page → Player controller: controls playback (evidence: `src/ui/pages/watch.rs`)
- Watch page → YouTube API: requests video data (evidence: `src/ui/pages/watch.rs`)
- Watch page → Content cards: renders content (evidence: `src/ui/pages/watch.rs`)
- Watch page → Music mode: opens mode (evidence: `src/ui/pages/watch.rs`)
- App shell → Account sign-in: starts sign-in (evidence: `src/ui/app.rs`)
- App shell → Download manager: manages downloads (evidence: `src/ui/app.rs`)
- Content cards → UI widgets: uses (evidence: `src/ui/cards.rs`)
- Content cards → SQLite and settings: reads history (evidence: `src/ui/cards.rs`)
- YouTube API → HTTP client: sends requests (evidence: `src/api/innertube.rs`)
- Account sign-in → HTTP client: sends requests (evidence: `src/api/auth.rs`)
- Account sign-in → YouTube API: collects feed items (evidence: `src/api/auth.rs`)
- Account sign-in → SQLite and settings: persists session (evidence: `src/api/auth.rs`)
- Website session API → HTTP client: sends requests (evidence: `src/api/web.rs`)
- Video enhancements → HTTP client: fetches enhancements (evidence: `src/api/services.rs`)
- Player controller → Stream extraction: selects streams (evidence: `src/player/controller.rs`)
- Player controller → Video enhancements: uses segments (evidence: `src/player/controller.rs`)
- Player controller → SQLite and settings: stores progress (evidence: `src/player/controller.rs`)
- Player controller → Stream proxy: uses proxy (evidence: `src/player/controller.rs`)
- Download manager → Stream extraction: gets streams (evidence: `src/downloads.rs`)
- Download manager → SQLite and settings: records state (evidence: `src/downloads.rs`)
- Player controller → External player: can launch
- App shell → In-app updates: checks updates (evidence: `src/ui/app.rs`)
- Music mode → Player controller: controls playback (evidence: `src/ui/music.rs`)
