# rinkio-lab/lyricex architecture

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

- Interactive diagram: https://gitdiagram.com/rinkio-lab/lyricex
- Repository: https://github.com/rinkio-lab/lyricex

## Overview

LyricEx is a static, browser-based Japanese lyric study and karaoke tool. The main workflow is to load a lyric pack or LRC, view and study timed lyrics, then use the editor to build or modify a pack and export it. Other documented capabilities include AI-assisted word analysis, audio controls and effects, sharing, settings backup, and offline PWA use. The README documents these product flows, but the application modules themselves were not excerpted, so edges describe documented behavior rather than verified source-level calls.

Main entry points: [`assets/scripts/app.js`](https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/app.js) (App bootstrap), [`assets/scripts/ui/workspace.js`](https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/ui/workspace.js) (Pack builder), [`assets/scripts/ui/editor.js`](https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/ui/editor.js) (Editor UI), [`assets/scripts/utils/ai-import.js`](https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/utils/ai-import.js) (Word analysis import)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application and views"]
  node_app["App bootstrap<br/>[app.js]"]
  node_workspace["Workspace UI<br/>[workspace.js]"]
  node_editorui["Editor UI<br/>[editor.js]"]
  node_settings["Settings UI<br/>[settings.js]"]
  node_dialog["Dialogs<br/>[dialog.js]"]
end

subgraph group_lyrics["Lyrics and study"]
  node_lyricsview["Lyrics view<br/>[app.js]"]
  node_studyview["Study view<br/>[app.js]"]
  node_mixedview["Mixed view<br/>[app.js]"]
  node_lyricparse["Lyrics and package helpers<br/>[lib.js]"]
  node_wordanalysis["Word analysis import<br/>[ai-import.js]"]
  node_aiprompt["AI prompt<br/>[ai-prompt.js]"]
end

subgraph group_editor["Pack editing"]
  node_builder["Pack builder<br/>[workspace.js]"]
  node_export["Lyric package export<br/>[lyric-package.js]"]
end

subgraph group_media["Audio and sharing"]
  node_audio["Audio graph<br/>[audio-graph.js]"]
  node_pitch["Pitch shift<br/>[pitch-shift.js]"]
  node_video["Video export<br/>[video.js]"]
  node_share["Share tools<br/>[share.js]"]
end

subgraph group_persistence["Storage and offline"]
  node_libraryui["Library UI<br/>[library-ui.js]"]
  node_librarydb[("Library database<br/>[library-db.js]")]
  node_recent[("Recent store<br/>[recent-store.js]")]
  node_serviceworker["Offline service worker<br/>[sw.js]"]
  node_swregister["Service worker registration<br/>[sw-register.js]"]
end

node_user(("User"))
node_llm(("External LLM"))

node_user -->|"opens tool"| node_app
node_user -->|"uploads pack or LRC"| node_lyricparse
node_app -->|"shows lyrics"| node_lyricsview
node_app -->|"shows study"| node_studyview
node_app -->|"shows mixed view"| node_mixedview
node_user -->|"opens editor"| node_editorui
node_editorui -->|"opens build tab"| node_builder
node_builder -->|"exports pack"| node_export
node_builder -->|"imports LRC"| node_lyricparse
node_aiprompt -->|"copies prompt"| node_llm
node_llm -->|"returns JSON"| node_wordanalysis
node_wordanalysis -->|"adds analysis"| node_builder
node_user -->|"plays local audio"| node_audio
node_user -->|"backs up settings"| node_settings
node_user -->|"creates share card"| node_share
node_user -.->|"uses library"| node_libraryui
node_libraryui -.->|"persists library"| node_librarydb
node_app -->|"enables offline install"| node_swregister
node_swregister -.->|"registers worker"| node_serviceworker
node_serviceworker -->|"serves cached app"| node_user

click node_app "https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/app.js"
click node_workspace "https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/ui/workspace.js"
click node_editorui "https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/ui/editor.js"
click node_settings "https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/ui/settings.js"
click node_dialog "https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/ui/dialog.js"
click node_lyricsview "https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/app.js"
click node_studyview "https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/app.js"
click node_mixedview "https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/app.js"
click node_lyricparse "https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/lib.js"
click node_wordanalysis "https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/utils/ai-import.js"
click node_aiprompt "https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/utils/ai-prompt.js"
click node_builder "https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/ui/workspace.js"
click node_export "https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/utils/lyric-package.js"
click node_audio "https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/modules/audio-graph.js"
click node_pitch "https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/modules/pitch-shift.js"
click node_video "https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/modules/video.js"
click node_share "https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/ui/share.js"
click node_libraryui "https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/library/library-ui.js"
click node_librarydb "https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/library/library-db.js"
click node_recent "https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/modules/recent-store.js"
click node_serviceworker "https://github.com/rinkio-lab/lyricex/blob/main/sw.js"
click node_swregister "https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/sw-register.js"

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_workspace,node_editorui,node_settings,node_dialog,node_user toneBlue
class node_lyricsview,node_studyview,node_mixedview,node_lyricparse,node_wordanalysis,node_aiprompt toneAmber
class node_builder,node_export toneMint
class node_audio,node_pitch,node_video,node_share toneRose
class node_libraryui,node_librarydb,node_recent,node_serviceworker,node_swregister,node_llm toneIndigo
```

## Components

### Application and views

- [App bootstrap](https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/app.js): `assets/scripts/app.js`
- [Workspace UI](https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/ui/workspace.js): `assets/scripts/ui/workspace.js`
- [Editor UI](https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/ui/editor.js): `assets/scripts/ui/editor.js`
- [Settings UI](https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/ui/settings.js): `assets/scripts/ui/settings.js`
- [Dialogs](https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/ui/dialog.js): `assets/scripts/ui/dialog.js`

### Lyrics and study

- [Lyrics view](https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/app.js): `assets/scripts/app.js`
- [Study view](https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/app.js): `assets/scripts/app.js`
- [Mixed view](https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/app.js): `assets/scripts/app.js`
- [Lyrics and package helpers](https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/lib.js): `assets/scripts/lib.js`
- [Word analysis import](https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/utils/ai-import.js): `assets/scripts/utils/ai-import.js`
- [AI prompt](https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/utils/ai-prompt.js): `assets/scripts/utils/ai-prompt.js`

### Pack editing

- [Pack builder](https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/ui/workspace.js): `assets/scripts/ui/workspace.js`
- [Lyric package export](https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/utils/lyric-package.js): `assets/scripts/utils/lyric-package.js`

### Audio and sharing

- [Audio graph](https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/modules/audio-graph.js): `assets/scripts/modules/audio-graph.js`
- [Pitch shift](https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/modules/pitch-shift.js): `assets/scripts/modules/pitch-shift.js`
- [Video export](https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/modules/video.js): `assets/scripts/modules/video.js`
- [Share tools](https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/ui/share.js): `assets/scripts/ui/share.js`

### Storage and offline

- [Library UI](https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/library/library-ui.js): `assets/scripts/library/library-ui.js`
- [Library database](https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/library/library-db.js): `assets/scripts/library/library-db.js`
- [Recent store](https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/modules/recent-store.js): `assets/scripts/modules/recent-store.js`
- [Offline service worker](https://github.com/rinkio-lab/lyricex/blob/main/sw.js): `sw.js`
- [Service worker registration](https://github.com/rinkio-lab/lyricex/blob/main/assets/scripts/sw-register.js): `assets/scripts/sw-register.js`

### Other components

- **User**
- **External LLM**

## Connections

- User → App bootstrap: opens tool (evidence: `README.md`)
- User → Lyrics and package helpers: uploads pack or LRC (evidence: `README.md`)
- App bootstrap → Lyrics view: shows lyrics (evidence: `README.md`)
- App bootstrap → Study view: shows study (evidence: `README.md`)
- App bootstrap → Mixed view: shows mixed view (evidence: `README.md`)
- User → Editor UI: opens editor (evidence: `README.md`)
- Editor UI → Pack builder: opens build tab (evidence: `README.md`)
- Pack builder → Lyric package export: exports pack (evidence: `README.md`)
- Pack builder → Lyrics and package helpers: imports LRC (evidence: `README.md`)
- AI prompt → External LLM: copies prompt (evidence: `README.md`)
- External LLM → Word analysis import: returns JSON (evidence: `README.md`)
- Word analysis import → Pack builder: adds analysis (evidence: `README.md`)
- User → Audio graph: plays local audio (evidence: `README.md`)
- User → Settings UI: backs up settings (evidence: `README.md`)
- User → Share tools: creates share card (evidence: `README.md`)
- User → Library UI: uses library
- Library UI → Library database: persists library
- App bootstrap → Service worker registration: enables offline install (evidence: `README.md`)
- Service worker registration → Offline service worker: registers worker
- Offline service worker → User: serves cached app (evidence: `sw.js`)
