# devhoss/blobtunes architecture

> Architecture diagram of the GitHub repository devhoss/blobtunes, 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/devhoss/blobtunes
- Repository: https://github.com/devhoss/blobtunes

## Overview

Blobtunes is a desktop, audio-only YouTube player. Its main workflow is paste a video URL or search YouTube, resolve a playable stream, manage tracks in the queue, and play/control audio through Rust-owned libmpv. The graph includes the frontend state and controls, backend resolution/playback, and documented Windows media-session/tray capabilities. Several Rust modules are represented from README descriptions and module declarations; their internal call wiring is not inferred where source excerpts were unavailable.

Main entry points: [`src/App.tsx`](https://github.com/devhoss/blobtunes/blob/main/src/App.tsx) (Player UI), [`src-tauri/src/lib.rs`](https://github.com/devhoss/blobtunes/blob/main/src-tauri/src/lib.rs) (Search commands), [`src-tauri/src/player.rs`](https://github.com/devhoss/blobtunes/blob/main/src-tauri/src/player.rs) (Playback engine), [`src-tauri/src/smtc.rs`](https://github.com/devhoss/blobtunes/blob/main/src-tauri/src/smtc.rs) (Media session)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Player interface"]
  node_app["Player UI<br/>[App.tsx]"]
  node_blob["Blob display<br/>[Blob.tsx]"]
  node_seek["Seek control<br/>[SquiggleSeek.tsx]"]
end

subgraph group_discovery["Discovery and queue"]
  node_queue["Queue state<br/>[queue.ts]"]
  node_searchnorm["Result mapping<br/>[search.ts]"]
  node_urlcheck["URL handling<br/>[youtube.ts]"]
  node_search["YouTube search<br/>[search.rs]"]
end

subgraph group_backend["Playback backend"]
  node_searchcmd["Search commands<br/>[lib.rs]"]
  node_probe["URL probe command<br/>[lib.rs]"]
  node_ytdlp["Stream resolution<br/>[ytdlp.rs]"]
  node_playercmd["Player commands<br/>[lib.rs]"]
  node_engine["Playback engine<br/>[player.rs]"]
end

subgraph group_platform["Windows integration"]
  node_smtc["Media session<br/>[smtc.rs]"]
  node_tray["Tray and window<br/>[tray.rs]"]
  node_profile["WebView profile<br/>[webview_profile.rs]"]
end

node_listener(("Listener"))
node_google["YouTube Data API"]
node_mpv["libmpv"]
node_windows["Windows media controls"]

node_listener -->|"uses"| node_app
node_app -->|"invokes search"| node_searchcmd
node_searchcmd -->|"calls"| node_search
node_search -->|"queries"| node_google
node_searchcmd -->|"returns results"| node_app
node_app -->|"maps results"| node_searchnorm
node_app -->|"updates tracks"| node_queue
node_app -->|"invokes probe"| node_probe
node_probe -->|"runs probe"| node_ytdlp
node_app -->|"sends controls"| node_playercmd
node_playercmd -->|"dispatches commands"| node_engine
node_engine -->|"controls audio"| node_mpv
node_app -->|"renders state"| node_blob
node_app -->|"renders progress"| node_seek
node_app -->|"validates links"| node_urlcheck
node_engine -->|"publishes playback"| node_smtc
node_smtc -->|"exposes controls"| node_windows
node_windows -->|"sends commands"| node_smtc
node_app -->|"sends session metadata"| node_playercmd
node_tray -->|"integrates tray"| node_windows
node_profile -->|"isolates WebView data"| node_windows

click node_app "https://github.com/devhoss/blobtunes/blob/main/src/App.tsx"
click node_blob "https://github.com/devhoss/blobtunes/blob/main/src/components/Blob.tsx"
click node_seek "https://github.com/devhoss/blobtunes/blob/main/src/components/SquiggleSeek.tsx"
click node_queue "https://github.com/devhoss/blobtunes/blob/main/src/lib/queue.ts"
click node_searchnorm "https://github.com/devhoss/blobtunes/blob/main/src/lib/search.ts"
click node_urlcheck "https://github.com/devhoss/blobtunes/blob/main/src/lib/youtube.ts"
click node_searchcmd "https://github.com/devhoss/blobtunes/blob/main/src-tauri/src/lib.rs"
click node_search "https://github.com/devhoss/blobtunes/blob/main/src-tauri/src/search.rs"
click node_probe "https://github.com/devhoss/blobtunes/blob/main/src-tauri/src/lib.rs"
click node_ytdlp "https://github.com/devhoss/blobtunes/blob/main/src-tauri/src/ytdlp.rs"
click node_playercmd "https://github.com/devhoss/blobtunes/blob/main/src-tauri/src/lib.rs"
click node_engine "https://github.com/devhoss/blobtunes/blob/main/src-tauri/src/player.rs"
click node_smtc "https://github.com/devhoss/blobtunes/blob/main/src-tauri/src/smtc.rs"
click node_tray "https://github.com/devhoss/blobtunes/blob/main/src-tauri/src/tray.rs"
click node_profile "https://github.com/devhoss/blobtunes/blob/main/src-tauri/src/webview_profile.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_app,node_blob,node_seek toneBlue
class node_queue,node_searchnorm,node_urlcheck,node_search toneAmber
class node_searchcmd,node_probe,node_ytdlp,node_playercmd,node_engine,node_google toneMint
class node_smtc,node_tray,node_profile toneRose
class node_listener,node_mpv,node_windows toneIndigo
```

## Components

### Player interface

- [Player UI](https://github.com/devhoss/blobtunes/blob/main/src/App.tsx): `src/App.tsx`
- [Blob display](https://github.com/devhoss/blobtunes/blob/main/src/components/Blob.tsx): `src/components/Blob.tsx`
- [Seek control](https://github.com/devhoss/blobtunes/blob/main/src/components/SquiggleSeek.tsx): `src/components/SquiggleSeek.tsx`

### Discovery and queue

- [Queue state](https://github.com/devhoss/blobtunes/blob/main/src/lib/queue.ts): `src/lib/queue.ts`
- [Result mapping](https://github.com/devhoss/blobtunes/blob/main/src/lib/search.ts): `src/lib/search.ts`
- [URL handling](https://github.com/devhoss/blobtunes/blob/main/src/lib/youtube.ts): `src/lib/youtube.ts`
- [YouTube search](https://github.com/devhoss/blobtunes/blob/main/src-tauri/src/search.rs): `src-tauri/src/search.rs`

### Playback backend

- [Search commands](https://github.com/devhoss/blobtunes/blob/main/src-tauri/src/lib.rs): `src-tauri/src/lib.rs`
- [URL probe command](https://github.com/devhoss/blobtunes/blob/main/src-tauri/src/lib.rs): `src-tauri/src/lib.rs`
- [Stream resolution](https://github.com/devhoss/blobtunes/blob/main/src-tauri/src/ytdlp.rs): `src-tauri/src/ytdlp.rs`
- [Player commands](https://github.com/devhoss/blobtunes/blob/main/src-tauri/src/lib.rs): `src-tauri/src/lib.rs`
- [Playback engine](https://github.com/devhoss/blobtunes/blob/main/src-tauri/src/player.rs): `src-tauri/src/player.rs`

### Windows integration

- [Media session](https://github.com/devhoss/blobtunes/blob/main/src-tauri/src/smtc.rs): `src-tauri/src/smtc.rs`
- [Tray and window](https://github.com/devhoss/blobtunes/blob/main/src-tauri/src/tray.rs): `src-tauri/src/tray.rs`
- [WebView profile](https://github.com/devhoss/blobtunes/blob/main/src-tauri/src/webview_profile.rs): `src-tauri/src/webview_profile.rs`

### Other components

- **Listener**
- **YouTube Data API**
- **libmpv**
- **Windows media controls**

## Connections

- Listener → Player UI: uses
- Player UI → Search commands: invokes search
- Search commands → YouTube search: calls
- YouTube search → YouTube Data API: queries
- Search commands → Player UI: returns results
- Player UI → Result mapping: maps results
- Player UI → Queue state: updates tracks
- Player UI → URL probe command: invokes probe
- URL probe command → Stream resolution: runs probe
- Player UI → Player commands: sends controls
- Player commands → Playback engine: dispatches commands
- Playback engine → libmpv: controls audio
- Player UI → Blob display: renders state
- Player UI → Seek control: renders progress
- Player UI → URL handling: validates links
- Playback engine → Media session: publishes playback
- Media session → Windows media controls: exposes controls
- Windows media controls → Media session: sends commands
- Player UI → Player commands: sends session metadata
- Tray and window → Windows media controls: integrates tray
- WebView profile → Windows media controls: isolates WebView data
