# alsonick/lrc.notnick.io architecture

> Architecture diagram of the GitHub repository alsonick/lrc.notnick.io, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/alsonick/lrc.notnick.io
- Repository: https://github.com/alsonick/lrc.notnick.io
- Video tour (about a minute): https://gitdiagram.com/alsonick/lrc.notnick.io/video

## Overview

LRC Generator is a browser-based tool for preparing lyrics, timing each line against an audio file or stopwatch, and downloading a synchronized .lrc file. The main workflow runs from the editor through shared lyric state into the synchronizer, which uses a clock and serializes timed lines for download. The README also documents editor cleanup, undo, keyboard controls, and optional Discord feedback. Some components and route wiring are represented from the README and file tree; unsampled implementation details are not expanded.

Main entry points: [`src/components/sync/sync-session.tsx`](https://github.com/alsonick/lrc.notnick.io/blob/main/src/components/sync/sync-session.tsx) (Sync Session), [`src/components/editor/lyrics-editor.tsx`](https://github.com/alsonick/lrc.notnick.io/blob/main/src/components/editor/lyrics-editor.tsx) (Lyrics Editor), [`src/app/api/feedback/route.ts`](https://github.com/alsonick/lrc.notnick.io/blob/main/src/app/api/feedback/route.ts) (Feedback API), [`src/lib/lyrics-store.ts`](https://github.com/alsonick/lrc.notnick.io/blob/main/src/lib/lyrics-store.ts) (Lyrics Store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Lyric Workflow"]
  node_editor_route["Editor Route<br/>[page.tsx]"]
  node_editor["Lyrics Editor<br/>[lyrics-editor.tsx]"]
  node_lrc["LRC Processing<br/>[lrc.ts]"]
  node_file["File Utilities<br/>[file.ts]"]
end

subgraph group_timing["Synchronization"]
  node_sync_route["Sync Route<br/>[page.tsx]"]
  node_sync_page["Sync Page<br/>[sync-page.tsx]"]
  node_session["Sync Session<br/>[sync-session.tsx]"]
  node_clock["Audio Clock<br/>[use-clock.ts]"]
end

subgraph group_shared["Shared State"]
  node_lyrics_store["Lyrics Store<br/>[lyrics-store.ts]"]
  node_browser_storage[("localStorage")]
end

subgraph group_site["Site Features"]
  node_layout["App Layout<br/>[layout.tsx]"]
  node_header["Site Header<br/>[site-header.tsx]"]
  node_feedback["Feedback Dialog"]
  node_feedback_api["Feedback API<br/>[route.ts]"]
  node_feedback_lib["Feedback Validation<br/>[feedback.ts]"]
end

node_user(("User"))
node_audio["Audio Element"]
node_discord["Discord Webhook"]

node_user -->|"opens editor"| node_editor_route
node_editor_route -->|"renders"| node_editor
node_editor -->|"reads and updates"| node_lyrics_store
node_editor -->|"parses and transforms"| node_lrc
node_editor -->|"downloads"| node_file
node_user -->|"opens sync"| node_sync_route
node_sync_route -->|"renders"| node_sync_page
node_sync_page -->|"renders"| node_session
node_session -->|"reads and updates"| node_lyrics_store
node_session -->|"controls timing"| node_clock
node_clock -->|"controls playback"| node_audio
node_session -->|"builds LRC"| node_lrc
node_session -->|"downloads"| node_file
node_lyrics_store -->|"persists lyrics"| node_browser_storage
node_layout -->|"renders"| node_header
node_header -->|"renders"| node_feedback
node_feedback -->|"submits feedback"| node_feedback_api
node_feedback_api -->|"validates and builds"| node_feedback_lib
node_feedback_api -.->|"posts payload"| node_discord

click node_editor_route "https://github.com/alsonick/lrc.notnick.io/blob/main/src/app/page.tsx"
click node_editor "https://github.com/alsonick/lrc.notnick.io/blob/main/src/components/editor/lyrics-editor.tsx"
click node_lrc "https://github.com/alsonick/lrc.notnick.io/blob/main/src/lib/lrc.ts"
click node_file "https://github.com/alsonick/lrc.notnick.io/blob/main/src/lib/file.ts"
click node_sync_route "https://github.com/alsonick/lrc.notnick.io/blob/main/src/app/sync/page.tsx"
click node_sync_page "https://github.com/alsonick/lrc.notnick.io/blob/main/src/components/sync/sync-page.tsx"
click node_session "https://github.com/alsonick/lrc.notnick.io/blob/main/src/components/sync/sync-session.tsx"
click node_clock "https://github.com/alsonick/lrc.notnick.io/blob/main/src/hooks/use-clock.ts"
click node_lyrics_store "https://github.com/alsonick/lrc.notnick.io/blob/main/src/lib/lyrics-store.ts"
click node_layout "https://github.com/alsonick/lrc.notnick.io/blob/main/src/app/layout.tsx"
click node_header "https://github.com/alsonick/lrc.notnick.io/blob/main/src/components/site-header.tsx"
click node_feedback "https://github.com/alsonick/lrc.notnick.io/blob/main/src/components/feedback-dialog.tsx"
click node_feedback_api "https://github.com/alsonick/lrc.notnick.io/blob/main/src/app/api/feedback/route.ts"
click node_feedback_lib "https://github.com/alsonick/lrc.notnick.io/blob/main/src/lib/feedback.ts"

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_route,node_editor,node_lrc,node_file,node_user toneBlue
class node_sync_route,node_sync_page,node_session,node_clock toneAmber
class node_lyrics_store,node_browser_storage,node_discord toneMint
class node_layout,node_header,node_feedback,node_feedback_api,node_feedback_lib toneRose
class node_audio toneIndigo
```

## Components

### Lyric Workflow

- [Editor Route](https://github.com/alsonick/lrc.notnick.io/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Lyrics Editor](https://github.com/alsonick/lrc.notnick.io/blob/main/src/components/editor/lyrics-editor.tsx): `src/components/editor/lyrics-editor.tsx`
- [LRC Processing](https://github.com/alsonick/lrc.notnick.io/blob/main/src/lib/lrc.ts): `src/lib/lrc.ts`
- [File Utilities](https://github.com/alsonick/lrc.notnick.io/blob/main/src/lib/file.ts): `src/lib/file.ts`

### Synchronization

- [Sync Route](https://github.com/alsonick/lrc.notnick.io/blob/main/src/app/sync/page.tsx): `src/app/sync/page.tsx`
- [Sync Page](https://github.com/alsonick/lrc.notnick.io/blob/main/src/components/sync/sync-page.tsx): `src/components/sync/sync-page.tsx`
- [Sync Session](https://github.com/alsonick/lrc.notnick.io/blob/main/src/components/sync/sync-session.tsx): `src/components/sync/sync-session.tsx`
- [Audio Clock](https://github.com/alsonick/lrc.notnick.io/blob/main/src/hooks/use-clock.ts): `src/hooks/use-clock.ts`

### Shared State

- [Lyrics Store](https://github.com/alsonick/lrc.notnick.io/blob/main/src/lib/lyrics-store.ts): `src/lib/lyrics-store.ts`
- **localStorage**

### Site Features

- [App Layout](https://github.com/alsonick/lrc.notnick.io/blob/main/src/app/layout.tsx): `src/app/layout.tsx`
- [Site Header](https://github.com/alsonick/lrc.notnick.io/blob/main/src/components/site-header.tsx): `src/components/site-header.tsx`
- [Feedback Dialog](https://github.com/alsonick/lrc.notnick.io/blob/main/src/components/feedback-dialog.tsx): `src/components/feedback-dialog.tsx`
- [Feedback API](https://github.com/alsonick/lrc.notnick.io/blob/main/src/app/api/feedback/route.ts): `src/app/api/feedback/route.ts`
- [Feedback Validation](https://github.com/alsonick/lrc.notnick.io/blob/main/src/lib/feedback.ts): `src/lib/feedback.ts`

### Other components

- **User**
- **Audio Element**
- **Discord Webhook**

## Connections

- User → Editor Route: opens editor
- Editor Route → Lyrics Editor: renders
- Lyrics Editor → Lyrics Store: reads and updates
- Lyrics Editor → LRC Processing: parses and transforms
- Lyrics Editor → File Utilities: downloads
- User → Sync Route: opens sync
- Sync Route → Sync Page: renders
- Sync Page → Sync Session: renders
- Sync Session → Lyrics Store: reads and updates
- Sync Session → Audio Clock: controls timing
- Audio Clock → Audio Element: controls playback
- Sync Session → LRC Processing: builds LRC
- Sync Session → File Utilities: downloads
- Lyrics Store → localStorage: persists lyrics
- App Layout → Site Header: renders
- Site Header → Feedback Dialog: renders
- Feedback Dialog → Feedback API: submits feedback
- Feedback API → Feedback Validation: validates and builds
- Feedback API → Discord Webhook: posts payload
