# tairtasnis/tesifyrust architecture

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

- Interactive diagram: https://gitdiagram.com/tairtasnis/tesifyrust
- Repository: https://github.com/tairtasnis/tesifyrust

## Overview

Tesify is a cross-platform music player: users browse or search Spotify’s catalog, choose tracks, and play them through a Rust backend that resolves audio sources. The app also manages a local playlist library, imports public Spotify playlists, and retrieves lyrics. The graph preserves these distinct capabilities and the shared playback, catalog, and storage layers. Some subsystem details come from README documentation and indexed paths rather than sampled implementation; uncertain links are omitted.

Main entry points: [`Backend/src/preview/routes.rs`](https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/preview/routes.rs) (HTTP API routes), [`Frontend/src/shared/lib/backend.ts`](https://github.com/tairtasnis/tesifyrust/blob/v2/Frontend/src/shared/lib/backend.ts) (Backend client), [`Frontend/src/app/App.tsx`](https://github.com/tairtasnis/tesifyrust/blob/v2/Frontend/src/app/App.tsx) (App and navigation), [`Backend/src/shared/spotify/client.rs`](https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/shared/spotify/client.rs) (Spotify client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React app"]
  node_app["App and navigation<br/>[App.tsx]"]
  node_search_ui["Search page<br/>[SearchPage.tsx]"]
  node_artist_ui["Artist page<br/>[ArtistPage.tsx]"]
  node_lyrics_ui["Lyrics page<br/>[LyricsPage.tsx]"]
  node_playback_ui["Playback provider"]
  node_backend_client["Backend client<br/>[backend.ts]"]
  node_playlist_ui["Playlist pages<br/>[PlaylistPage.tsx]"]
  node_settings_ui["Storage settings"]
end

subgraph group_catalog["Catalog services"]
  node_search_service["Catalog search<br/>[service.rs]"]
  node_spotify["Spotify client<br/>[client.rs]"]
  node_catalog_models["Catalog models<br/>[models.rs]"]
  node_artist_service["Artist details<br/>[service.rs]"]
  node_album_service["Album details<br/>[service.rs]"]
  node_spotify_playlist["Spotify playlists<br/>[service.rs]"]
end

subgraph group_library["Library and settings"]
  node_routes["HTTP API routes<br/>[routes.rs]"]
  node_library_store[("Playlist library<br/>[store.rs]")]
  node_playlist_import["Spotify import<br/>[spotify.rs]"]
  node_covers["Cover uploads<br/>[covers.rs]"]
end

subgraph group_playback["Playback and lyrics"]
  node_playback_commands["Playback commands<br/>[commands.rs]"]
  node_play_engine["Audio resolution<br/>[play_engine.rs]"]
  node_audio_stream["Audio stream<br/>[stream.rs]"]
  node_lyrics_service["Lyrics service<br/>[service.rs]"]
  node_lyrics_providers["Lyrics providers<br/>[providers.rs]"]
end

node_user(("Listener"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_search_ui
node_search_ui -->|"searches via"| node_backend_client
node_backend_client -->|"HTTP requests"| node_routes
node_routes -->|"routes search"| node_search_service
node_search_service -->|"queries"| node_spotify
node_search_service -->|"returns catalog"| node_catalog_models
node_app -->|"renders"| node_artist_ui
node_artist_ui -->|"loads details"| node_backend_client
node_routes -->|"routes artist"| node_artist_service
node_artist_service -->|"queries"| node_spotify
node_routes -->|"routes album"| node_album_service
node_album_service -->|"queries"| node_spotify
node_routes -->|"routes playlist"| node_spotify_playlist
node_spotify_playlist -->|"queries"| node_spotify
node_app -->|"provides playback"| node_playback_ui
node_playback_ui -->|"requests playback"| node_backend_client
node_backend_client -->|"HTTP requests"| node_routes
node_routes -->|"dispatches prepare"| node_playback_commands
node_playback_commands -.->|"prepares source"| node_play_engine
node_play_engine -.->|"serves audio"| node_audio_stream
node_app -->|"renders"| node_lyrics_ui
node_lyrics_ui -->|"requests lyrics"| node_backend_client
node_routes -->|"dispatches lyrics"| node_lyrics_service
node_lyrics_service -->|"fetches lyrics"| node_lyrics_providers
node_app -->|"renders"| node_playlist_ui
node_playlist_ui -.->|"manages playlists"| node_backend_client
node_routes -->|"accesses library"| node_library_store
node_routes -->|"dispatches import"| node_playlist_import
node_routes -->|"uploads covers"| node_covers
node_app -->|"renders"| node_settings_ui
node_settings_ui -->|"reads usage"| node_backend_client
node_backend_client -->|"HTTP requests"| node_routes

click node_app "https://github.com/tairtasnis/tesifyrust/blob/v2/Frontend/src/app/App.tsx"
click node_search_ui "https://github.com/tairtasnis/tesifyrust/blob/v2/Frontend/src/pages/Search/SearchPage.tsx"
click node_artist_ui "https://github.com/tairtasnis/tesifyrust/blob/v2/Frontend/src/pages/Artist/ArtistPage.tsx"
click node_lyrics_ui "https://github.com/tairtasnis/tesifyrust/blob/v2/Frontend/src/pages/Lyrics/LyricsPage.tsx"
click node_playback_ui "https://github.com/tairtasnis/tesifyrust/blob/v2/Frontend/src/shared/playback/PlaybackProvider.tsx"
click node_backend_client "https://github.com/tairtasnis/tesifyrust/blob/v2/Frontend/src/shared/lib/backend.ts"
click node_search_service "https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/pages/search/service.rs"
click node_spotify "https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/shared/spotify/client.rs"
click node_catalog_models "https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/shared/spotify/models.rs"
click node_artist_service "https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/pages/artist/service.rs"
click node_album_service "https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/pages/album/service.rs"
click node_spotify_playlist "https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/pages/spotify_playlist/service.rs"
click node_routes "https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/preview/routes.rs"
click node_playlist_ui "https://github.com/tairtasnis/tesifyrust/blob/v2/Frontend/src/pages/Playlist/PlaylistPage.tsx"
click node_library_store "https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/shared/playlists/store.rs"
click node_playlist_import "https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/pages/playlist/spotify.rs"
click node_covers "https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/pages/library/covers.rs"
click node_settings_ui "https://github.com/tairtasnis/tesifyrust/blob/v2/Frontend/src/pages/Settings/StorageSettings.tsx"
click node_playback_commands "https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/shared/playback/commands.rs"
click node_play_engine "https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/shared/playback/play_engine.rs"
click node_audio_stream "https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/shared/playback/stream.rs"
click node_lyrics_service "https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/pages/lyrics/service.rs"
click node_lyrics_providers "https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/pages/lyrics/providers.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_search_ui,node_artist_ui,node_lyrics_ui,node_playback_ui,node_backend_client,node_playlist_ui,node_settings_ui toneBlue
class node_search_service,node_spotify,node_catalog_models,node_artist_service,node_album_service,node_spotify_playlist toneAmber
class node_routes,node_library_store,node_playlist_import,node_covers toneMint
class node_playback_commands,node_play_engine,node_audio_stream,node_lyrics_service,node_lyrics_providers toneRose
class node_user toneIndigo
```

## Components

### React app

- [App and navigation](https://github.com/tairtasnis/tesifyrust/blob/v2/Frontend/src/app/App.tsx): `Frontend/src/app/App.tsx`
- [Search page](https://github.com/tairtasnis/tesifyrust/blob/v2/Frontend/src/pages/Search/SearchPage.tsx): `Frontend/src/pages/Search/SearchPage.tsx`
- [Artist page](https://github.com/tairtasnis/tesifyrust/blob/v2/Frontend/src/pages/Artist/ArtistPage.tsx): `Frontend/src/pages/Artist/ArtistPage.tsx`
- [Lyrics page](https://github.com/tairtasnis/tesifyrust/blob/v2/Frontend/src/pages/Lyrics/LyricsPage.tsx): `Frontend/src/pages/Lyrics/LyricsPage.tsx`
- [Playback provider](https://github.com/tairtasnis/tesifyrust/blob/v2/Frontend/src/shared/playback/PlaybackProvider.tsx): `Frontend/src/shared/playback/PlaybackProvider.tsx`
- [Backend client](https://github.com/tairtasnis/tesifyrust/blob/v2/Frontend/src/shared/lib/backend.ts): `Frontend/src/shared/lib/backend.ts`
- [Playlist pages](https://github.com/tairtasnis/tesifyrust/blob/v2/Frontend/src/pages/Playlist/PlaylistPage.tsx): `Frontend/src/pages/Playlist/PlaylistPage.tsx`
- [Storage settings](https://github.com/tairtasnis/tesifyrust/blob/v2/Frontend/src/pages/Settings/StorageSettings.tsx): `Frontend/src/pages/Settings/StorageSettings.tsx`

### Catalog services

- [Catalog search](https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/pages/search/service.rs): `Backend/src/pages/search/service.rs`
- [Spotify client](https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/shared/spotify/client.rs): `Backend/src/shared/spotify/client.rs`
- [Catalog models](https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/shared/spotify/models.rs): `Backend/src/shared/spotify/models.rs`
- [Artist details](https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/pages/artist/service.rs): `Backend/src/pages/artist/service.rs`
- [Album details](https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/pages/album/service.rs): `Backend/src/pages/album/service.rs`
- [Spotify playlists](https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/pages/spotify_playlist/service.rs): `Backend/src/pages/spotify_playlist/service.rs`

### Library and settings

- [HTTP API routes](https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/preview/routes.rs): `Backend/src/preview/routes.rs`
- [Playlist library](https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/shared/playlists/store.rs): `Backend/src/shared/playlists/store.rs`
- [Spotify import](https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/pages/playlist/spotify.rs): `Backend/src/pages/playlist/spotify.rs`
- [Cover uploads](https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/pages/library/covers.rs): `Backend/src/pages/library/covers.rs`

### Playback and lyrics

- [Playback commands](https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/shared/playback/commands.rs): `Backend/src/shared/playback/commands.rs`
- [Audio resolution](https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/shared/playback/play_engine.rs): `Backend/src/shared/playback/play_engine.rs`
- [Audio stream](https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/shared/playback/stream.rs): `Backend/src/shared/playback/stream.rs`
- [Lyrics service](https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/pages/lyrics/service.rs): `Backend/src/pages/lyrics/service.rs`
- [Lyrics providers](https://github.com/tairtasnis/tesifyrust/blob/v2/Backend/src/pages/lyrics/providers.rs): `Backend/src/pages/lyrics/providers.rs`

### Other components

- **Listener**

## Connections

- Listener → App and navigation: uses
- App and navigation → Search page: renders (evidence: `Frontend/src/app/App.tsx`)
- Search page → Backend client: searches via (evidence: `Frontend/src/pages/Search/SearchPage.tsx`)
- Backend client → HTTP API routes: HTTP requests
- HTTP API routes → Catalog search: routes search (evidence: `Backend/src/preview/routes.rs`)
- Catalog search → Spotify client: queries (evidence: `Backend/src/pages/search/service.rs`)
- Catalog search → Catalog models: returns catalog (evidence: `Backend/src/pages/search/service.rs`)
- App and navigation → Artist page: renders (evidence: `Frontend/src/app/App.tsx`)
- Artist page → Backend client: loads details (evidence: `Frontend/src/pages/Artist/ArtistPage.tsx`)
- HTTP API routes → Artist details: routes artist (evidence: `Backend/src/preview/routes.rs`)
- Artist details → Spotify client: queries (evidence: `Backend/src/pages/artist/service.rs`)
- HTTP API routes → Album details: routes album (evidence: `Backend/src/preview/routes.rs`)
- Album details → Spotify client: queries (evidence: `Backend/src/pages/album/service.rs`)
- HTTP API routes → Spotify playlists: routes playlist (evidence: `Backend/src/preview/routes.rs`)
- Spotify playlists → Spotify client: queries (evidence: `Backend/src/pages/spotify_playlist/service.rs`)
- App and navigation → Playback provider: provides playback (evidence: `Frontend/src/app/App.tsx`)
- Playback provider → Backend client: requests playback (evidence: `Frontend/src/shared/playback/PlaybackProvider.tsx`)
- Backend client → HTTP API routes: HTTP requests
- HTTP API routes → Playback commands: dispatches prepare (evidence: `Backend/src/preview/routes.rs`)
- Playback commands → Audio resolution: prepares source
- Audio resolution → Audio stream: serves audio
- App and navigation → Lyrics page: renders (evidence: `Frontend/src/app/App.tsx`)
- Lyrics page → Backend client: requests lyrics (evidence: `Frontend/src/pages/Lyrics/LyricsPage.tsx`)
- HTTP API routes → Lyrics service: dispatches lyrics (evidence: `Backend/src/preview/routes.rs`)
- Lyrics service → Lyrics providers: fetches lyrics (evidence: `Backend/src/pages/lyrics/service.rs`)
- App and navigation → Playlist pages: renders (evidence: `Frontend/src/app/App.tsx`)
- Playlist pages → Backend client: manages playlists (evidence: `Frontend/src/pages/Playlist/PlaylistPage.tsx`)
- HTTP API routes → Playlist library: accesses library (evidence: `Backend/src/preview/routes.rs`)
- HTTP API routes → Spotify import: dispatches import (evidence: `Backend/src/preview/routes.rs`)
- HTTP API routes → Cover uploads: uploads covers (evidence: `Backend/src/preview/routes.rs`)
- App and navigation → Storage settings: renders (evidence: `Frontend/src/app/App.tsx`)
- Storage settings → Backend client: reads usage (evidence: `Frontend/src/pages/Settings/StorageSettings.tsx`)
- Backend client → HTTP API routes: HTTP requests
