# lullabyx/sone architecture

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

- Interactive diagram: https://gitdiagram.com/lullabyx/sone
- Repository: https://github.com/lullabyx/sone

## Overview

SONE is a Linux TIDAL desktop client. Users authenticate, browse or search TIDAL’s catalog and library, then play music or videos through a native playback engine; playback state also feeds desktop controls and optional integrations. The graph includes documented capabilities such as scrobbling, reporting, themes, MCP and the OBS overlay. Some subsystem links are documented in the README because their implementation files were not sampled; those are labeled accordingly.

Main entry points: [`src/atoms/playback.ts`](https://github.com/lullabyx/sone/blob/master/src/atoms/playback.ts) (Playback state), [`src-tauri/src/tidal_api.rs`](https://github.com/lullabyx/sone/blob/master/src-tauri/src/tidal_api.rs) (TIDAL service), [`src/hooks/usePlaybackActions.ts`](https://github.com/lullabyx/sone/blob/master/src/hooks/usePlaybackActions.ts) (Playback actions), [`src-tauri/src/commands`](https://github.com/lullabyx/sone/tree/master/src-tauri/src/commands) (Tauri commands)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop experience"]
  node_app["App and views<br/>[App.tsx]"]
  node_navigation["Navigation state<br/>[navigation.ts]"]
  node_navhook["Navigation hook<br/>[useNavigation.ts]"]
  node_toast["Toast feedback<br/>[ToastContext.tsx]"]
  node_themes["Themes<br/>[theme_config.rs]"]
  node_image["TIDAL images<br/>[TidalImage.tsx]"]
  node_scroll["Scroll memory<br/>[scrollMemory.ts]"]
end

subgraph group_catalog["TIDAL and library"]
  node_auth["Authentication<br/>[useAuth.ts]"]
  node_authstate["Auth state<br/>[auth.ts]"]
  node_search["Search view<br/>[SearchView.tsx]"]
  node_catalogapi["TIDAL API client<br/>[tidal.ts]"]
  node_tidalbackend["TIDAL service<br/>[tidal_api.rs]"]
  node_commands["Tauri commands"]
  node_cache[("Encrypted cache<br/>[cache.rs]")]
  node_itemhelpers["Media helpers<br/>[itemHelpers.ts]"]
end

subgraph group_playback["Playback and audio"]
  node_playactions["Playback actions"]
  node_playstate["Playback state<br/>[playback.ts]"]
  node_video["Video session<br/>[videoSession.ts]"]
  node_audio["Audio engine<br/>[audio.rs]"]
  node_signal["Signal path<br/>[signal_path.rs]"]
  node_probe["Pipeline probe<br/>[pipeline_probe.rs]"]
  node_proxy["Network proxy<br/>[proxy.rs]"]
  node_proxyhttp["HTTP proxy<br/>[proxy_http.rs]"]
end

subgraph group_integrations["Platform integrations"]
  node_scrobble["Scrobbling services"]
  node_reporting["Play reporting"]
  node_discord["Discord presence<br/>[discord.rs]"]
  node_discordipc["Discord IPC<br/>[discord_ipc.rs]"]
  node_mpris["MPRIS controls<br/>[mpris.rs]"]
  node_tray["System tray<br/>[tray.rs]"]
  node_mcp["MCP server"]
  node_overlay["OBS overlay"]
end

node_user(("Listener"))
node_external_tidal(("TIDAL service"))
node_alsa(("ALSA device"))

node_user -->|"uses"| node_app
node_app -->|"renders views"| node_navigation
node_navhook -->|"updates"| node_navigation
node_navhook -->|"stores offsets"| node_scroll
node_search -->|"searches"| node_catalogapi
node_search -->|"starts playback"| node_playactions
node_auth -->|"updates"| node_authstate
node_auth -->|"invokes auth"| node_commands
node_auth -->|"loads folders"| node_catalogapi
node_catalogapi -->|"invokes commands"| node_commands
node_commands -->|"delegates"| node_tidalbackend
node_tidalbackend -.->|"requests catalog"| node_external_tidal
node_tidalbackend -.->|"uses cache"| node_cache
node_itemhelpers -->|"formats media"| node_image
node_playactions -->|"updates queue"| node_playstate
node_playactions -->|"controls playback"| node_commands
node_playactions -->|"starts video"| node_video
node_playactions -->|"loads mix tracks"| node_catalogapi
node_commands -.->|"controls engine"| node_audio
node_audio -->|"outputs audio"| node_alsa
node_audio -->|"uses proxy"| node_proxy
node_audio -->|"reports signal"| node_signal
node_signal -->|"uses probe"| node_probe
node_probe -->|"measures pipeline"| node_signal
node_tidalbackend -->|"routes requests"| node_proxy
node_tidalbackend -->|"routes HTTP"| node_proxyhttp
node_playstate -.->|"exposes controls"| node_mpris
node_playstate -.->|"feeds controls"| node_tray
node_playstate -.->|"shares now playing"| node_discord
node_discord -->|"uses IPC"| node_discordipc
node_playstate -.->|"submits listening"| node_scrobble
node_playstate -.->|"reports finished plays"| node_reporting
node_playstate -.->|"offers playback tools"| node_mcp
node_playstate -.->|"publishes now playing"| node_overlay
node_user -.->|"customizes"| node_themes
node_user -.->|"connects agent"| node_mcp
node_user -.->|"configures widget"| node_overlay

click node_app "https://github.com/lullabyx/sone/blob/master/src/App.tsx"
click node_navigation "https://github.com/lullabyx/sone/blob/master/src/atoms/navigation.ts"
click node_navhook "https://github.com/lullabyx/sone/blob/master/src/hooks/useNavigation.ts"
click node_toast "https://github.com/lullabyx/sone/blob/master/src/contexts/ToastContext.tsx"
click node_auth "https://github.com/lullabyx/sone/blob/master/src/hooks/useAuth.ts"
click node_authstate "https://github.com/lullabyx/sone/blob/master/src/atoms/auth.ts"
click node_search "https://github.com/lullabyx/sone/blob/master/src/components/SearchView.tsx"
click node_catalogapi "https://github.com/lullabyx/sone/blob/master/src/api/tidal.ts"
click node_tidalbackend "https://github.com/lullabyx/sone/blob/master/src-tauri/src/tidal_api.rs"
click node_commands "https://github.com/lullabyx/sone/tree/master/src-tauri/src/commands"
click node_cache "https://github.com/lullabyx/sone/blob/master/src-tauri/src/cache.rs"
click node_itemhelpers "https://github.com/lullabyx/sone/blob/master/src/utils/itemHelpers.ts"
click node_playactions "https://github.com/lullabyx/sone/blob/master/src/hooks/usePlaybackActions.ts"
click node_playstate "https://github.com/lullabyx/sone/blob/master/src/atoms/playback.ts"
click node_video "https://github.com/lullabyx/sone/blob/master/src/lib/videoSession.ts"
click node_audio "https://github.com/lullabyx/sone/blob/master/src-tauri/src/audio.rs"
click node_signal "https://github.com/lullabyx/sone/blob/master/src-tauri/src/signal_path.rs"
click node_probe "https://github.com/lullabyx/sone/blob/master/src-tauri/src/pipeline_probe.rs"
click node_proxy "https://github.com/lullabyx/sone/blob/master/src-tauri/src/proxy.rs"
click node_proxyhttp "https://github.com/lullabyx/sone/blob/master/src-tauri/src/proxy_http.rs"
click node_scrobble "https://github.com/lullabyx/sone/tree/master/src-tauri/src/scrobble"
click node_reporting "https://github.com/lullabyx/sone/tree/master/src-tauri/src/tidal_report"
click node_discord "https://github.com/lullabyx/sone/blob/master/src-tauri/src/discord.rs"
click node_discordipc "https://github.com/lullabyx/sone/blob/master/src-tauri/src/discord_ipc.rs"
click node_mpris "https://github.com/lullabyx/sone/blob/master/src-tauri/src/mpris.rs"
click node_tray "https://github.com/lullabyx/sone/blob/master/src-tauri/src/tray.rs"
click node_mcp "https://github.com/lullabyx/sone/tree/master/src-tauri/src/mcp"
click node_overlay "https://github.com/lullabyx/sone/tree/master/src-tauri/src/overlay"
click node_themes "https://github.com/lullabyx/sone/blob/master/src-tauri/src/theme_config.rs"
click node_image "https://github.com/lullabyx/sone/blob/master/src/components/TidalImage.tsx"
click node_scroll "https://github.com/lullabyx/sone/blob/master/src/lib/scrollMemory.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_navigation,node_navhook,node_toast,node_themes,node_image,node_scroll toneBlue
class node_auth,node_authstate,node_search,node_catalogapi,node_tidalbackend,node_commands,node_cache,node_itemhelpers toneAmber
class node_playactions,node_playstate,node_video,node_audio,node_signal,node_probe,node_proxy,node_proxyhttp toneMint
class node_scrobble,node_reporting,node_discord,node_discordipc,node_mpris,node_tray,node_mcp,node_overlay toneRose
class node_user,node_external_tidal,node_alsa toneIndigo
```

## Components

### Desktop experience

- [App and views](https://github.com/lullabyx/sone/blob/master/src/App.tsx): `src/App.tsx`
- [Navigation state](https://github.com/lullabyx/sone/blob/master/src/atoms/navigation.ts): `src/atoms/navigation.ts`
- [Navigation hook](https://github.com/lullabyx/sone/blob/master/src/hooks/useNavigation.ts): `src/hooks/useNavigation.ts`
- [Toast feedback](https://github.com/lullabyx/sone/blob/master/src/contexts/ToastContext.tsx): `src/contexts/ToastContext.tsx`
- [Themes](https://github.com/lullabyx/sone/blob/master/src-tauri/src/theme_config.rs): `src-tauri/src/theme_config.rs`
- [TIDAL images](https://github.com/lullabyx/sone/blob/master/src/components/TidalImage.tsx): `src/components/TidalImage.tsx`
- [Scroll memory](https://github.com/lullabyx/sone/blob/master/src/lib/scrollMemory.ts): `src/lib/scrollMemory.ts`

### TIDAL and library

- [Authentication](https://github.com/lullabyx/sone/blob/master/src/hooks/useAuth.ts): `src/hooks/useAuth.ts`
- [Auth state](https://github.com/lullabyx/sone/blob/master/src/atoms/auth.ts): `src/atoms/auth.ts`
- [Search view](https://github.com/lullabyx/sone/blob/master/src/components/SearchView.tsx): `src/components/SearchView.tsx`
- [TIDAL API client](https://github.com/lullabyx/sone/blob/master/src/api/tidal.ts): `src/api/tidal.ts`
- [TIDAL service](https://github.com/lullabyx/sone/blob/master/src-tauri/src/tidal_api.rs): `src-tauri/src/tidal_api.rs`
- [Tauri commands](https://github.com/lullabyx/sone/tree/master/src-tauri/src/commands): `src-tauri/src/commands`
- [Encrypted cache](https://github.com/lullabyx/sone/blob/master/src-tauri/src/cache.rs): `src-tauri/src/cache.rs`
- [Media helpers](https://github.com/lullabyx/sone/blob/master/src/utils/itemHelpers.ts): `src/utils/itemHelpers.ts`

### Playback and audio

- [Playback actions](https://github.com/lullabyx/sone/blob/master/src/hooks/usePlaybackActions.ts): `src/hooks/usePlaybackActions.ts`
- [Playback state](https://github.com/lullabyx/sone/blob/master/src/atoms/playback.ts): `src/atoms/playback.ts`
- [Video session](https://github.com/lullabyx/sone/blob/master/src/lib/videoSession.ts): `src/lib/videoSession.ts`
- [Audio engine](https://github.com/lullabyx/sone/blob/master/src-tauri/src/audio.rs): `src-tauri/src/audio.rs`
- [Signal path](https://github.com/lullabyx/sone/blob/master/src-tauri/src/signal_path.rs): `src-tauri/src/signal_path.rs`
- [Pipeline probe](https://github.com/lullabyx/sone/blob/master/src-tauri/src/pipeline_probe.rs): `src-tauri/src/pipeline_probe.rs`
- [Network proxy](https://github.com/lullabyx/sone/blob/master/src-tauri/src/proxy.rs): `src-tauri/src/proxy.rs`
- [HTTP proxy](https://github.com/lullabyx/sone/blob/master/src-tauri/src/proxy_http.rs): `src-tauri/src/proxy_http.rs`

### Platform integrations

- [Scrobbling services](https://github.com/lullabyx/sone/tree/master/src-tauri/src/scrobble): `src-tauri/src/scrobble`
- [Play reporting](https://github.com/lullabyx/sone/tree/master/src-tauri/src/tidal_report): `src-tauri/src/tidal_report`
- [Discord presence](https://github.com/lullabyx/sone/blob/master/src-tauri/src/discord.rs): `src-tauri/src/discord.rs`
- [Discord IPC](https://github.com/lullabyx/sone/blob/master/src-tauri/src/discord_ipc.rs): `src-tauri/src/discord_ipc.rs`
- [MPRIS controls](https://github.com/lullabyx/sone/blob/master/src-tauri/src/mpris.rs): `src-tauri/src/mpris.rs`
- [System tray](https://github.com/lullabyx/sone/blob/master/src-tauri/src/tray.rs): `src-tauri/src/tray.rs`
- [MCP server](https://github.com/lullabyx/sone/tree/master/src-tauri/src/mcp): `src-tauri/src/mcp`
- [OBS overlay](https://github.com/lullabyx/sone/tree/master/src-tauri/src/overlay): `src-tauri/src/overlay`

### Other components

- **Listener**
- **TIDAL service**
- **ALSA device**

## Connections

- Listener → App and views: uses (evidence: `src/App.tsx`)
- App and views → Navigation state: renders views (evidence: `src/App.tsx`)
- Navigation hook → Navigation state: updates (evidence: `src/hooks/useNavigation.ts`)
- Navigation hook → Scroll memory: stores offsets (evidence: `src/hooks/useNavigation.ts`)
- Search view → TIDAL API client: searches (evidence: `src/components/SearchView.tsx`)
- Search view → Playback actions: starts playback (evidence: `src/components/SearchView.tsx`)
- Authentication → Auth state: updates (evidence: `src/hooks/useAuth.ts`)
- Authentication → Tauri commands: invokes auth (evidence: `src/hooks/useAuth.ts`)
- Authentication → TIDAL API client: loads folders (evidence: `src/hooks/useAuth.ts`)
- TIDAL API client → Tauri commands: invokes commands (evidence: `src/api/tidal.ts`)
- Tauri commands → TIDAL service: delegates (evidence: `src-tauri/src/commands/auth.rs`)
- TIDAL service → TIDAL service: requests catalog (evidence: `README.md`)
- TIDAL service → Encrypted cache: uses cache (evidence: `src-tauri/src/lib.rs`)
- Media helpers → TIDAL images: formats media (evidence: `src/utils/itemHelpers.ts`)
- Playback actions → Playback state: updates queue (evidence: `src/hooks/usePlaybackActions.ts`)
- Playback actions → Tauri commands: controls playback (evidence: `src/hooks/usePlaybackActions.ts`)
- Playback actions → Video session: starts video (evidence: `src/hooks/usePlaybackActions.ts`)
- Playback actions → TIDAL API client: loads mix tracks (evidence: `src/hooks/usePlaybackActions.ts`)
- Tauri commands → Audio engine: controls engine (evidence: `src-tauri/src/lib.rs`)
- Audio engine → ALSA device: outputs audio (evidence: `README.md`)
- Audio engine → Network proxy: uses proxy (evidence: `src-tauri/src/audio.rs`)
- Audio engine → Signal path: reports signal (evidence: `src-tauri/src/audio.rs`)
- Signal path → Pipeline probe: uses probe (evidence: `src-tauri/src/signal_path.rs`)
- Pipeline probe → Signal path: measures pipeline (evidence: `src-tauri/src/pipeline_probe.rs`)
- TIDAL service → Network proxy: routes requests (evidence: `src-tauri/src/tidal_api.rs`)
- TIDAL service → HTTP proxy: routes HTTP (evidence: `src-tauri/src/tidal_api.rs`)
- Playback state → MPRIS controls: exposes controls (evidence: `README.md`)
- Playback state → System tray: feeds controls (evidence: `README.md`)
- Playback state → Discord presence: shares now playing (evidence: `README.md`)
- Discord presence → Discord IPC: uses IPC (evidence: `src-tauri/src/discord.rs`)
- Playback state → Scrobbling services: submits listening (evidence: `README.md`)
- Playback state → Play reporting: reports finished plays (evidence: `README.md`)
- Playback state → MCP server: offers playback tools (evidence: `README.md`)
- Playback state → OBS overlay: publishes now playing (evidence: `README.md`)
- Listener → Themes: customizes (evidence: `README.md`)
- Listener → MCP server: connects agent (evidence: `README.md`)
- Listener → OBS overlay: configures widget (evidence: `README.md`)
