# samvitorsilva/vervfy architecture

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

- Interactive diagram: https://gitdiagram.com/samvitorsilva/vervfy
- Repository: https://github.com/samvitorsilva/vervfy

## Overview

Vervfy is a self-hosted music library and web player. A user signs in through the Next.js app, uploads audio, and the FastAPI backend stages and processes uploads into a per-user library; the app then retrieves library data and streams audio for playback. The product also supports playlists and favorites, synchronized and custom lyrics, artist information, account settings, and a Web Audio visualizer. README documents frontend-to-backend proxying and optional external lookups; some detailed routes and frontend call sites were not sampled.

Main entry points: [`server.py`](https://github.com/samvitorsilva/vervfy/blob/main/server.py) (FastAPI routes), [`web/src/components/library-app.tsx`](https://github.com/samvitorsilva/vervfy/blob/main/web/src/components/library-app.tsx) (Library interface), [`library.py`](https://github.com/samvitorsilva/vervfy/blob/main/library.py) (Music library), [`audio_store.py`](https://github.com/samvitorsilva/vervfy/blob/main/audio_store.py) (Audio storage client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web app"]
  node_webapp["Next.js app"]
  node_library_ui["Library interface<br/>[library-app.tsx]"]
  node_player_state["Player state<br/>[player-store.ts]"]
  node_lyrics_ui["Lyrics overlay<br/>[lyrics-overlay.tsx]"]
  node_visualizer["Audio visualizer"]
  node_artist_ui["Artist explorer"]
  node_account_ui["Account settings"]
  node_auth_ui["Authentication form<br/>[auth-form.tsx]"]
end

subgraph group_api["API and domain"]
  node_api["FastAPI routes<br/>[server.py]"]
  node_auth["Accounts and sessions<br/>[auth.py]"]
  node_library["Music library<br/>[library.py]"]
end

subgraph group_media["Media processing"]
  node_worker["Upload worker<br/>[upload_worker.py]"]
  node_queue["Upload queue<br/>[upload_queue.py]"]
  node_audio_store["Audio storage client<br/>[audio_store.py]"]
end

subgraph group_persistence["Persistence"]
  node_db["Domain models and sessions<br/>[db.py]"]
  node_database[("PostgreSQL")]
end

subgraph group_integrations["External services"]
  node_redis[("Redis")]
  node_object_storage[("Supabase Storage")]
  node_lrclib["LRCLIB"]
  node_deezer["Deezer"]
  node_wikipedia["Wikipedia"]
end

node_listener(("Listener"))

node_listener -->|"uses"| node_webapp
node_webapp -.->|"presents sign-in"| node_auth_ui
node_webapp -.->|"presents library"| node_library_ui
node_library_ui -->|"proxies requests"| node_api
node_auth_ui -.->|"authenticates"| node_api
node_account_ui -.->|"updates account"| node_api
node_library_ui -.->|"controls playback"| node_player_state
node_player_state -.->|"drives sync"| node_lyrics_ui
node_player_state -.->|"feeds audio"| node_visualizer
node_library_ui -.->|"opens artist info"| node_artist_ui
node_api -->|"uses account services"| node_auth
node_api -->|"handles library requests"| node_library
node_api -->|"enqueues uploads"| node_queue
node_api -->|"stages and streams audio"| node_audio_store
node_api -->|"opens sessions"| node_db
node_auth -->|"stores account data"| node_db
node_library -->|"stores track data"| node_db
node_library -->|"stores audio"| node_audio_store
node_queue -->|"queues jobs"| node_redis
node_worker -->|"claims and acknowledges"| node_queue
node_worker -->|"processes uploads"| node_library
node_worker -->|"reads staged audio"| node_audio_store
node_db -->|"persists records"| node_database
node_audio_store -->|"reads and writes objects"| node_object_storage
node_api -.->|"looks up lyrics"| node_lrclib
node_api -.->|"verifies artist match"| node_deezer
node_api -.->|"fetches artist summary"| node_wikipedia

click node_webapp "https://github.com/samvitorsilva/vervfy/tree/main/web/src/app"
click node_library_ui "https://github.com/samvitorsilva/vervfy/blob/main/web/src/components/library-app.tsx"
click node_player_state "https://github.com/samvitorsilva/vervfy/blob/main/web/src/store/player-store.ts"
click node_lyrics_ui "https://github.com/samvitorsilva/vervfy/blob/main/web/src/components/lyrics-overlay.tsx"
click node_visualizer "https://github.com/samvitorsilva/vervfy/blob/main/web/src/components/visualizer-overlay.tsx"
click node_artist_ui "https://github.com/samvitorsilva/vervfy/blob/main/web/src/components/artist-explorer.tsx"
click node_account_ui "https://github.com/samvitorsilva/vervfy/blob/main/web/src/components/account-settings.tsx"
click node_auth_ui "https://github.com/samvitorsilva/vervfy/blob/main/web/src/components/auth/auth-form.tsx"
click node_api "https://github.com/samvitorsilva/vervfy/blob/main/server.py"
click node_auth "https://github.com/samvitorsilva/vervfy/blob/main/auth.py"
click node_library "https://github.com/samvitorsilva/vervfy/blob/main/library.py"
click node_worker "https://github.com/samvitorsilva/vervfy/blob/main/scripts/upload_worker.py"
click node_queue "https://github.com/samvitorsilva/vervfy/blob/main/upload_queue.py"
click node_audio_store "https://github.com/samvitorsilva/vervfy/blob/main/audio_store.py"
click node_db "https://github.com/samvitorsilva/vervfy/blob/main/db.py"

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_webapp,node_library_ui,node_player_state,node_lyrics_ui,node_visualizer,node_artist_ui,node_account_ui,node_auth_ui toneBlue
class node_api,node_auth,node_library toneAmber
class node_worker,node_queue,node_audio_store toneMint
class node_db,node_database toneRose
class node_redis,node_object_storage,node_lrclib,node_deezer,node_wikipedia,node_listener toneIndigo
```

## Components

### Web app

- [Next.js app](https://github.com/samvitorsilva/vervfy/tree/main/web/src/app): `web/src/app`
- [Library interface](https://github.com/samvitorsilva/vervfy/blob/main/web/src/components/library-app.tsx): `web/src/components/library-app.tsx`
- [Player state](https://github.com/samvitorsilva/vervfy/blob/main/web/src/store/player-store.ts): `web/src/store/player-store.ts`
- [Lyrics overlay](https://github.com/samvitorsilva/vervfy/blob/main/web/src/components/lyrics-overlay.tsx): `web/src/components/lyrics-overlay.tsx`
- [Audio visualizer](https://github.com/samvitorsilva/vervfy/blob/main/web/src/components/visualizer-overlay.tsx): `web/src/components/visualizer-overlay.tsx`
- [Artist explorer](https://github.com/samvitorsilva/vervfy/blob/main/web/src/components/artist-explorer.tsx): `web/src/components/artist-explorer.tsx`
- [Account settings](https://github.com/samvitorsilva/vervfy/blob/main/web/src/components/account-settings.tsx): `web/src/components/account-settings.tsx`
- [Authentication form](https://github.com/samvitorsilva/vervfy/blob/main/web/src/components/auth/auth-form.tsx): `web/src/components/auth/auth-form.tsx`

### API and domain

- [FastAPI routes](https://github.com/samvitorsilva/vervfy/blob/main/server.py): `server.py`
- [Accounts and sessions](https://github.com/samvitorsilva/vervfy/blob/main/auth.py): `auth.py`
- [Music library](https://github.com/samvitorsilva/vervfy/blob/main/library.py): `library.py`

### Media processing

- [Upload worker](https://github.com/samvitorsilva/vervfy/blob/main/scripts/upload_worker.py): `scripts/upload_worker.py`
- [Upload queue](https://github.com/samvitorsilva/vervfy/blob/main/upload_queue.py): `upload_queue.py`
- [Audio storage client](https://github.com/samvitorsilva/vervfy/blob/main/audio_store.py): `audio_store.py`

### Persistence

- [Domain models and sessions](https://github.com/samvitorsilva/vervfy/blob/main/db.py): `db.py`
- **PostgreSQL**

### External services

- **Redis**
- **Supabase Storage**
- **LRCLIB**
- **Deezer**
- **Wikipedia**

### Other components

- **Listener**

## Connections

- Listener → Next.js app: uses (evidence: `README.md`)
- Next.js app → Authentication form: presents sign-in
- Next.js app → Library interface: presents library
- Library interface → FastAPI routes: proxies requests (evidence: `README.md`)
- Authentication form → FastAPI routes: authenticates
- Account settings → FastAPI routes: updates account
- Library interface → Player state: controls playback
- Player state → Lyrics overlay: drives sync
- Player state → Audio visualizer: feeds audio
- Library interface → Artist explorer: opens artist info
- FastAPI routes → Accounts and sessions: uses account services (evidence: `server.py`)
- FastAPI routes → Music library: handles library requests (evidence: `server.py`)
- FastAPI routes → Upload queue: enqueues uploads (evidence: `server.py`)
- FastAPI routes → Audio storage client: stages and streams audio (evidence: `server.py`)
- FastAPI routes → Domain models and sessions: opens sessions (evidence: `server.py`)
- Accounts and sessions → Domain models and sessions: stores account data (evidence: `auth.py`)
- Music library → Domain models and sessions: stores track data (evidence: `library.py`)
- Music library → Audio storage client: stores audio (evidence: `library.py`)
- Upload queue → Redis: queues jobs (evidence: `upload_queue.py`)
- Upload worker → Upload queue: claims and acknowledges (evidence: `scripts/upload_worker.py`)
- Upload worker → Music library: processes uploads (evidence: `scripts/upload_worker.py`)
- Upload worker → Audio storage client: reads staged audio (evidence: `scripts/upload_worker.py`)
- Domain models and sessions → PostgreSQL: persists records (evidence: `db.py`)
- Audio storage client → Supabase Storage: reads and writes objects (evidence: `audio_store.py`)
- FastAPI routes → LRCLIB: looks up lyrics (evidence: `README.md`)
- FastAPI routes → Deezer: verifies artist match (evidence: `README.md`)
- FastAPI routes → Wikipedia: fetches artist summary (evidence: `README.md`)
