# ganapatinaik1/mumu architecture

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

- Interactive diagram: https://gitdiagram.com/ganapatinaik1/mumu
- Repository: https://github.com/ganapatinaik1/mumu

## Overview

Mumu is a music listening and library app with playlists, search, offline playback, social features, synchronized listening, and account/admin screens. The main user flow is browsing or searching for music, selecting a song, and controlling playback and its queue; authenticated users can also manage playlists and favorites. The graph includes the documented-by-source-index product areas, but the README is only a Vite template and most page and service implementations were not sampled, so their internal connections are intentionally limited.

Main entry points: [`src/contexts/SyncContext.tsx`](https://github.com/ganapatinaik1/mumu/blob/main/src/contexts/SyncContext.tsx) (Listening sync), [`src/hooks/usePlayer.ts`](https://github.com/ganapatinaik1/mumu/blob/main/src/hooks/usePlayer.ts) (Playback hook), [`src/pages/Search.tsx`](https://github.com/ganapatinaik1/mumu/blob/main/src/pages/Search.tsx) (Search screen), [`src/hooks/usePlaylists.ts`](https://github.com/ganapatinaik1/mumu/blob/main/src/hooks/usePlaylists.ts) (Playlist queries)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_entry["React entry<br/>[main.tsx]"]
  node_app_routes["App and routes<br/>[App.tsx]"]
  node_home["Home<br/>[Home.tsx]"]
end

subgraph group_music["Music listening"]
  node_player_context["Playback state<br/>[PlayerContext.tsx]"]
  node_player_hook["Playback hook<br/>[usePlayer.ts]"]
  node_player_ui["Player controls<br/>[MusicPlayer.tsx]"]
  node_full_player["Full-screen player"]
  node_queue["Playback queue<br/>[QueueDrawer.tsx]"]
  node_offline[("Offline cache<br/>[offlineCache.ts]")]
end

subgraph group_library["Library and discovery"]
  node_search_page["Search screen<br/>[Search.tsx]"]
  node_search_hook["Search query<br/>[useSearch.ts]"]
  node_search_service["Search service<br/>[search.ts]"]
  node_library_page["Library screen<br/>[Library.tsx]"]
  node_playlist_hook["Playlist queries<br/>[usePlaylists.ts]"]
  node_playlist_service["Playlist service<br/>[playlists.ts]"]
  node_song_service["Song service<br/>[songs.ts]"]
  node_playlist_details["Playlist details"]
end

subgraph group_social["Social listening"]
  node_sync["Listening sync<br/>[SyncContext.tsx]"]
  node_sync_page["Sync screen<br/>[Sync.tsx]"]
  node_friends["Friend features<br/>[friends.ts]"]
end

subgraph group_account["Account and settings"]
  node_auth["Authentication<br/>[AuthContext.tsx]"]
  node_profile["Profile screens<br/>[Profile.tsx]"]
  node_settings["Settings<br/>[Settings.tsx]"]
  node_admin["Admin tools<br/>[Admin.tsx]"]
end

node_listener(("Listener"))
node_supabase[("Supabase backend")]

node_listener -->|"opens app"| node_entry
node_entry -->|"renders"| node_app_routes
node_search_page -->|"queries"| node_search_hook
node_search_hook -->|"calls"| node_search_service
node_search_page -->|"starts playback"| node_player_hook
node_search_page -->|"renders favorites"| node_library_page
node_library_page -->|"manages playlists"| node_playlist_hook
node_playlist_hook -->|"calls"| node_playlist_service
node_playlist_hook -->|"uses client"| node_supabase
node_queue -->|"reads and updates"| node_player_hook
node_player_hook -.->|"exposes state"| node_player_context
node_player_context -->|"reads and caches"| node_offline
node_sync -->|"reads identity"| node_auth
node_sync -->|"controls playback"| node_player_hook
node_sync -->|"uses audio"| node_player_context
node_sync -->|"broadcasts and queries"| node_supabase

click node_entry "https://github.com/ganapatinaik1/mumu/blob/main/src/main.tsx"
click node_app_routes "https://github.com/ganapatinaik1/mumu/blob/main/src/App.tsx"
click node_auth "https://github.com/ganapatinaik1/mumu/blob/main/src/context/AuthContext.tsx"
click node_home "https://github.com/ganapatinaik1/mumu/blob/main/src/pages/Home.tsx"
click node_search_page "https://github.com/ganapatinaik1/mumu/blob/main/src/pages/Search.tsx"
click node_search_hook "https://github.com/ganapatinaik1/mumu/blob/main/src/hooks/useSearch.ts"
click node_search_service "https://github.com/ganapatinaik1/mumu/blob/main/src/services/search.ts"
click node_library_page "https://github.com/ganapatinaik1/mumu/blob/main/src/pages/Library.tsx"
click node_playlist_hook "https://github.com/ganapatinaik1/mumu/blob/main/src/hooks/usePlaylists.ts"
click node_playlist_service "https://github.com/ganapatinaik1/mumu/blob/main/src/services/playlists.ts"
click node_song_service "https://github.com/ganapatinaik1/mumu/blob/main/src/services/songs.ts"
click node_playlist_details "https://github.com/ganapatinaik1/mumu/blob/main/src/pages/PlaylistDetails.tsx"
click node_player_context "https://github.com/ganapatinaik1/mumu/blob/main/src/contexts/PlayerContext.tsx"
click node_player_hook "https://github.com/ganapatinaik1/mumu/blob/main/src/hooks/usePlayer.ts"
click node_player_ui "https://github.com/ganapatinaik1/mumu/blob/main/src/components/player/MusicPlayer.tsx"
click node_full_player "https://github.com/ganapatinaik1/mumu/blob/main/src/components/player/FullScreenPlayer.tsx"
click node_queue "https://github.com/ganapatinaik1/mumu/blob/main/src/components/player/QueueDrawer.tsx"
click node_offline "https://github.com/ganapatinaik1/mumu/blob/main/src/services/offlineCache.ts"
click node_sync "https://github.com/ganapatinaik1/mumu/blob/main/src/contexts/SyncContext.tsx"
click node_sync_page "https://github.com/ganapatinaik1/mumu/blob/main/src/pages/Sync.tsx"
click node_friends "https://github.com/ganapatinaik1/mumu/blob/main/src/services/friends.ts"
click node_profile "https://github.com/ganapatinaik1/mumu/blob/main/src/pages/Profile.tsx"
click node_settings "https://github.com/ganapatinaik1/mumu/blob/main/src/pages/Settings.tsx"
click node_admin "https://github.com/ganapatinaik1/mumu/blob/main/src/pages/Admin.tsx"

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_entry,node_app_routes,node_home toneBlue
class node_player_context,node_player_hook,node_player_ui,node_full_player,node_queue,node_offline,node_supabase toneAmber
class node_search_page,node_search_hook,node_search_service,node_library_page,node_playlist_hook,node_playlist_service,node_song_service,node_playlist_details toneMint
class node_sync,node_sync_page,node_friends toneRose
class node_auth,node_profile,node_settings,node_admin,node_listener toneIndigo
```

## Components

### App shell

- [React entry](https://github.com/ganapatinaik1/mumu/blob/main/src/main.tsx): `src/main.tsx`
- [App and routes](https://github.com/ganapatinaik1/mumu/blob/main/src/App.tsx): `src/App.tsx`
- [Home](https://github.com/ganapatinaik1/mumu/blob/main/src/pages/Home.tsx): `src/pages/Home.tsx`

### Music listening

- [Playback state](https://github.com/ganapatinaik1/mumu/blob/main/src/contexts/PlayerContext.tsx): `src/contexts/PlayerContext.tsx`
- [Playback hook](https://github.com/ganapatinaik1/mumu/blob/main/src/hooks/usePlayer.ts): `src/hooks/usePlayer.ts`
- [Player controls](https://github.com/ganapatinaik1/mumu/blob/main/src/components/player/MusicPlayer.tsx): `src/components/player/MusicPlayer.tsx`
- [Full-screen player](https://github.com/ganapatinaik1/mumu/blob/main/src/components/player/FullScreenPlayer.tsx): `src/components/player/FullScreenPlayer.tsx`
- [Playback queue](https://github.com/ganapatinaik1/mumu/blob/main/src/components/player/QueueDrawer.tsx): `src/components/player/QueueDrawer.tsx`
- [Offline cache](https://github.com/ganapatinaik1/mumu/blob/main/src/services/offlineCache.ts): `src/services/offlineCache.ts`

### Library and discovery

- [Search screen](https://github.com/ganapatinaik1/mumu/blob/main/src/pages/Search.tsx): `src/pages/Search.tsx`
- [Search query](https://github.com/ganapatinaik1/mumu/blob/main/src/hooks/useSearch.ts): `src/hooks/useSearch.ts`
- [Search service](https://github.com/ganapatinaik1/mumu/blob/main/src/services/search.ts): `src/services/search.ts`
- [Library screen](https://github.com/ganapatinaik1/mumu/blob/main/src/pages/Library.tsx): `src/pages/Library.tsx`
- [Playlist queries](https://github.com/ganapatinaik1/mumu/blob/main/src/hooks/usePlaylists.ts): `src/hooks/usePlaylists.ts`
- [Playlist service](https://github.com/ganapatinaik1/mumu/blob/main/src/services/playlists.ts): `src/services/playlists.ts`
- [Song service](https://github.com/ganapatinaik1/mumu/blob/main/src/services/songs.ts): `src/services/songs.ts`
- [Playlist details](https://github.com/ganapatinaik1/mumu/blob/main/src/pages/PlaylistDetails.tsx): `src/pages/PlaylistDetails.tsx`

### Social listening

- [Listening sync](https://github.com/ganapatinaik1/mumu/blob/main/src/contexts/SyncContext.tsx): `src/contexts/SyncContext.tsx`
- [Sync screen](https://github.com/ganapatinaik1/mumu/blob/main/src/pages/Sync.tsx): `src/pages/Sync.tsx`
- [Friend features](https://github.com/ganapatinaik1/mumu/blob/main/src/services/friends.ts): `src/services/friends.ts`

### Account and settings

- [Authentication](https://github.com/ganapatinaik1/mumu/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Profile screens](https://github.com/ganapatinaik1/mumu/blob/main/src/pages/Profile.tsx): `src/pages/Profile.tsx`
- [Settings](https://github.com/ganapatinaik1/mumu/blob/main/src/pages/Settings.tsx): `src/pages/Settings.tsx`
- [Admin tools](https://github.com/ganapatinaik1/mumu/blob/main/src/pages/Admin.tsx): `src/pages/Admin.tsx`

### Other components

- **Listener**
- **Supabase backend**

## Connections

- Listener → React entry: opens app (evidence: `src/main.tsx`)
- React entry → App and routes: renders (evidence: `src/main.tsx`)
- Search screen → Search query: queries (evidence: `src/pages/Search.tsx`)
- Search query → Search service: calls (evidence: `src/hooks/useSearch.ts`)
- Search screen → Playback hook: starts playback (evidence: `src/pages/Search.tsx`)
- Search screen → Library screen: renders favorites (evidence: `src/pages/Search.tsx`)
- Library screen → Playlist queries: manages playlists (evidence: `src/pages/Library.tsx`)
- Playlist queries → Playlist service: calls (evidence: `src/hooks/usePlaylists.ts`)
- Playlist queries → Supabase backend: uses client (evidence: `src/hooks/usePlaylists.ts`)
- Playback queue → Playback hook: reads and updates (evidence: `src/components/player/QueueDrawer.tsx`)
- Playback hook → Playback state: exposes state
- Playback state → Offline cache: reads and caches (evidence: `src/contexts/PlayerContext.tsx`)
- Listening sync → Authentication: reads identity (evidence: `src/contexts/SyncContext.tsx`)
- Listening sync → Playback hook: controls playback (evidence: `src/contexts/SyncContext.tsx`)
- Listening sync → Playback state: uses audio (evidence: `src/contexts/SyncContext.tsx`)
- Listening sync → Supabase backend: broadcasts and queries (evidence: `src/contexts/SyncContext.tsx`)
