# chthollyphile/folia-major architecture

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

- Interactive diagram: https://gitdiagram.com/chthollyphile/folia-major
- Repository: https://github.com/chthollyphile/folia-major

## Overview

Folia is a cross-platform music player centered on immersive lyric playback. The main user path is to search or browse music, select a track, play it from an online provider or local library, and view synchronized lyrics and visual themes. Local-library matching, Now Playing stage input, AI themes, and Folium mods are distinct capabilities. The graph combines README-documented product flows with relationships visible in the supplied excerpts; unsampled subsystems are represented without asserting unverified internal calls.

Main entry points: [`src/App.tsx`](https://github.com/chthollyphile/folia-major/blob/main/src/App.tsx) (App shell), [`src/hooks/usePlaybackQueueController.ts`](https://github.com/chthollyphile/folia-major/blob/main/src/hooks/usePlaybackQueueController.ts) (Queue controller), [`src/hooks/useStagePlaybackController.ts`](https://github.com/chthollyphile/folia-major/blob/main/src/hooks/useStagePlaybackController.ts) (Stage playback), [`src/services/onlineMusic`](https://github.com/chthollyphile/folia-major/tree/main/src/services/onlineMusic) (Online music providers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App experience"]
  node_app["App shell<br/>[App.tsx]"]
  node_search["Search navigation"]
  node_command["Command palette<br/>[CommandPalette.tsx]"]
  node_theme["AI themes"]
  node_visualizer["Visualizer themes"]
end

subgraph group_playback["Playback and lyrics"]
  node_queue["Queue controller"]
  node_localplay["Library playback"]
  node_transport["Playback transport"]
  node_cache[("Playback and cover cache<br/>[coverCache.ts]")]
  node_stage["Stage playback"]
  node_nowplaying(("Now Playing service"))
  node_lyrics["Lyric rendering"]
end

subgraph group_music["Music sources"]
  node_library["Local library"]
  node_metadata["Metadata search"]
  node_registry["Provider registry"]
  node_omni["Provider operations<br/>[omni.ts]"]
  node_online["Online music providers"]
  node_account["Provider accounts"]
  node_database[("App database<br/>[db.ts]")]
end

subgraph group_platform["Desktop extensions"]
  node_sync["Sync server<br/>[app.ts]"]
  node_mods["Folium mod system<br/>[modSystem.cjs]"]
  node_modmanager["Mod manager<br/>[ModManager.tsx]"]
end

node_listener(("Listener"))

node_listener -->|"uses"| node_app
node_app -->|"opens search"| node_search
node_search -->|"searches providers"| node_online
node_listener -->|"imports music"| node_library
node_library -->|"matches metadata"| node_metadata
node_metadata -->|"resolves provider"| node_registry
node_registry -->|"selects provider"| node_online
node_listener -->|"connects account"| node_account
node_listener -->|"queues track"| node_queue
node_queue -.->|"dispatches playback"| node_transport
node_localplay -->|"reads local songs"| node_database
node_localplay -->|"loads covers"| node_cache
node_queue -.->|"resolves track"| node_online
node_app -.->|"presents stage"| node_stage
node_nowplaying -->|"provides track state"| node_stage
node_stage -->|"drives lyric view"| node_lyrics
node_app -.->|"requests theme"| node_theme
node_theme -->|"provides visual theme"| node_visualizer
node_listener -->|"syncs settings"| node_sync
node_listener -->|"manages mods"| node_modmanager
node_modmanager -->|"enables mods"| node_mods

click node_app "https://github.com/chthollyphile/folia-major/blob/main/src/App.tsx"
click node_search "https://github.com/chthollyphile/folia-major/blob/main/src/stores/useSearchNavigationStore.ts"
click node_command "https://github.com/chthollyphile/folia-major/blob/main/src/components/command-palette/CommandPalette.tsx"
click node_library "https://github.com/chthollyphile/folia-major/blob/main/src/services/localMusicService.ts"
click node_metadata "https://github.com/chthollyphile/folia-major/blob/main/src/services/onlineMetadataSearchService.ts"
click node_registry "https://github.com/chthollyphile/folia-major/blob/main/src/services/onlineMusic/providerRegistry.ts"
click node_omni "https://github.com/chthollyphile/folia-major/blob/main/src/services/onlineMusic/omni.ts"
click node_online "https://github.com/chthollyphile/folia-major/tree/main/src/services/onlineMusic"
click node_account "https://github.com/chthollyphile/folia-major/blob/main/src/library/core/services/providerAccountController.ts"
click node_queue "https://github.com/chthollyphile/folia-major/blob/main/src/hooks/usePlaybackQueueController.ts"
click node_localplay "https://github.com/chthollyphile/folia-major/blob/main/src/hooks/useLibraryPlaybackController.ts"
click node_transport "https://github.com/chthollyphile/folia-major/blob/main/src/services/playbackAdapters.ts"
click node_cache "https://github.com/chthollyphile/folia-major/blob/main/src/services/coverCache.ts"
click node_stage "https://github.com/chthollyphile/folia-major/blob/main/src/hooks/useStagePlaybackController.ts"
click node_lyrics "https://github.com/chthollyphile/folia-major/tree/main/src/components/app/lattice/lyrics"
click node_theme "https://github.com/chthollyphile/folia-major/blob/main/src/hooks/useThemeController.ts"
click node_visualizer "https://github.com/chthollyphile/folia-major/blob/main/src/components/visualizer/monet/monetBackgroundPipeline.ts"
click node_database "https://github.com/chthollyphile/folia-major/blob/main/src/services/db.ts"
click node_sync "https://github.com/chthollyphile/folia-major/blob/main/sync-server/src/app.ts"
click node_mods "https://github.com/chthollyphile/folia-major/blob/main/electron/modSystem/modSystem.cjs"
click node_modmanager "https://github.com/chthollyphile/folia-major/blob/main/src/mods/manager/ModManager.tsx"

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,node_command,node_theme,node_visualizer toneBlue
class node_queue,node_localplay,node_transport,node_cache,node_stage,node_nowplaying,node_lyrics toneAmber
class node_library,node_metadata,node_registry,node_omni,node_online,node_account,node_database toneMint
class node_sync,node_mods,node_modmanager toneRose
class node_listener toneIndigo
```

## Components

### App experience

- [App shell](https://github.com/chthollyphile/folia-major/blob/main/src/App.tsx): `src/App.tsx`
- [Search navigation](https://github.com/chthollyphile/folia-major/blob/main/src/stores/useSearchNavigationStore.ts): `src/stores/useSearchNavigationStore.ts`
- [Command palette](https://github.com/chthollyphile/folia-major/blob/main/src/components/command-palette/CommandPalette.tsx): `src/components/command-palette/CommandPalette.tsx`
- [AI themes](https://github.com/chthollyphile/folia-major/blob/main/src/hooks/useThemeController.ts): `src/hooks/useThemeController.ts`
- [Visualizer themes](https://github.com/chthollyphile/folia-major/blob/main/src/components/visualizer/monet/monetBackgroundPipeline.ts): `src/components/visualizer/monet/monetBackgroundPipeline.ts`

### Playback and lyrics

- [Queue controller](https://github.com/chthollyphile/folia-major/blob/main/src/hooks/usePlaybackQueueController.ts): `src/hooks/usePlaybackQueueController.ts`
- [Library playback](https://github.com/chthollyphile/folia-major/blob/main/src/hooks/useLibraryPlaybackController.ts): `src/hooks/useLibraryPlaybackController.ts`
- [Playback transport](https://github.com/chthollyphile/folia-major/blob/main/src/services/playbackAdapters.ts): `src/services/playbackAdapters.ts`
- [Playback and cover cache](https://github.com/chthollyphile/folia-major/blob/main/src/services/coverCache.ts): `src/services/coverCache.ts`
- [Stage playback](https://github.com/chthollyphile/folia-major/blob/main/src/hooks/useStagePlaybackController.ts): `src/hooks/useStagePlaybackController.ts`
- **Now Playing service**
- [Lyric rendering](https://github.com/chthollyphile/folia-major/tree/main/src/components/app/lattice/lyrics): `src/components/app/lattice/lyrics`

### Music sources

- [Local library](https://github.com/chthollyphile/folia-major/blob/main/src/services/localMusicService.ts): `src/services/localMusicService.ts`
- [Metadata search](https://github.com/chthollyphile/folia-major/blob/main/src/services/onlineMetadataSearchService.ts): `src/services/onlineMetadataSearchService.ts`
- [Provider registry](https://github.com/chthollyphile/folia-major/blob/main/src/services/onlineMusic/providerRegistry.ts): `src/services/onlineMusic/providerRegistry.ts`
- [Provider operations](https://github.com/chthollyphile/folia-major/blob/main/src/services/onlineMusic/omni.ts): `src/services/onlineMusic/omni.ts`
- [Online music providers](https://github.com/chthollyphile/folia-major/tree/main/src/services/onlineMusic): `src/services/onlineMusic`
- [Provider accounts](https://github.com/chthollyphile/folia-major/blob/main/src/library/core/services/providerAccountController.ts): `src/library/core/services/providerAccountController.ts`
- [App database](https://github.com/chthollyphile/folia-major/blob/main/src/services/db.ts): `src/services/db.ts`

### Desktop extensions

- [Sync server](https://github.com/chthollyphile/folia-major/blob/main/sync-server/src/app.ts): `sync-server/src/app.ts`
- [Folium mod system](https://github.com/chthollyphile/folia-major/blob/main/electron/modSystem/modSystem.cjs): `electron/modSystem/modSystem.cjs`
- [Mod manager](https://github.com/chthollyphile/folia-major/blob/main/src/mods/manager/ModManager.tsx): `src/mods/manager/ModManager.tsx`

### Other components

- **Listener**

## Connections

- Listener → App shell: uses (evidence: `README.md`)
- App shell → Search navigation: opens search (evidence: `src/App.tsx`)
- Search navigation → Online music providers: searches providers (evidence: `README.md`)
- Listener → Local library: imports music (evidence: `README.md`)
- Local library → Metadata search: matches metadata (evidence: `README.md`)
- Metadata search → Provider registry: resolves provider (evidence: `src/services/onlineMetadataSearchService.ts`)
- Provider registry → Online music providers: selects provider (evidence: `src/services/onlineMusic/omni.ts`)
- Listener → Provider accounts: connects account (evidence: `README.md`)
- Listener → Queue controller: queues track (evidence: `README.md`)
- Queue controller → Playback transport: dispatches playback (evidence: `src/hooks/usePlaybackQueueController.ts`)
- Library playback → App database: reads local songs (evidence: `src/hooks/useLibraryPlaybackController.ts`)
- Library playback → Playback and cover cache: loads covers (evidence: `src/hooks/useLibraryPlaybackController.ts`)
- Queue controller → Online music providers: resolves track (evidence: `src/hooks/usePlaybackQueueController.ts`)
- App shell → Stage playback: presents stage
- Now Playing service → Stage playback: provides track state (evidence: `README.md`)
- Stage playback → Lyric rendering: drives lyric view (evidence: `README.md`)
- App shell → AI themes: requests theme
- AI themes → Visualizer themes: provides visual theme
- Listener → Sync server: syncs settings (evidence: `README.md`)
- Listener → Mod manager: manages mods (evidence: `README.md`)
- Mod manager → Folium mod system: enables mods (evidence: `README.md`)
