# tryliner/desktop architecture

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

- Interactive diagram: https://gitdiagram.com/tryliner/desktop
- Repository: https://github.com/tryliner/desktop

## Overview

Liner is an Electron desktop music-streaming player. Users authenticate, browse or search the catalog, manage a library, and play tracks with synchronized lyrics and reactive visuals. The graph also captures desktop integrations and supporting services. Several feature implementations were not sampled, so their internal call paths are omitted; README-documented backend behavior is labeled explicitly.

Main entry points: [`src/features/player/engine/playerEngine.ts`](https://github.com/tryliner/desktop/blob/main/src/features/player/engine/playerEngine.ts) (Playback coordinator), [`src/app/App.tsx`](https://github.com/tryliner/desktop/blob/main/src/app/App.tsx) (App shell and routes), [`electron/main.ts`](https://github.com/tryliner/desktop/blob/main/electron/main.ts) (Electron main process), [`src/shared/api/api.ts`](https://github.com/tryliner/desktop/blob/main/src/shared/api/api.ts) (Liner API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and discovery"]
  node_app["App shell and routes<br/>[App.tsx]"]
  node_auth["Authentication<br/>[LoginPage.tsx]"]
  node_home["Home recommendations<br/>[HomePage.tsx]"]
  node_search["Catalog search<br/>[useSearchAll.ts]"]
  node_collection["Artist and collection pages<br/>[CollectionPage.tsx]"]
  node_library["Library and playlists<br/>[PlaylistPage.tsx]"]
end

subgraph group_playback["Playback experience"]
  node_player["Playback coordinator<br/>[playerEngine.ts]"]
  node_runtime["Audio runtime<br/>[playerRuntime.ts]"]
  node_playerui["Player controls and views<br/>[MiniPlayer.tsx]"]
  node_lyrics["Synced lyrics"]
  node_visuals["Reactive visuals<br/>[kawarpEngine.ts]"]
  node_covers["Cover art<br/>[coverArt.ts]"]
end

subgraph group_platform["Desktop capabilities"]
  node_desktop["Electron main process<br/>[main.ts]"]
  node_connectivity["Connectivity diagnostics<br/>[diagnostics.ts]"]
  node_overlay["Overlay player<br/>[useOverlaySync.ts]"]
  node_touchbar["Touch Bar controls<br/>[useTouchBarSync.ts]"]
  node_updates["Application updates<br/>[updaterStore.ts]"]
end

subgraph group_services["Shared services"]
  node_api["Liner API client<br/>[api.ts]"]
  node_storage[("Local media and metadata<br/>[linerDb.ts]")]
  node_cache[("Query cache<br/>[queryCache.ts]")]
  node_signing["Request and cover signing<br/>[crypto.ts]"]
  node_visualengine["Rust signing core<br/>[crypto.rs]"]
end

node_listener(("Listener"))

node_listener -->|"opens"| node_app
node_app -->|"routes to"| node_auth
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_collection
node_app -->|"routes to"| node_library
node_app -->|"routes to"| node_playerui
node_listener -->|"searches catalog"| node_search
node_search -->|"queries"| node_api
node_library -->|"loads playlists"| node_api
node_listener -->|"controls playback"| node_playerui
node_player -->|"commands"| node_runtime
node_player -->|"requests playback data"| node_api
node_player -->|"reads lyrics cache"| node_storage
node_player -->|"parses lyrics"| node_lyrics
node_player -->|"checks lyrics cache"| node_cache
node_playerui -.->|"delegates playback"| node_player
node_runtime -->|"streams music"| node_listener
node_api -->|"provides catalog and lyrics"| node_listener
node_player -.->|"uses audio visuals"| node_visuals
node_desktop -->|"invokes signer"| node_signing
node_signing -.->|"uses Rust signing core"| node_visualengine
node_desktop -.->|"provides diagnostics"| node_connectivity
node_desktop -.->|"supports overlay window"| node_overlay
node_desktop -.->|"supports Touch Bar"| node_touchbar
node_desktop -.->|"delivers update events"| node_updates
node_listener -.->|"runs diagnostics"| node_connectivity
node_listener -.->|"uses overlay"| node_overlay
node_listener -.->|"uses controls"| node_touchbar
node_covers -.->|"signs cover URLs"| node_signing

click node_app "https://github.com/tryliner/desktop/blob/main/src/app/App.tsx"
click node_auth "https://github.com/tryliner/desktop/blob/main/src/features/auth/ui/LoginPage.tsx"
click node_home "https://github.com/tryliner/desktop/blob/main/src/features/home/ui/HomePage.tsx"
click node_search "https://github.com/tryliner/desktop/blob/main/src/features/search/hooks/useSearchAll.ts"
click node_collection "https://github.com/tryliner/desktop/blob/main/src/features/collection/ui/CollectionPage.tsx"
click node_library "https://github.com/tryliner/desktop/blob/main/src/features/library/ui/PlaylistPage.tsx"
click node_player "https://github.com/tryliner/desktop/blob/main/src/features/player/engine/playerEngine.ts"
click node_runtime "https://github.com/tryliner/desktop/blob/main/src/features/player/engine/playerRuntime.ts"
click node_playerui "https://github.com/tryliner/desktop/blob/main/src/features/player/ui/MiniPlayer.tsx"
click node_lyrics "https://github.com/tryliner/desktop/blob/main/src/features/lyrics/hooks/useLyricsAnimator.ts"
click node_visuals "https://github.com/tryliner/desktop/blob/main/src/features/player/engine/kawarpEngine.ts"
click node_covers "https://github.com/tryliner/desktop/blob/main/src/features/covers/lib/coverArt.ts"
click node_desktop "https://github.com/tryliner/desktop/blob/main/electron/main.ts"
click node_connectivity "https://github.com/tryliner/desktop/blob/main/src/features/connectivity/lib/diagnostics.ts"
click node_overlay "https://github.com/tryliner/desktop/blob/main/src/features/overlay/hooks/useOverlaySync.ts"
click node_touchbar "https://github.com/tryliner/desktop/blob/main/src/features/touchbar/hooks/useTouchBarSync.ts"
click node_updates "https://github.com/tryliner/desktop/blob/main/src/features/updater/store/updaterStore.ts"
click node_api "https://github.com/tryliner/desktop/blob/main/src/shared/api/api.ts"
click node_storage "https://github.com/tryliner/desktop/blob/main/src/shared/storage/linerDb.ts"
click node_cache "https://github.com/tryliner/desktop/blob/main/src/shared/cache/queryCache.ts"
click node_signing "https://github.com/tryliner/desktop/blob/main/electron/crypto.ts"
click node_visualengine "https://github.com/tryliner/desktop/blob/main/signer/src/crypto.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_auth,node_home,node_search,node_collection,node_library toneBlue
class node_player,node_runtime,node_playerui,node_lyrics,node_visuals,node_covers toneAmber
class node_desktop,node_connectivity,node_overlay,node_touchbar,node_updates toneMint
class node_api,node_storage,node_cache,node_signing,node_visualengine toneRose
class node_listener toneIndigo
```

## Components

### App and discovery

- [App shell and routes](https://github.com/tryliner/desktop/blob/main/src/app/App.tsx): `src/app/App.tsx`
- [Authentication](https://github.com/tryliner/desktop/blob/main/src/features/auth/ui/LoginPage.tsx): `src/features/auth/ui/LoginPage.tsx`
- [Home recommendations](https://github.com/tryliner/desktop/blob/main/src/features/home/ui/HomePage.tsx): `src/features/home/ui/HomePage.tsx`
- [Catalog search](https://github.com/tryliner/desktop/blob/main/src/features/search/hooks/useSearchAll.ts): `src/features/search/hooks/useSearchAll.ts`
- [Artist and collection pages](https://github.com/tryliner/desktop/blob/main/src/features/collection/ui/CollectionPage.tsx): `src/features/collection/ui/CollectionPage.tsx`
- [Library and playlists](https://github.com/tryliner/desktop/blob/main/src/features/library/ui/PlaylistPage.tsx): `src/features/library/ui/PlaylistPage.tsx`

### Playback experience

- [Playback coordinator](https://github.com/tryliner/desktop/blob/main/src/features/player/engine/playerEngine.ts): `src/features/player/engine/playerEngine.ts`
- [Audio runtime](https://github.com/tryliner/desktop/blob/main/src/features/player/engine/playerRuntime.ts): `src/features/player/engine/playerRuntime.ts`
- [Player controls and views](https://github.com/tryliner/desktop/blob/main/src/features/player/ui/MiniPlayer.tsx): `src/features/player/ui/MiniPlayer.tsx`
- [Synced lyrics](https://github.com/tryliner/desktop/blob/main/src/features/lyrics/hooks/useLyricsAnimator.ts): `src/features/lyrics/hooks/useLyricsAnimator.ts`
- [Reactive visuals](https://github.com/tryliner/desktop/blob/main/src/features/player/engine/kawarpEngine.ts): `src/features/player/engine/kawarpEngine.ts`
- [Cover art](https://github.com/tryliner/desktop/blob/main/src/features/covers/lib/coverArt.ts): `src/features/covers/lib/coverArt.ts`

### Desktop capabilities

- [Electron main process](https://github.com/tryliner/desktop/blob/main/electron/main.ts): `electron/main.ts`
- [Connectivity diagnostics](https://github.com/tryliner/desktop/blob/main/src/features/connectivity/lib/diagnostics.ts): `src/features/connectivity/lib/diagnostics.ts`
- [Overlay player](https://github.com/tryliner/desktop/blob/main/src/features/overlay/hooks/useOverlaySync.ts): `src/features/overlay/hooks/useOverlaySync.ts`
- [Touch Bar controls](https://github.com/tryliner/desktop/blob/main/src/features/touchbar/hooks/useTouchBarSync.ts): `src/features/touchbar/hooks/useTouchBarSync.ts`
- [Application updates](https://github.com/tryliner/desktop/blob/main/src/features/updater/store/updaterStore.ts): `src/features/updater/store/updaterStore.ts`

### Shared services

- [Liner API client](https://github.com/tryliner/desktop/blob/main/src/shared/api/api.ts): `src/shared/api/api.ts`
- [Local media and metadata](https://github.com/tryliner/desktop/blob/main/src/shared/storage/linerDb.ts): `src/shared/storage/linerDb.ts`
- [Query cache](https://github.com/tryliner/desktop/blob/main/src/shared/cache/queryCache.ts): `src/shared/cache/queryCache.ts`
- [Request and cover signing](https://github.com/tryliner/desktop/blob/main/electron/crypto.ts): `electron/crypto.ts`
- [Rust signing core](https://github.com/tryliner/desktop/blob/main/signer/src/crypto.rs): `signer/src/crypto.rs`

### Other components

- **Listener**

## Connections

- Listener → App shell and routes: opens
- App shell and routes → Authentication: routes to
- App shell and routes → Home recommendations: routes to
- App shell and routes → Artist and collection pages: routes to
- App shell and routes → Library and playlists: routes to
- App shell and routes → Player controls and views: routes to
- Listener → Catalog search: searches catalog
- Catalog search → Liner API client: queries
- Library and playlists → Liner API client: loads playlists
- Listener → Player controls and views: controls playback
- Playback coordinator → Audio runtime: commands (evidence: `src/features/player/engine/playerEngine.ts`)
- Playback coordinator → Liner API client: requests playback data (evidence: `src/features/player/engine/playerEngine.ts`)
- Playback coordinator → Local media and metadata: reads lyrics cache (evidence: `src/features/player/engine/playerEngine.ts`)
- Playback coordinator → Synced lyrics: parses lyrics (evidence: `src/features/player/engine/playerEngine.ts`)
- Playback coordinator → Query cache: checks lyrics cache (evidence: `src/features/player/engine/playerEngine.ts`)
- Player controls and views → Playback coordinator: delegates playback
- Audio runtime → Listener: streams music (evidence: `README.md`)
- Liner API client → Listener: provides catalog and lyrics (evidence: `README.md`)
- Playback coordinator → Reactive visuals: uses audio visuals
- Electron main process → Request and cover signing: invokes signer (evidence: `electron/main.ts`)
- Request and cover signing → Rust signing core: uses Rust signing core
- Electron main process → Connectivity diagnostics: provides diagnostics
- Electron main process → Overlay player: supports overlay window
- Electron main process → Touch Bar controls: supports Touch Bar
- Electron main process → Application updates: delivers update events
- Listener → Connectivity diagnostics: runs diagnostics
- Listener → Overlay player: uses overlay
- Listener → Touch Bar controls: uses controls
- Cover art → Request and cover signing: signs cover URLs
