# varshithchand/musicapp architecture

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

- Interactive diagram: https://gitdiagram.com/varshithchand/musicapp
- Repository: https://github.com/varshithchand/musicapp

## Overview

MusicApp is a music-streaming product with a Node/Express and PostgreSQL API, React Native and web clients, and a separate admin interface. The main user flow is searching or browsing music, then playing it; the API also serves catalog, account, playlist, discovery, and upload capabilities. The graph includes these documented/runtime branches, but source excerpts do not establish most client-to-server request wiring or all backend internals, so uncertain links are omitted or marked dashed.

Main entry points: [`backend/src/index.ts`](https://github.com/varshithchand/musicapp/blob/main/backend/src/index.ts) (API Server), [`mobile/App.tsx`](https://github.com/varshithchand/musicapp/blob/main/mobile/App.tsx) (Mobile App), [`admin/src/App.tsx`](https://github.com/varshithchand/musicapp/blob/main/admin/src/App.tsx) (Admin Console), [`mobile/src/screens/SearchScreen.tsx`](https://github.com/varshithchand/musicapp/blob/main/mobile/src/screens/SearchScreen.tsx) (Mobile Search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Music Clients"]
  node_mobile_app["Mobile App<br/>[App.tsx]"]
  node_mobile_search["Mobile Search<br/>[SearchScreen.tsx]"]
  node_mobile_api["Mobile API Client<br/>[http.ts]"]
  node_mobile_player["Mobile Playback<br/>[controls.ts]"]
  node_web_app["Web App<br/>[App.tsx]"]
  node_web_search["Web Search<br/>[SearchScreen.tsx]"]
  node_web_api["Web API Client<br/>[http.ts]"]
  node_web_player["Web Player<br/>[player.ts]"]
end

subgraph group_api["Backend API"]
  node_api_server["API Server<br/>[index.ts]"]
  node_auth["Authentication<br/>[auth.ts]"]
  node_catalog["Music Catalog<br/>[catalog.ts]"]
  node_discovery["Search &amp; Discovery<br/>[discover.ts]"]
  node_playlists["Playlists &amp; Users<br/>[playlists.ts]"]
  node_uploads["Media Uploads<br/>[uploads.ts]"]
  node_storage[("File Storage<br/>[storage.ts]")]
end

subgraph group_admin["Administration"]
  node_admin_app["Admin Console<br/>[App.tsx]"]
  node_admin_api["Admin API Client<br/>[api.ts]"]
  node_admin_movies["Movie Management<br/>[Movies.tsx]"]
  node_admin_uploads["Upload Management<br/>[Uploads.tsx]"]
end

subgraph group_classification["Classification"]
  node_classifier["Media Classifier"]
end

node_listener(("Listener"))
node_database[("PostgreSQL")]

node_listener -.->|"uses"| node_mobile_app
node_listener -.->|"uses"| node_web_app
node_mobile_app -.->|"navigates to"| node_mobile_search
node_mobile_search -.->|"queries"| node_mobile_api
node_mobile_search -->|"starts playback"| node_mobile_player
node_mobile_app -->|"sets up"| node_mobile_player
node_mobile_app -.->|"requests data"| node_mobile_api
node_web_app -->|"routes to"| node_web_search
node_web_search -.->|"queries"| node_web_api
node_web_search -->|"controls playback"| node_web_player
node_web_app -.->|"requests data"| node_web_api
node_api_server -->|"mounts routes"| node_auth
node_api_server -->|"mounts routes"| node_catalog
node_api_server -->|"mounts routes"| node_discovery
node_api_server -->|"mounts routes"| node_playlists
node_api_server -->|"mounts routes"| node_uploads
node_mobile_api -.->|"calls API"| node_api_server
node_web_api -.->|"calls API"| node_api_server
node_api_server -.->|"uses"| node_database
node_admin_app -->|"renders"| node_admin_movies
node_admin_app -->|"renders"| node_admin_uploads
node_admin_app -->|"uses"| node_admin_api
node_admin_movies -->|"loads data"| node_admin_api
node_admin_uploads -->|"loads data"| node_admin_api
node_uploads -.->|"stores files"| node_storage

click node_mobile_app "https://github.com/varshithchand/musicapp/blob/main/mobile/App.tsx"
click node_mobile_search "https://github.com/varshithchand/musicapp/blob/main/mobile/src/screens/SearchScreen.tsx"
click node_mobile_api "https://github.com/varshithchand/musicapp/blob/main/mobile/src/api/http.ts"
click node_mobile_player "https://github.com/varshithchand/musicapp/blob/main/mobile/src/player/controls.ts"
click node_web_app "https://github.com/varshithchand/musicapp/blob/main/web/src/App.tsx"
click node_web_search "https://github.com/varshithchand/musicapp/blob/main/web/src/screens/SearchScreen.tsx"
click node_web_api "https://github.com/varshithchand/musicapp/blob/main/web/src/api/http.ts"
click node_web_player "https://github.com/varshithchand/musicapp/blob/main/web/src/store/player.ts"
click node_api_server "https://github.com/varshithchand/musicapp/blob/main/backend/src/index.ts"
click node_auth "https://github.com/varshithchand/musicapp/blob/main/backend/src/routes/auth.ts"
click node_catalog "https://github.com/varshithchand/musicapp/blob/main/backend/src/routes/catalog.ts"
click node_discovery "https://github.com/varshithchand/musicapp/blob/main/backend/src/routes/discover.ts"
click node_playlists "https://github.com/varshithchand/musicapp/blob/main/backend/src/routes/playlists.ts"
click node_uploads "https://github.com/varshithchand/musicapp/blob/main/backend/src/routes/uploads.ts"
click node_storage "https://github.com/varshithchand/musicapp/blob/main/backend/src/storage.ts"
click node_admin_app "https://github.com/varshithchand/musicapp/blob/main/admin/src/App.tsx"
click node_admin_api "https://github.com/varshithchand/musicapp/blob/main/admin/src/api.ts"
click node_admin_movies "https://github.com/varshithchand/musicapp/blob/main/admin/src/Movies.tsx"
click node_admin_uploads "https://github.com/varshithchand/musicapp/blob/main/admin/src/Uploads.tsx"
click node_classifier "https://github.com/varshithchand/musicapp/tree/main/backend/src/classifier"

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_mobile_app,node_mobile_search,node_mobile_api,node_mobile_player,node_web_app,node_web_search,node_web_api,node_web_player toneBlue
class node_api_server,node_auth,node_catalog,node_discovery,node_playlists,node_uploads,node_storage,node_database toneAmber
class node_admin_app,node_admin_api,node_admin_movies,node_admin_uploads toneMint
class node_classifier toneRose
class node_listener toneIndigo
```

## Components

### Music Clients

- [Mobile App](https://github.com/varshithchand/musicapp/blob/main/mobile/App.tsx): `mobile/App.tsx`
- [Mobile Search](https://github.com/varshithchand/musicapp/blob/main/mobile/src/screens/SearchScreen.tsx): `mobile/src/screens/SearchScreen.tsx`
- [Mobile API Client](https://github.com/varshithchand/musicapp/blob/main/mobile/src/api/http.ts): `mobile/src/api/http.ts`
- [Mobile Playback](https://github.com/varshithchand/musicapp/blob/main/mobile/src/player/controls.ts): `mobile/src/player/controls.ts`
- [Web App](https://github.com/varshithchand/musicapp/blob/main/web/src/App.tsx): `web/src/App.tsx`
- [Web Search](https://github.com/varshithchand/musicapp/blob/main/web/src/screens/SearchScreen.tsx): `web/src/screens/SearchScreen.tsx`
- [Web API Client](https://github.com/varshithchand/musicapp/blob/main/web/src/api/http.ts): `web/src/api/http.ts`
- [Web Player](https://github.com/varshithchand/musicapp/blob/main/web/src/store/player.ts): `web/src/store/player.ts`

### Backend API

- [API Server](https://github.com/varshithchand/musicapp/blob/main/backend/src/index.ts): `backend/src/index.ts`
- [Authentication](https://github.com/varshithchand/musicapp/blob/main/backend/src/routes/auth.ts): `backend/src/routes/auth.ts`
- [Music Catalog](https://github.com/varshithchand/musicapp/blob/main/backend/src/routes/catalog.ts): `backend/src/routes/catalog.ts`
- [Search & Discovery](https://github.com/varshithchand/musicapp/blob/main/backend/src/routes/discover.ts): `backend/src/routes/discover.ts`
- [Playlists & Users](https://github.com/varshithchand/musicapp/blob/main/backend/src/routes/playlists.ts): `backend/src/routes/playlists.ts`
- [Media Uploads](https://github.com/varshithchand/musicapp/blob/main/backend/src/routes/uploads.ts): `backend/src/routes/uploads.ts`
- [File Storage](https://github.com/varshithchand/musicapp/blob/main/backend/src/storage.ts): `backend/src/storage.ts`

### Administration

- [Admin Console](https://github.com/varshithchand/musicapp/blob/main/admin/src/App.tsx): `admin/src/App.tsx`
- [Admin API Client](https://github.com/varshithchand/musicapp/blob/main/admin/src/api.ts): `admin/src/api.ts`
- [Movie Management](https://github.com/varshithchand/musicapp/blob/main/admin/src/Movies.tsx): `admin/src/Movies.tsx`
- [Upload Management](https://github.com/varshithchand/musicapp/blob/main/admin/src/Uploads.tsx): `admin/src/Uploads.tsx`

### Classification

- [Media Classifier](https://github.com/varshithchand/musicapp/tree/main/backend/src/classifier): `backend/src/classifier`

### Other components

- **Listener**
- **PostgreSQL**

## Connections

- Listener → Mobile App: uses
- Listener → Web App: uses
- Mobile App → Mobile Search: navigates to
- Mobile Search → Mobile API Client: queries
- Mobile Search → Mobile Playback: starts playback (evidence: `mobile/src/screens/SearchScreen.tsx`)
- Mobile App → Mobile Playback: sets up (evidence: `mobile/App.tsx`)
- Mobile App → Mobile API Client: requests data
- Web App → Web Search: routes to (evidence: `web/src/App.tsx`)
- Web Search → Web API Client: queries
- Web Search → Web Player: controls playback (evidence: `web/src/screens/SearchScreen.tsx`)
- Web App → Web API Client: requests data
- API Server → Authentication: mounts routes (evidence: `backend/src/index.ts`)
- API Server → Music Catalog: mounts routes (evidence: `backend/src/index.ts`)
- API Server → Search & Discovery: mounts routes (evidence: `backend/src/index.ts`)
- API Server → Playlists & Users: mounts routes (evidence: `backend/src/index.ts`)
- API Server → Media Uploads: mounts routes (evidence: `backend/src/index.ts`)
- Mobile API Client → API Server: calls API
- Web API Client → API Server: calls API
- API Server → PostgreSQL: uses
- Admin Console → Movie Management: renders (evidence: `admin/src/App.tsx`)
- Admin Console → Upload Management: renders (evidence: `admin/src/App.tsx`)
- Admin Console → Admin API Client: uses (evidence: `admin/src/App.tsx`)
- Movie Management → Admin API Client: loads data (evidence: `admin/src/Movies.tsx`)
- Upload Management → Admin API Client: loads data (evidence: `admin/src/Uploads.tsx`)
- Media Uploads → File Storage: stores files
