# uday-sr/producerhaven architecture

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

- Interactive diagram: https://gitdiagram.com/uday-sr/producerhaven
- Repository: https://github.com/uday-sr/producerhaven

## Overview

ProdHaven is a browser-based music toolkit for musicians and producers. The main workflow is to open the tools workspace, choose a feature, provide audio or a live microphone signal, process or analyze it, then preview or download the result. Its documented capabilities include AI stem separation, instrument tuning, platform-oriented mastering, and waveform feedback; the sampler adds pad-based slicing and preset persistence. Backend routes support mastering, sampler assets and presets, and user authentication. The Python service is documented as the Demucs separation backend, though its implementation was not shown; its connection is therefore left unverified.

Main entry points: [`frontend/src/components/Page/Home.tsx`](https://github.com/uday-sr/producerhaven/blob/main/frontend/src/components/Page/Home.tsx) (Workspace shell), [`backend/src/index.ts`](https://github.com/uday-sr/producerhaven/blob/main/backend/src/index.ts) (HTTP API server), [`frontend/src/components/Features/Splitter.tsx`](https://github.com/uday-sr/producerhaven/blob/main/frontend/src/components/Features/Splitter.tsx) (Stem splitter), [`frontend/src/components/Features/Master/Master.tsx`](https://github.com/uday-sr/producerhaven/blob/main/frontend/src/components/Features/Master/Master.tsx) (Track mastering)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Tools workspace"]
  node_frontend_entry["Frontend entry<br/>[main.tsx]"]
  node_home["Workspace shell<br/>[Home.tsx]"]
  node_sidebar["Feature navigation<br/>[Sidebar.tsx]"]
end

subgraph group_audio_tools["Audio tools"]
  node_splitter_ui["Stem splitter<br/>[Splitter.tsx]"]
  node_tuner_ui["Instrument tuner<br/>[Tuner.tsx]"]
  node_master_ui["Track mastering<br/>[Master.tsx]"]
  node_live_master["Live master preview<br/>[UseliveMaster.tsx]"]
  node_sampler_ui["Audio sampler<br/>[Sampler.tsx]"]
  node_waveform["Waveform player<br/>[AudioWaveform.tsx]"]
end

subgraph group_backend_services["Backend services"]
  node_python_service["AI separation API<br/>[main.py]"]
  node_backend_entry["HTTP API server<br/>[index.ts]"]
  node_master_api["Mastering endpoint"]
  node_sampler_api["Sampler endpoints<br/>[sampler.routes.ts]"]
  node_auth_api["User authentication<br/>[user.ts]"]
  node_ffmpeg["FFmpeg processor"]
end

subgraph group_persistence["Persistence and identity"]
  node_sampler_files[("Sampler file storage<br/>[sampler.routes.ts]")]
  node_mongo[("MongoDB<br/>[db.ts]")]
  node_user_model["User records<br/>[user.model.ts]"]
  node_usage_model["Usage records<br/>[usage.model.ts]"]
end

node_musician(("Musician"))

node_musician -->|"opens tools"| node_frontend_entry
node_frontend_entry -->|"renders"| node_home
node_home -->|"renders navigation"| node_sidebar
node_home -->|"selects feature"| node_splitter_ui
node_home -->|"selects feature"| node_tuner_ui
node_home -->|"selects feature"| node_master_ui
node_home -->|"selects feature"| node_sampler_ui
node_splitter_ui -->|"renders stems"| node_waveform
node_splitter_ui -->|"posts audio"| node_python_service
node_python_service -.->|"returns stems"| node_splitter_ui
node_master_ui -->|"uses preview"| node_live_master
node_master_ui -.->|"requests mastering"| node_backend_entry
node_backend_entry -->|"routes requests"| node_master_api
node_master_api -->|"runs processing"| node_ffmpeg
node_master_api -.->|"downloads master"| node_master_ui
node_sampler_ui -.->|"uses sampler API"| node_backend_entry
node_backend_entry -->|"routes requests"| node_sampler_api
node_sampler_api -->|"stores uploads and presets"| node_sampler_files
node_backend_entry -->|"routes requests"| node_auth_api
node_auth_api -->|"uses database"| node_mongo
node_mongo -->|"loads model"| node_user_model
node_mongo -->|"loads model"| node_usage_model

click node_frontend_entry "https://github.com/uday-sr/producerhaven/blob/main/frontend/src/main.tsx"
click node_home "https://github.com/uday-sr/producerhaven/blob/main/frontend/src/components/Page/Home.tsx"
click node_sidebar "https://github.com/uday-sr/producerhaven/blob/main/frontend/src/components/Layout/Sidebar.tsx"
click node_splitter_ui "https://github.com/uday-sr/producerhaven/blob/main/frontend/src/components/Features/Splitter.tsx"
click node_tuner_ui "https://github.com/uday-sr/producerhaven/blob/main/frontend/src/components/Features/Tuner/Tuner.tsx"
click node_master_ui "https://github.com/uday-sr/producerhaven/blob/main/frontend/src/components/Features/Master/Master.tsx"
click node_live_master "https://github.com/uday-sr/producerhaven/blob/main/frontend/src/components/Features/Master/UseliveMaster.tsx"
click node_sampler_ui "https://github.com/uday-sr/producerhaven/blob/main/frontend/src/components/Features/sampler/Sampler.tsx"
click node_waveform "https://github.com/uday-sr/producerhaven/blob/main/frontend/src/components/Reuse/AudioWaveform.tsx"
click node_python_service "https://github.com/uday-sr/producerhaven/blob/main/ai_service/app/main.py"
click node_backend_entry "https://github.com/uday-sr/producerhaven/blob/main/backend/src/index.ts"
click node_master_api "https://github.com/uday-sr/producerhaven/blob/main/backend/src/routes/services/ffmpeg/equalizer.routes.ts"
click node_sampler_api "https://github.com/uday-sr/producerhaven/blob/main/backend/src/routes/services/sampler/sampler.routes.ts"
click node_auth_api "https://github.com/uday-sr/producerhaven/blob/main/backend/src/routes/auth/user.ts"
click node_sampler_files "https://github.com/uday-sr/producerhaven/blob/main/backend/src/routes/services/sampler/sampler.routes.ts"
click node_mongo "https://github.com/uday-sr/producerhaven/blob/main/backend/src/db/db.ts"
click node_user_model "https://github.com/uday-sr/producerhaven/blob/main/backend/src/db/model/user.model.ts"
click node_usage_model "https://github.com/uday-sr/producerhaven/blob/main/backend/src/db/model/usage.model.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_frontend_entry,node_home,node_sidebar toneBlue
class node_splitter_ui,node_tuner_ui,node_master_ui,node_live_master,node_sampler_ui,node_waveform toneAmber
class node_python_service,node_backend_entry,node_master_api,node_sampler_api,node_auth_api,node_ffmpeg toneMint
class node_sampler_files,node_mongo,node_user_model,node_usage_model toneRose
class node_musician toneIndigo
```

## Components

### Tools workspace

- [Frontend entry](https://github.com/uday-sr/producerhaven/blob/main/frontend/src/main.tsx): `frontend/src/main.tsx`
- [Workspace shell](https://github.com/uday-sr/producerhaven/blob/main/frontend/src/components/Page/Home.tsx): `frontend/src/components/Page/Home.tsx`
- [Feature navigation](https://github.com/uday-sr/producerhaven/blob/main/frontend/src/components/Layout/Sidebar.tsx): `frontend/src/components/Layout/Sidebar.tsx`

### Audio tools

- [Stem splitter](https://github.com/uday-sr/producerhaven/blob/main/frontend/src/components/Features/Splitter.tsx): `frontend/src/components/Features/Splitter.tsx`
- [Instrument tuner](https://github.com/uday-sr/producerhaven/blob/main/frontend/src/components/Features/Tuner/Tuner.tsx): `frontend/src/components/Features/Tuner/Tuner.tsx`
- [Track mastering](https://github.com/uday-sr/producerhaven/blob/main/frontend/src/components/Features/Master/Master.tsx): `frontend/src/components/Features/Master/Master.tsx`
- [Live master preview](https://github.com/uday-sr/producerhaven/blob/main/frontend/src/components/Features/Master/UseliveMaster.tsx): `frontend/src/components/Features/Master/UseliveMaster.tsx`
- [Audio sampler](https://github.com/uday-sr/producerhaven/blob/main/frontend/src/components/Features/sampler/Sampler.tsx): `frontend/src/components/Features/sampler/Sampler.tsx`
- [Waveform player](https://github.com/uday-sr/producerhaven/blob/main/frontend/src/components/Reuse/AudioWaveform.tsx): `frontend/src/components/Reuse/AudioWaveform.tsx`

### Backend services

- [AI separation API](https://github.com/uday-sr/producerhaven/blob/main/ai_service/app/main.py): `ai_service/app/main.py`
- [HTTP API server](https://github.com/uday-sr/producerhaven/blob/main/backend/src/index.ts): `backend/src/index.ts`
- [Mastering endpoint](https://github.com/uday-sr/producerhaven/blob/main/backend/src/routes/services/ffmpeg/equalizer.routes.ts): `backend/src/routes/services/ffmpeg/equalizer.routes.ts`
- [Sampler endpoints](https://github.com/uday-sr/producerhaven/blob/main/backend/src/routes/services/sampler/sampler.routes.ts): `backend/src/routes/services/sampler/sampler.routes.ts`
- [User authentication](https://github.com/uday-sr/producerhaven/blob/main/backend/src/routes/auth/user.ts): `backend/src/routes/auth/user.ts`
- **FFmpeg processor**

### Persistence and identity

- [Sampler file storage](https://github.com/uday-sr/producerhaven/blob/main/backend/src/routes/services/sampler/sampler.routes.ts): `backend/src/routes/services/sampler/sampler.routes.ts`
- [MongoDB](https://github.com/uday-sr/producerhaven/blob/main/backend/src/db/db.ts): `backend/src/db/db.ts`
- [User records](https://github.com/uday-sr/producerhaven/blob/main/backend/src/db/model/user.model.ts): `backend/src/db/model/user.model.ts`
- [Usage records](https://github.com/uday-sr/producerhaven/blob/main/backend/src/db/model/usage.model.ts): `backend/src/db/model/usage.model.ts`

### Other components

- **Musician**

## Connections

- Musician → Frontend entry: opens tools (evidence: `frontend/src/main.tsx`)
- Frontend entry → Workspace shell: renders
- Workspace shell → Feature navigation: renders navigation (evidence: `frontend/src/components/Page/Home.tsx`)
- Workspace shell → Stem splitter: selects feature (evidence: `frontend/src/components/Page/Home.tsx`)
- Workspace shell → Instrument tuner: selects feature (evidence: `frontend/src/components/Page/Home.tsx`)
- Workspace shell → Track mastering: selects feature (evidence: `frontend/src/components/Page/Home.tsx`)
- Workspace shell → Audio sampler: selects feature (evidence: `frontend/src/components/Page/Home.tsx`)
- Stem splitter → Waveform player: renders stems (evidence: `frontend/src/components/Features/Splitter.tsx`)
- Stem splitter → AI separation API: posts audio (evidence: `frontend/src/components/Features/Splitter.tsx`)
- AI separation API → Stem splitter: returns stems
- Track mastering → Live master preview: uses preview (evidence: `frontend/src/components/Features/Master/Master.tsx`)
- Track mastering → HTTP API server: requests mastering
- HTTP API server → Mastering endpoint: routes requests (evidence: `backend/src/index.ts`)
- Mastering endpoint → FFmpeg processor: runs processing (evidence: `backend/src/routes/services/ffmpeg/equalizer.routes.ts`)
- Mastering endpoint → Track mastering: downloads master
- Audio sampler → HTTP API server: uses sampler API
- HTTP API server → Sampler endpoints: routes requests (evidence: `backend/src/index.ts`)
- Sampler endpoints → Sampler file storage: stores uploads and presets (evidence: `backend/src/routes/services/sampler/sampler.routes.ts`)
- HTTP API server → User authentication: routes requests (evidence: `backend/src/index.ts`)
- User authentication → MongoDB: uses database (evidence: `backend/src/routes/auth/user.ts`)
- MongoDB → User records: loads model (evidence: `backend/src/db/db.ts`)
- MongoDB → Usage records: loads model (evidence: `backend/src/db/db.ts`)
