# valens429/lyricstudio architecture

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

- Interactive diagram: https://gitdiagram.com/valens429/lyricstudio
- Repository: https://github.com/valens429/lyricstudio

## Overview

Lyric Studio is an Electron desktop editor for timing lyrics to audio and exporting lyric videos. The user edits lyrics and timing in the editor, previews the composition, then can export through the desktop FFmpeg workflow. The graph also shows desktop sign-in and the local server that supports the app. Several editor capabilities are visible only through partial excerpts; links between unsampled editor subsystems are omitted rather than inferred.

Main entry points: [`main.js`](https://github.com/valens429/lyricstudio/blob/main/main.js) (Electron app), [`desktop-auth-main.js`](https://github.com/valens429/lyricstudio/blob/main/desktop-auth-main.js) (Auth IPC handlers), [`preload.js`](https://github.com/valens429/lyricstudio/blob/main/preload.js) (Secure IPC bridge), [`electron-ffmpeg.js`](https://github.com/valens429/lyricstudio/blob/main/electron-ffmpeg.js) (FFmpeg integration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_editor["Lyric editing"]
  node_editor_ui["Lyric editor<br/>[app.js]"]
  node_timing["Lyric timing<br/>[timing.js]"]
  node_themes["Editor themes<br/>[themes.js]"]
  node_platform["Platform features<br/>[platform.js]"]
end

subgraph group_desktop["Desktop runtime"]
  node_desktop_app["Electron app<br/>[main.js]"]
  node_local_server["Local editor server<br/>[server.js]"]
  node_preload["Secure IPC bridge<br/>[preload.js]"]
end

subgraph group_export["Video export"]
  node_mp4_muxer["MP4 muxer<br/>[mp4-muxer.js]"]
  node_export_ui["Export controls<br/>[export-desktop.js]"]
  node_ff_spec["Export specification<br/>[ffmpeg-spec.js]"]
  node_ffmpeg["FFmpeg integration<br/>[electron-ffmpeg.js]"]
end

subgraph group_auth["Desktop sign-in"]
  node_desktop_auth_ui["Sign-in UI<br/>[desktop-auth.js]"]
  node_auth_bridge["Auth IPC handlers"]
end

node_user(("Editor user"))
node_ffmpeg_binary["FFmpeg"]
node_browser(("System browser"))

node_user -->|"edits lyrics"| node_editor_ui
node_timing -->|"uses editor state"| node_editor_ui
node_desktop_app -->|"starts server"| node_local_server
node_desktop_app -->|"registers integration"| node_ffmpeg
node_desktop_app -->|"registers handlers"| node_auth_bridge
node_desktop_app -->|"configures preload"| node_preload
node_desktop_app -->|"loads editor URL"| node_local_server
node_export_ui -->|"calls export bridge"| node_preload
node_preload -->|"invokes IPC handlers"| node_ffmpeg
node_ffmpeg -->|"loads specification"| node_ff_spec
node_export_ui -->|"uses export rules"| node_ff_spec
node_ffmpeg -->|"runs encoder"| node_ffmpeg_binary
node_desktop_auth_ui -->|"uses auth bridge"| node_auth_bridge
node_preload -->|"invokes auth IPC"| node_auth_bridge
node_auth_bridge -->|"opens sign-in URL"| node_browser
node_browser -->|"posts auth result"| node_local_server
node_local_server -->|"delivers callback"| node_auth_bridge
node_user -->|"opens app"| node_desktop_app

click node_editor_ui "https://github.com/valens429/lyricstudio/blob/main/editor/app.js"
click node_timing "https://github.com/valens429/lyricstudio/blob/main/editor/timing.js"
click node_themes "https://github.com/valens429/lyricstudio/blob/main/editor/themes.js"
click node_platform "https://github.com/valens429/lyricstudio/blob/main/editor/platform.js"
click node_mp4_muxer "https://github.com/valens429/lyricstudio/blob/main/editor/mp4-muxer.js"
click node_desktop_app "https://github.com/valens429/lyricstudio/blob/main/main.js"
click node_local_server "https://github.com/valens429/lyricstudio/blob/main/server.js"
click node_preload "https://github.com/valens429/lyricstudio/blob/main/preload.js"
click node_export_ui "https://github.com/valens429/lyricstudio/blob/main/editor/export-desktop.js"
click node_ff_spec "https://github.com/valens429/lyricstudio/blob/main/editor/ffmpeg-spec.js"
click node_ffmpeg "https://github.com/valens429/lyricstudio/blob/main/electron-ffmpeg.js"
click node_desktop_auth_ui "https://github.com/valens429/lyricstudio/blob/main/editor/desktop-auth.js"
click node_auth_bridge "https://github.com/valens429/lyricstudio/blob/main/desktop-auth-main.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_editor_ui,node_timing,node_themes,node_platform,node_user,node_browser toneBlue
class node_desktop_app,node_local_server,node_preload toneAmber
class node_mp4_muxer,node_export_ui,node_ff_spec,node_ffmpeg toneMint
class node_desktop_auth_ui,node_auth_bridge toneRose
class node_ffmpeg_binary toneIndigo
```

## Components

### Lyric editing

- [Lyric editor](https://github.com/valens429/lyricstudio/blob/main/editor/app.js): `editor/app.js`
- [Lyric timing](https://github.com/valens429/lyricstudio/blob/main/editor/timing.js): `editor/timing.js`
- [Editor themes](https://github.com/valens429/lyricstudio/blob/main/editor/themes.js): `editor/themes.js`
- [Platform features](https://github.com/valens429/lyricstudio/blob/main/editor/platform.js): `editor/platform.js`

### Desktop runtime

- [Electron app](https://github.com/valens429/lyricstudio/blob/main/main.js): `main.js`
- [Local editor server](https://github.com/valens429/lyricstudio/blob/main/server.js): `server.js`
- [Secure IPC bridge](https://github.com/valens429/lyricstudio/blob/main/preload.js): `preload.js`

### Video export

- [MP4 muxer](https://github.com/valens429/lyricstudio/blob/main/editor/mp4-muxer.js): `editor/mp4-muxer.js`
- [Export controls](https://github.com/valens429/lyricstudio/blob/main/editor/export-desktop.js): `editor/export-desktop.js`
- [Export specification](https://github.com/valens429/lyricstudio/blob/main/editor/ffmpeg-spec.js): `editor/ffmpeg-spec.js`
- [FFmpeg integration](https://github.com/valens429/lyricstudio/blob/main/electron-ffmpeg.js): `electron-ffmpeg.js`

### Desktop sign-in

- [Sign-in UI](https://github.com/valens429/lyricstudio/blob/main/editor/desktop-auth.js): `editor/desktop-auth.js`
- [Auth IPC handlers](https://github.com/valens429/lyricstudio/blob/main/desktop-auth-main.js): `desktop-auth-main.js`

### Other components

- **Editor user**
- **FFmpeg**
- **System browser**

## Connections

- Editor user → Lyric editor: edits lyrics
- Lyric timing → Lyric editor: uses editor state (evidence: `editor/timing.js`)
- Electron app → Local editor server: starts server (evidence: `main.js`)
- Electron app → FFmpeg integration: registers integration (evidence: `main.js`)
- Electron app → Auth IPC handlers: registers handlers (evidence: `main.js`)
- Electron app → Secure IPC bridge: configures preload (evidence: `main.js`)
- Electron app → Local editor server: loads editor URL (evidence: `main.js`)
- Export controls → Secure IPC bridge: calls export bridge (evidence: `editor/export-desktop.js`)
- Secure IPC bridge → FFmpeg integration: invokes IPC handlers (evidence: `preload.js`)
- FFmpeg integration → Export specification: loads specification (evidence: `electron-ffmpeg.js`)
- Export controls → Export specification: uses export rules (evidence: `editor/export-desktop.js`)
- FFmpeg integration → FFmpeg: runs encoder (evidence: `electron-ffmpeg.js`)
- Sign-in UI → Auth IPC handlers: uses auth bridge (evidence: `editor/desktop-auth.js`)
- Secure IPC bridge → Auth IPC handlers: invokes auth IPC (evidence: `preload.js`)
- Auth IPC handlers → System browser: opens sign-in URL (evidence: `desktop-auth-main.js`)
- System browser → Local editor server: posts auth result (evidence: `server.js`)
- Local editor server → Auth IPC handlers: delivers callback (evidence: `server.js`)
- Editor user → Electron app: opens app
