# shadesofdeath/shadetube architecture

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

- Interactive diagram: https://gitdiagram.com/shadesofdeath/shadetube
- Repository: https://github.com/shadesofdeath/shadetube

## Overview

ShadeTube is a native music player that uses Spotify for a user’s library and YouTube for matching recordings and audio. The main path is library selection, recording match, stream resolution, decoding and playback. The README also documents YouTube Music browsing, podcasts, downloads and local files, listening together, phone remote, casting, radio, and extensive audio processing. The graph combines those documented capabilities with sampled composition and playback code; unsampled feature internals are represented by their exact source paths, and links not established by excerpts are documented from the README.

Main entry points: [`src/player/Player.cpp`](https://github.com/shadesofdeath/shadetube/blob/main/src/player/Player.cpp) (Player and queue), [`src/app/App.cpp`](https://github.com/shadesofdeath/shadetube/blob/main/src/app/App.cpp) (App composition), [`src/audio/AudioEngine.cpp`](https://github.com/shadesofdeath/shadetube/blob/main/src/audio/AudioEngine.cpp) (Audio engine), [`src/youtube/MatchService.cpp`](https://github.com/shadesofdeath/shadetube/blob/main/src/youtube/MatchService.cpp) (Recording match)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and library"]
  node_app["App composition<br/>[App.cpp]"]
  node_player["Player and queue<br/>[Player.cpp]"]
  node_spotify["Spotify session<br/>[Session.cpp]"]
end

subgraph group_catalog["Catalog and discovery"]
  node_ytmusic["YouTube Music catalog<br/>[YtMusic.cpp]"]
  node_search["Catalog search<br/>[SearchClient.cpp]"]
  node_match["Recording match<br/>[MatchService.cpp]"]
end

subgraph group_playback["Playback and audio"]
  node_engine["Audio engine<br/>[AudioEngine.cpp]"]
  node_decoder["Media decoding<br/>[Decoder.cpp]"]
  node_audioout["Audio output"]
  node_processing["Audio processing<br/>[Equalizer.cpp]"]
end

subgraph group_sharing["Sharing and devices"]
  node_together["Listen together<br/>[Together.cpp]"]
  node_remote["Phone remote<br/>[RemoteServer.cpp]"]
  node_casting["Device casting<br/>[Casting.cpp]"]
end

subgraph group_media["Media management"]
  node_podcasts["Podcasts and feeds<br/>[Podcasts.cpp]"]
  node_audiobooks["Audiobooks<br/>[Audiobooks.cpp]"]
  node_downloads["Downloads and sync<br/>[Downloads.cpp]"]
  node_local["Local library<br/>[LocalLibrary.cpp]"]
  node_radio["Internet radio<br/>[InternetRadio.cpp]"]
end

node_user(("Listener"))
node_youtube["YouTube services"]
node_devices["Playback devices"]

node_user -->|"uses"| node_app
node_app -.->|"controls"| node_player
node_app -->|"signs in"| node_spotify
node_spotify -->|"provides library"| node_player
node_app -->|"browses"| node_ytmusic
node_player -->|"requests match"| node_match
node_match -->|"finds recording"| node_youtube
node_match -.->|"searches candidates"| node_search
node_youtube -->|"provides stream"| node_engine
node_engine -->|"decodes stream"| node_decoder
node_engine -->|"processes audio"| node_processing
node_engine -->|"renders audio"| node_audioout
node_user -->|"browses"| node_podcasts
node_user -->|"browses"| node_audiobooks
node_player -->|"queues downloads"| node_downloads
node_user -->|"opens files"| node_local
node_user -->|"browses stations"| node_radio
node_user -->|"starts session"| node_together
node_together -->|"shares playback"| node_player
node_user -->|"controls remotely"| node_remote
node_remote -->|"controls playback"| node_player
node_user -->|"selects device"| node_casting
node_casting -->|"streams to"| node_devices
node_casting -->|"returns playback"| node_player

click node_app "https://github.com/shadesofdeath/shadetube/blob/main/src/app/App.cpp"
click node_player "https://github.com/shadesofdeath/shadetube/blob/main/src/player/Player.cpp"
click node_spotify "https://github.com/shadesofdeath/shadetube/blob/main/src/spotify/Session.cpp"
click node_ytmusic "https://github.com/shadesofdeath/shadetube/blob/main/src/ytmusic/YtMusic.cpp"
click node_search "https://github.com/shadesofdeath/shadetube/blob/main/external/YoutubeExplode/src/Search/SearchClient.cpp"
click node_match "https://github.com/shadesofdeath/shadetube/blob/main/src/youtube/MatchService.cpp"
click node_engine "https://github.com/shadesofdeath/shadetube/blob/main/src/audio/AudioEngine.cpp"
click node_decoder "https://github.com/shadesofdeath/shadetube/blob/main/src/audio/Decoder.cpp"
click node_audioout "https://github.com/shadesofdeath/shadetube/blob/main/src/audio/MiniaudioOutput.cpp"
click node_processing "https://github.com/shadesofdeath/shadetube/blob/main/src/audio/Equalizer.cpp"
click node_podcasts "https://github.com/shadesofdeath/shadetube/blob/main/src/app/Podcasts.cpp"
click node_audiobooks "https://github.com/shadesofdeath/shadetube/blob/main/src/app/Audiobooks.cpp"
click node_downloads "https://github.com/shadesofdeath/shadetube/blob/main/src/app/Downloads.cpp"
click node_local "https://github.com/shadesofdeath/shadetube/blob/main/src/app/LocalLibrary.cpp"
click node_radio "https://github.com/shadesofdeath/shadetube/blob/main/src/app/InternetRadio.cpp"
click node_together "https://github.com/shadesofdeath/shadetube/blob/main/src/app/Together.cpp"
click node_remote "https://github.com/shadesofdeath/shadetube/blob/main/src/app/RemoteServer.cpp"
click node_casting "https://github.com/shadesofdeath/shadetube/blob/main/src/app/Casting.cpp"

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_player,node_spotify toneBlue
class node_ytmusic,node_search,node_match toneAmber
class node_engine,node_decoder,node_audioout,node_processing toneMint
class node_together,node_remote,node_casting toneRose
class node_podcasts,node_audiobooks,node_downloads,node_local,node_radio,node_user,node_youtube,node_devices toneIndigo
```

## Components

### App and library

- [App composition](https://github.com/shadesofdeath/shadetube/blob/main/src/app/App.cpp): `src/app/App.cpp`
- [Player and queue](https://github.com/shadesofdeath/shadetube/blob/main/src/player/Player.cpp): `src/player/Player.cpp`
- [Spotify session](https://github.com/shadesofdeath/shadetube/blob/main/src/spotify/Session.cpp): `src/spotify/Session.cpp`

### Catalog and discovery

- [YouTube Music catalog](https://github.com/shadesofdeath/shadetube/blob/main/src/ytmusic/YtMusic.cpp): `src/ytmusic/YtMusic.cpp`
- [Catalog search](https://github.com/shadesofdeath/shadetube/blob/main/external/YoutubeExplode/src/Search/SearchClient.cpp): `external/YoutubeExplode/src/Search/SearchClient.cpp`
- [Recording match](https://github.com/shadesofdeath/shadetube/blob/main/src/youtube/MatchService.cpp): `src/youtube/MatchService.cpp`

### Playback and audio

- [Audio engine](https://github.com/shadesofdeath/shadetube/blob/main/src/audio/AudioEngine.cpp): `src/audio/AudioEngine.cpp`
- [Media decoding](https://github.com/shadesofdeath/shadetube/blob/main/src/audio/Decoder.cpp): `src/audio/Decoder.cpp`
- [Audio output](https://github.com/shadesofdeath/shadetube/blob/main/src/audio/MiniaudioOutput.cpp): `src/audio/MiniaudioOutput.cpp`
- [Audio processing](https://github.com/shadesofdeath/shadetube/blob/main/src/audio/Equalizer.cpp): `src/audio/Equalizer.cpp`

### Sharing and devices

- [Listen together](https://github.com/shadesofdeath/shadetube/blob/main/src/app/Together.cpp): `src/app/Together.cpp`
- [Phone remote](https://github.com/shadesofdeath/shadetube/blob/main/src/app/RemoteServer.cpp): `src/app/RemoteServer.cpp`
- [Device casting](https://github.com/shadesofdeath/shadetube/blob/main/src/app/Casting.cpp): `src/app/Casting.cpp`

### Media management

- [Podcasts and feeds](https://github.com/shadesofdeath/shadetube/blob/main/src/app/Podcasts.cpp): `src/app/Podcasts.cpp`
- [Audiobooks](https://github.com/shadesofdeath/shadetube/blob/main/src/app/Audiobooks.cpp): `src/app/Audiobooks.cpp`
- [Downloads and sync](https://github.com/shadesofdeath/shadetube/blob/main/src/app/Downloads.cpp): `src/app/Downloads.cpp`
- [Local library](https://github.com/shadesofdeath/shadetube/blob/main/src/app/LocalLibrary.cpp): `src/app/LocalLibrary.cpp`
- [Internet radio](https://github.com/shadesofdeath/shadetube/blob/main/src/app/InternetRadio.cpp): `src/app/InternetRadio.cpp`

### Other components

- **Listener**
- **YouTube services**
- **Playback devices**

## Connections

- Listener → App composition: uses (evidence: `README.md`)
- App composition → Player and queue: controls
- App composition → Spotify session: signs in (evidence: `README.md`)
- Spotify session → Player and queue: provides library (evidence: `README.md`)
- App composition → YouTube Music catalog: browses (evidence: `README.md`)
- Player and queue → Recording match: requests match (evidence: `README.md`)
- Recording match → YouTube services: finds recording (evidence: `README.md`)
- Recording match → Catalog search: searches candidates
- YouTube services → Audio engine: provides stream
- Audio engine → Media decoding: decodes stream
- Audio engine → Audio processing: processes audio
- Audio engine → Audio output: renders audio
- Listener → Podcasts and feeds: browses (evidence: `README.md`)
- Listener → Audiobooks: browses (evidence: `README.md`)
- Player and queue → Downloads and sync: queues downloads (evidence: `README.md`)
- Listener → Local library: opens files (evidence: `README.md`)
- Listener → Internet radio: browses stations (evidence: `README.md`)
- Listener → Listen together: starts session (evidence: `README.md`)
- Listen together → Player and queue: shares playback (evidence: `README.md`)
- Listener → Phone remote: controls remotely (evidence: `README.md`)
- Phone remote → Player and queue: controls playback (evidence: `README.md`)
- Listener → Device casting: selects device (evidence: `README.md`)
- Device casting → Playback devices: streams to (evidence: `README.md`)
- Device casting → Player and queue: returns playback (evidence: `README.md`)
