# fefindev/open-audio-collection architecture

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

- Interactive diagram: https://gitdiagram.com/fefindev/open-audio-collection
- Repository: https://github.com/fefindev/open-audio-collection

## Overview

Open Audio Collection is a Tauri desktop app for importing local .oacoll audio collections, organizing songs and playlists, and playing tracks. The visible workflow runs through the TypeScript UI: users import files, the app reads and maps their contents into library records, persists library state, then renders views and plays selected songs. Favorites and playlist management are additional library capabilities. The excerpts show UI-owned import and playback behavior and Rust plugin registration; unsampled playback and persistence details limit further call-level connections.

Main entry points: [`src/main.ts`](https://github.com/fefindev/open-audio-collection/blob/main/src/main.ts) (Collection UI), [`src-tauri/src/lib.rs`](https://github.com/fefindev/open-audio-collection/blob/main/src-tauri/src/lib.rs) (Tauri app runtime), [`src-tauri/src/main.rs`](https://github.com/fefindev/open-audio-collection/blob/main/src-tauri/src/main.rs) (Native entry point), [`src/types.ts`](https://github.com/fefindev/open-audio-collection/blob/main/src/types.ts) (Song and playlist records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_library["Library management"]
  node_ui["Collection UI<br/>[main.ts]"]
  node_import["Collection import<br/>[main.ts]"]
  node_records["Song and playlist records<br/>[types.ts]"]
  node_storage[("Persistent state<br/>[main.ts]")]
  node_oacoll[".oacoll parser<br/>[storage.ts]"]
  node_playlists["Playlist management<br/>[main.ts]"]
  node_favorites["Favorites and library views<br/>[main.ts]"]
end

subgraph group_playback["Audio playback"]
  node_player["Playback controls<br/>[main.ts]"]
  node_queue["Playback queue<br/>[main.ts]"]
  node_audio["Audio element<br/>[main.ts]"]
end

subgraph group_desktop["Desktop runtime"]
  node_tauri["Tauri app runtime<br/>[lib.rs]"]
  node_entry["Native entry point<br/>[main.rs]"]
  node_dialog["File and confirm dialogs"]
  node_filesystem["Local file access"]
  node_store[("Tauri Store plugin")]
end

node_user(("Listener"))

node_user -->|"uses"| node_ui
node_ui -->|"starts import"| node_import
node_import -->|"selects files"| node_dialog
node_import -->|"reads files"| node_filesystem
node_import -->|"creates records"| node_records
node_ui -->|"loads and saves"| node_storage
node_storage -.->|"persists state"| node_store
node_import -.->|"parses collection"| node_oacoll
node_ui -->|"manages"| node_playlists
node_ui -->|"renders and updates"| node_favorites
node_user -->|"controls playback"| node_player
node_player -->|"selects tracks"| node_queue
node_player -->|"controls audio"| node_audio
node_entry -->|"starts runtime"| node_tauri
node_tauri -->|"registers plugin"| node_dialog
node_tauri -->|"registers plugin"| node_filesystem
node_tauri -->|"registers plugin"| node_store

click node_ui "https://github.com/fefindev/open-audio-collection/blob/main/src/main.ts"
click node_import "https://github.com/fefindev/open-audio-collection/blob/main/src/main.ts"
click node_records "https://github.com/fefindev/open-audio-collection/blob/main/src/types.ts"
click node_storage "https://github.com/fefindev/open-audio-collection/blob/main/src/main.ts"
click node_oacoll "https://github.com/fefindev/open-audio-collection/blob/main/src/storage.ts"
click node_playlists "https://github.com/fefindev/open-audio-collection/blob/main/src/main.ts"
click node_favorites "https://github.com/fefindev/open-audio-collection/blob/main/src/main.ts"
click node_player "https://github.com/fefindev/open-audio-collection/blob/main/src/main.ts"
click node_queue "https://github.com/fefindev/open-audio-collection/blob/main/src/main.ts"
click node_audio "https://github.com/fefindev/open-audio-collection/blob/main/src/main.ts"
click node_tauri "https://github.com/fefindev/open-audio-collection/blob/main/src-tauri/src/lib.rs"
click node_entry "https://github.com/fefindev/open-audio-collection/blob/main/src-tauri/src/main.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_ui,node_import,node_records,node_storage,node_oacoll,node_playlists,node_favorites toneBlue
class node_player,node_queue,node_audio toneAmber
class node_tauri,node_entry,node_dialog,node_filesystem,node_store toneMint
class node_user toneIndigo
```

## Components

### Library management

- [Collection UI](https://github.com/fefindev/open-audio-collection/blob/main/src/main.ts): `src/main.ts`
- [Collection import](https://github.com/fefindev/open-audio-collection/blob/main/src/main.ts): `src/main.ts`
- [Song and playlist records](https://github.com/fefindev/open-audio-collection/blob/main/src/types.ts): `src/types.ts`
- [Persistent state](https://github.com/fefindev/open-audio-collection/blob/main/src/main.ts): `src/main.ts`
- [.oacoll parser](https://github.com/fefindev/open-audio-collection/blob/main/src/storage.ts): `src/storage.ts`
- [Playlist management](https://github.com/fefindev/open-audio-collection/blob/main/src/main.ts): `src/main.ts`
- [Favorites and library views](https://github.com/fefindev/open-audio-collection/blob/main/src/main.ts): `src/main.ts`

### Audio playback

- [Playback controls](https://github.com/fefindev/open-audio-collection/blob/main/src/main.ts): `src/main.ts`
- [Playback queue](https://github.com/fefindev/open-audio-collection/blob/main/src/main.ts): `src/main.ts`
- [Audio element](https://github.com/fefindev/open-audio-collection/blob/main/src/main.ts): `src/main.ts`

### Desktop runtime

- [Tauri app runtime](https://github.com/fefindev/open-audio-collection/blob/main/src-tauri/src/lib.rs): `src-tauri/src/lib.rs`
- [Native entry point](https://github.com/fefindev/open-audio-collection/blob/main/src-tauri/src/main.rs): `src-tauri/src/main.rs`
- **File and confirm dialogs**
- **Local file access**
- **Tauri Store plugin**

### Other components

- **Listener**

## Connections

- Listener → Collection UI: uses (evidence: `README.md`)
- Collection UI → Collection import: starts import (evidence: `src/main.ts`)
- Collection import → File and confirm dialogs: selects files (evidence: `src/main.ts`)
- Collection import → Local file access: reads files (evidence: `src/main.ts`)
- Collection import → Song and playlist records: creates records (evidence: `src/main.ts`)
- Collection UI → Persistent state: loads and saves (evidence: `src/main.ts`)
- Persistent state → Tauri Store plugin: persists state
- Collection import → .oacoll parser: parses collection
- Collection UI → Playlist management: manages (evidence: `src/main.ts`)
- Collection UI → Favorites and library views: renders and updates (evidence: `src/main.ts`)
- Listener → Playback controls: controls playback (evidence: `src/main.ts`)
- Playback controls → Playback queue: selects tracks (evidence: `src/main.ts`)
- Playback controls → Audio element: controls audio (evidence: `src/main.ts`)
- Native entry point → Tauri app runtime: starts runtime (evidence: `src-tauri/src/main.rs`)
- Tauri app runtime → File and confirm dialogs: registers plugin (evidence: `src-tauri/src/lib.rs`)
- Tauri app runtime → Local file access: registers plugin (evidence: `src-tauri/src/lib.rs`)
- Tauri app runtime → Tauri Store plugin: registers plugin (evidence: `src-tauri/src/lib.rs`)
