# putinpremi/sonido architecture

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

- Interactive diagram: https://gitdiagram.com/putinpremi/sonido
- Repository: https://github.com/putinpremi/sonido

## Overview

Echo is a native desktop music player. Users search for music or import local files, add tracks to the queue, and control playback; the Rust/Tauri backend resolves streams, caches audio, and plays it through the native audio engine. Lyrics, FFT-driven visuals, Cinema Stage, OS media controls, and desktop overlays extend the listening experience. The sampled files show key IPC calls and backend orchestration; several subsystem links below rely on README documentation because their implementation files were not sampled.

Main entry points: [`src-tauri/src/lib.rs`](https://github.com/putinpremi/sonido/blob/main/src-tauri/src/lib.rs) (Tauri commands), [`src/App.svelte`](https://github.com/putinpremi/sonido/blob/main/src/App.svelte) (Player shell), [`src/windows/lyrics/lyrics.ts`](https://github.com/putinpremi/sonido/blob/main/src/windows/lyrics/lyrics.ts) (Floating lyrics), [`src/windows/glow/glow.ts`](https://github.com/putinpremi/sonido/blob/main/src/windows/glow/glow.ts) (Edge glow overlay)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Player interface"]
  node_app["Player shell<br/>[App.svelte]"]
  node_home["Home<br/>[HomeView.svelte]"]
  node_nowplaying["Now Playing"]
  node_queue["Queue and library<br/>[QueueView.svelte]"]
  node_settings["AutoEQ settings"]
  node_api["Player IPC API<br/>[playerApi.ts]"]
  node_lyricsync["Lyrics timing<br/>[lyricsSync.ts]"]
  node_cinema["Cinema Stage<br/>[CinemaStage.svelte]"]
end

subgraph group_backend["Native playback"]
  node_backend["Tauri commands<br/>[lib.rs]"]
  node_metadata["Local metadata scan<br/>[metadata.rs]"]
  node_audio["Audio engine<br/>[engine.rs]"]
  node_fft["FFT analysis<br/>[fft.rs]"]
  node_media_controls["OS media controls<br/>[media_controls.rs]"]
end

subgraph group_media["Sources and lyrics"]
  node_search["Music search<br/>[search.rs]"]
  node_puller["Stream resolver<br/>[puller.rs]"]
  node_cache[("Audio cache<br/>[cache.rs]")]
  node_lyrics["Lyrics providers<br/>[lyrics.rs]"]
end

subgraph group_visuals["Visual experiences"]
  node_palette["Artwork palette<br/>[colors.rs]"]
  node_glow_manager["Glow window manager<br/>[glow_window.rs]"]
  node_lyrics_manager["Lyrics window manager<br/>[lyrics_window.rs]"]
  node_glow["Edge glow overlay<br/>[glow.ts]"]
  node_lyrics_overlay["Floating lyrics<br/>[lyrics.ts]"]
end

node_listener(("Listener"))

node_listener -->|"uses"| node_app
node_app -->|"calls"| node_api
node_app -->|"renders"| node_home
node_app -->|"renders"| node_nowplaying
node_app -->|"renders"| node_queue
node_app -->|"renders"| node_settings
node_app -->|"renders"| node_cinema
node_app -->|"uses"| node_lyricsync
node_api -->|"invokes"| node_backend
node_backend -->|"scans"| node_metadata
node_backend -->|"searches"| node_search
node_backend -->|"resolves streams"| node_puller
node_backend -->|"starts or attaches"| node_cache
node_backend -->|"controls playback"| node_audio
node_audio -->|"analyzes audio"| node_fft
node_backend -->|"resolves lyrics"| node_lyrics
node_backend -->|"initializes"| node_media_controls
node_backend -->|"extracts colors"| node_palette
node_backend -->|"manages overlay"| node_glow_manager
node_backend -->|"manages overlay"| node_lyrics_manager
node_glow -->|"subscribes frames"| node_backend
node_lyrics_overlay -->|"subscribes frames"| node_backend
node_lyrics_overlay -->|"uses timing"| node_lyricsync
node_app -.->|"configures"| node_lyrics_overlay
node_glow -.->|"uses palette"| node_palette

click node_app "https://github.com/putinpremi/sonido/blob/main/src/App.svelte"
click node_home "https://github.com/putinpremi/sonido/blob/main/src/lib/components/HomeView.svelte"
click node_nowplaying "https://github.com/putinpremi/sonido/blob/main/src/lib/components/NowPlayingView.svelte"
click node_queue "https://github.com/putinpremi/sonido/blob/main/src/lib/components/QueueView.svelte"
click node_settings "https://github.com/putinpremi/sonido/blob/main/src/lib/components/AutoEqSettingsView.svelte"
click node_api "https://github.com/putinpremi/sonido/blob/main/src/lib/playerApi.ts"
click node_lyricsync "https://github.com/putinpremi/sonido/blob/main/src/lib/lyricsSync.ts"
click node_cinema "https://github.com/putinpremi/sonido/blob/main/src/lib/components/CinemaStage.svelte"
click node_backend "https://github.com/putinpremi/sonido/blob/main/src-tauri/src/lib.rs"
click node_metadata "https://github.com/putinpremi/sonido/blob/main/src-tauri/src/metadata.rs"
click node_audio "https://github.com/putinpremi/sonido/blob/main/src-tauri/src/audio/engine.rs"
click node_fft "https://github.com/putinpremi/sonido/blob/main/src-tauri/src/audio/fft.rs"
click node_media_controls "https://github.com/putinpremi/sonido/blob/main/src-tauri/src/media_controls.rs"
click node_search "https://github.com/putinpremi/sonido/blob/main/src-tauri/src/sources/search.rs"
click node_puller "https://github.com/putinpremi/sonido/blob/main/src-tauri/src/sources/puller.rs"
click node_cache "https://github.com/putinpremi/sonido/blob/main/src-tauri/src/sources/cache.rs"
click node_lyrics "https://github.com/putinpremi/sonido/blob/main/src-tauri/src/sources/lyrics.rs"
click node_palette "https://github.com/putinpremi/sonido/blob/main/src-tauri/src/visuals/colors.rs"
click node_glow_manager "https://github.com/putinpremi/sonido/blob/main/src-tauri/src/visuals/glow_window.rs"
click node_lyrics_manager "https://github.com/putinpremi/sonido/blob/main/src-tauri/src/visuals/lyrics_window.rs"
click node_glow "https://github.com/putinpremi/sonido/blob/main/src/windows/glow/glow.ts"
click node_lyrics_overlay "https://github.com/putinpremi/sonido/blob/main/src/windows/lyrics/lyrics.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_home,node_nowplaying,node_queue,node_settings,node_api,node_lyricsync,node_cinema toneBlue
class node_backend,node_metadata,node_audio,node_fft,node_media_controls toneAmber
class node_search,node_puller,node_cache,node_lyrics toneMint
class node_palette,node_glow_manager,node_lyrics_manager,node_glow,node_lyrics_overlay toneRose
class node_listener toneIndigo
```

## Components

### Player interface

- [Player shell](https://github.com/putinpremi/sonido/blob/main/src/App.svelte): `src/App.svelte`
- [Home](https://github.com/putinpremi/sonido/blob/main/src/lib/components/HomeView.svelte): `src/lib/components/HomeView.svelte`
- [Now Playing](https://github.com/putinpremi/sonido/blob/main/src/lib/components/NowPlayingView.svelte): `src/lib/components/NowPlayingView.svelte`
- [Queue and library](https://github.com/putinpremi/sonido/blob/main/src/lib/components/QueueView.svelte): `src/lib/components/QueueView.svelte`
- [AutoEQ settings](https://github.com/putinpremi/sonido/blob/main/src/lib/components/AutoEqSettingsView.svelte): `src/lib/components/AutoEqSettingsView.svelte`
- [Player IPC API](https://github.com/putinpremi/sonido/blob/main/src/lib/playerApi.ts): `src/lib/playerApi.ts`
- [Lyrics timing](https://github.com/putinpremi/sonido/blob/main/src/lib/lyricsSync.ts): `src/lib/lyricsSync.ts`
- [Cinema Stage](https://github.com/putinpremi/sonido/blob/main/src/lib/components/CinemaStage.svelte): `src/lib/components/CinemaStage.svelte`

### Native playback

- [Tauri commands](https://github.com/putinpremi/sonido/blob/main/src-tauri/src/lib.rs): `src-tauri/src/lib.rs`
- [Local metadata scan](https://github.com/putinpremi/sonido/blob/main/src-tauri/src/metadata.rs): `src-tauri/src/metadata.rs`
- [Audio engine](https://github.com/putinpremi/sonido/blob/main/src-tauri/src/audio/engine.rs): `src-tauri/src/audio/engine.rs`
- [FFT analysis](https://github.com/putinpremi/sonido/blob/main/src-tauri/src/audio/fft.rs): `src-tauri/src/audio/fft.rs`
- [OS media controls](https://github.com/putinpremi/sonido/blob/main/src-tauri/src/media_controls.rs): `src-tauri/src/media_controls.rs`

### Sources and lyrics

- [Music search](https://github.com/putinpremi/sonido/blob/main/src-tauri/src/sources/search.rs): `src-tauri/src/sources/search.rs`
- [Stream resolver](https://github.com/putinpremi/sonido/blob/main/src-tauri/src/sources/puller.rs): `src-tauri/src/sources/puller.rs`
- [Audio cache](https://github.com/putinpremi/sonido/blob/main/src-tauri/src/sources/cache.rs): `src-tauri/src/sources/cache.rs`
- [Lyrics providers](https://github.com/putinpremi/sonido/blob/main/src-tauri/src/sources/lyrics.rs): `src-tauri/src/sources/lyrics.rs`

### Visual experiences

- [Artwork palette](https://github.com/putinpremi/sonido/blob/main/src-tauri/src/visuals/colors.rs): `src-tauri/src/visuals/colors.rs`
- [Glow window manager](https://github.com/putinpremi/sonido/blob/main/src-tauri/src/visuals/glow_window.rs): `src-tauri/src/visuals/glow_window.rs`
- [Lyrics window manager](https://github.com/putinpremi/sonido/blob/main/src-tauri/src/visuals/lyrics_window.rs): `src-tauri/src/visuals/lyrics_window.rs`
- [Edge glow overlay](https://github.com/putinpremi/sonido/blob/main/src/windows/glow/glow.ts): `src/windows/glow/glow.ts`
- [Floating lyrics](https://github.com/putinpremi/sonido/blob/main/src/windows/lyrics/lyrics.ts): `src/windows/lyrics/lyrics.ts`

### Other components

- **Listener**

## Connections

- Listener → Player shell: uses (evidence: `README.md`)
- Player shell → Player IPC API: calls (evidence: `src/App.svelte`)
- Player shell → Home: renders (evidence: `src/App.svelte`)
- Player shell → Now Playing: renders (evidence: `src/App.svelte`)
- Player shell → Queue and library: renders (evidence: `src/App.svelte`)
- Player shell → AutoEQ settings: renders (evidence: `src/App.svelte`)
- Player shell → Cinema Stage: renders (evidence: `src/App.svelte`)
- Player shell → Lyrics timing: uses (evidence: `src/App.svelte`)
- Player IPC API → Tauri commands: invokes (evidence: `src/lib/playerApi.ts`)
- Tauri commands → Local metadata scan: scans (evidence: `src-tauri/src/lib.rs`)
- Tauri commands → Music search: searches (evidence: `README.md`)
- Tauri commands → Stream resolver: resolves streams (evidence: `src-tauri/src/lib.rs`)
- Tauri commands → Audio cache: starts or attaches (evidence: `src-tauri/src/lib.rs`)
- Tauri commands → Audio engine: controls playback (evidence: `src-tauri/src/lib.rs`)
- Audio engine → FFT analysis: analyzes audio (evidence: `README.md`)
- Tauri commands → Lyrics providers: resolves lyrics (evidence: `src-tauri/src/lib.rs`)
- Tauri commands → OS media controls: initializes (evidence: `src-tauri/src/lib.rs`)
- Tauri commands → Artwork palette: extracts colors (evidence: `README.md`)
- Tauri commands → Glow window manager: manages overlay (evidence: `README.md`)
- Tauri commands → Lyrics window manager: manages overlay (evidence: `README.md`)
- Edge glow overlay → Tauri commands: subscribes frames (evidence: `src/windows/glow/glow.ts`)
- Floating lyrics → Tauri commands: subscribes frames (evidence: `src/windows/lyrics/lyrics.ts`)
- Floating lyrics → Lyrics timing: uses timing (evidence: `src/windows/lyrics/lyrics.ts`)
- Player shell → Floating lyrics: configures
- Edge glow overlay → Artwork palette: uses palette
