# friesthesalty/lyricrush architecture

> Architecture diagram of the GitHub repository friesthesalty/lyricrush, 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/friesthesalty/lyricrush
- Repository: https://github.com/friesthesalty/lyricrush

## Overview

LyricRush is a browser-based lyric-guessing game. The main workflow is song search or manual song input on the home screen, navigation into the game, and guessing lyric lines against YouTube playback. The sampled game code also shows timing, scoring, playback controls, settings, and a YouTube player. Search, lyrics, and YouTube lookup APIs are distinct server-side capabilities; the lyrics and video lookup routes’ callers are not shown in the excerpts, so those links are omitted. API integrations are supported by the route implementations.

Main entry points: [`src/app/page.tsx`](https://github.com/friesthesalty/lyricrush/blob/master/src/app/page.tsx) (Song Selection), [`src/app/game/page.tsx`](https://github.com/friesthesalty/lyricrush/blob/master/src/app/game/page.tsx) (Game Session), [`src/lib/useSettings.ts`](https://github.com/friesthesalty/lyricrush/blob/master/src/lib/useSettings.ts) (Settings State), [`src/app/api/search/route.ts`](https://github.com/friesthesalty/lyricrush/blob/master/src/app/api/search/route.ts) (Track Search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Song Entry"]
  node_home["Song Selection<br/>[page.tsx]"]
  node_session[("Session State<br/>[page.tsx]")]
end

subgraph group_game["Lyric Game"]
  node_gameplay["Game Session<br/>[page.tsx]"]
  node_youtube["YouTube Player"]
end

subgraph group_settings["Preferences"]
  node_settings_panel["Settings Panel<br/>[SettingsPanel.tsx]"]
  node_settings_hook["Settings State<br/>[useSettings.ts]"]
  node_local_storage[("Browser Storage")]
end

subgraph group_services["Search APIs"]
  node_lyrics_api["Lyrics Lookup<br/>[route.ts]"]
  node_search_api["Track Search<br/>[route.ts]"]
  node_video_api["Video Search<br/>[route.ts]"]
  node_itunes["iTunes Search"]
  node_deezer["Deezer Search"]
  node_lrclib["LRCLIB"]
  node_youtube_search["YouTube Search"]
end

node_listener(("Listener"))

node_listener -->|"chooses song"| node_home
node_home -->|"searches tracks"| node_search_api
node_search_api -->|"queries"| node_itunes
node_search_api -->|"queries"| node_deezer
node_home -->|"stores inputs"| node_session
node_home -->|"opens game"| node_gameplay
node_gameplay -->|"reads manual data"| node_session
node_gameplay -->|"loads player"| node_youtube
node_listener -->|"plays and answers"| node_gameplay
node_home -->|"renders"| node_settings_panel
node_gameplay -->|"renders"| node_settings_panel
node_home -->|"uses settings"| node_settings_hook
node_gameplay -->|"uses settings"| node_settings_hook
node_settings_panel -->|"updates settings"| node_settings_hook
node_settings_hook -->|"reads and writes"| node_local_storage
node_lyrics_api -->|"fetches lyrics"| node_lrclib
node_video_api -->|"searches videos"| node_youtube_search

click node_home "https://github.com/friesthesalty/lyricrush/blob/master/src/app/page.tsx"
click node_session "https://github.com/friesthesalty/lyricrush/blob/master/src/app/page.tsx"
click node_gameplay "https://github.com/friesthesalty/lyricrush/blob/master/src/app/game/page.tsx"
click node_lyrics_api "https://github.com/friesthesalty/lyricrush/blob/master/src/app/api/lyrics/route.ts"
click node_search_api "https://github.com/friesthesalty/lyricrush/blob/master/src/app/api/search/route.ts"
click node_video_api "https://github.com/friesthesalty/lyricrush/blob/master/src/app/api/yt-search/route.ts"
click node_settings_panel "https://github.com/friesthesalty/lyricrush/blob/master/src/components/SettingsPanel.tsx"
click node_settings_hook "https://github.com/friesthesalty/lyricrush/blob/master/src/lib/useSettings.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_home,node_session toneBlue
class node_gameplay,node_youtube toneAmber
class node_settings_panel,node_settings_hook,node_local_storage toneMint
class node_lyrics_api,node_search_api,node_video_api,node_itunes,node_deezer,node_lrclib,node_youtube_search toneRose
class node_listener toneIndigo
```

## Components

### Song Entry

- [Song Selection](https://github.com/friesthesalty/lyricrush/blob/master/src/app/page.tsx): `src/app/page.tsx`
- [Session State](https://github.com/friesthesalty/lyricrush/blob/master/src/app/page.tsx): `src/app/page.tsx`

### Lyric Game

- [Game Session](https://github.com/friesthesalty/lyricrush/blob/master/src/app/game/page.tsx): `src/app/game/page.tsx`
- **YouTube Player**

### Preferences

- [Settings Panel](https://github.com/friesthesalty/lyricrush/blob/master/src/components/SettingsPanel.tsx): `src/components/SettingsPanel.tsx`
- [Settings State](https://github.com/friesthesalty/lyricrush/blob/master/src/lib/useSettings.ts): `src/lib/useSettings.ts`
- **Browser Storage**

### Search APIs

- [Lyrics Lookup](https://github.com/friesthesalty/lyricrush/blob/master/src/app/api/lyrics/route.ts): `src/app/api/lyrics/route.ts`
- [Track Search](https://github.com/friesthesalty/lyricrush/blob/master/src/app/api/search/route.ts): `src/app/api/search/route.ts`
- [Video Search](https://github.com/friesthesalty/lyricrush/blob/master/src/app/api/yt-search/route.ts): `src/app/api/yt-search/route.ts`
- **iTunes Search**
- **Deezer Search**
- **LRCLIB**
- **YouTube Search**

### Other components

- **Listener**

## Connections

- Listener → Song Selection: chooses song (evidence: `src/app/page.tsx`)
- Song Selection → Track Search: searches tracks (evidence: `src/app/page.tsx`)
- Track Search → iTunes Search: queries (evidence: `src/app/api/search/route.ts`)
- Track Search → Deezer Search: queries (evidence: `src/app/api/search/route.ts`)
- Song Selection → Session State: stores inputs (evidence: `src/app/page.tsx`)
- Song Selection → Game Session: opens game (evidence: `src/app/page.tsx`)
- Game Session → Session State: reads manual data (evidence: `src/app/game/page.tsx`)
- Game Session → YouTube Player: loads player (evidence: `src/app/game/page.tsx`)
- Listener → Game Session: plays and answers (evidence: `src/app/game/page.tsx`)
- Song Selection → Settings Panel: renders (evidence: `src/app/page.tsx`)
- Game Session → Settings Panel: renders (evidence: `src/app/game/page.tsx`)
- Song Selection → Settings State: uses settings (evidence: `src/app/page.tsx`)
- Game Session → Settings State: uses settings (evidence: `src/app/game/page.tsx`)
- Settings Panel → Settings State: updates settings (evidence: `src/components/SettingsPanel.tsx`)
- Settings State → Browser Storage: reads and writes (evidence: `src/lib/useSettings.ts`)
- Lyrics Lookup → LRCLIB: fetches lyrics (evidence: `src/app/api/lyrics/route.ts`)
- Video Search → YouTube Search: searches videos (evidence: `src/app/api/yt-search/route.ts`)
