# srisatyalokesh/paatalashala architecture

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

- Interactive diagram: https://gitdiagram.com/srisatyalokesh/paatalashala
- Repository: https://github.com/srisatyalokesh/paatalashala

## Overview

Paatalashala is a Telugu ambient-music web app: visitors choose a themed space, then listen to its curated playlist alongside controllable ambience and space-specific visuals. Space pages coordinate playback and shared player controls; Sammelanam combines catalogs for cross-space discovery. The graph includes documented listener counts, playlist recovery, PWA/update behavior, and distinctive ocean and campfire experiences. Some integrations and page wiring are represented from README or source-index references rather than inspected implementations.

Main entry points: [`src/app/spaces`](https://github.com/srisatyalokesh/paatalashala/tree/main/src/app/spaces) (Themed space pages), [`src/app/page.js`](https://github.com/srisatyalokesh/paatalashala/blob/main/src/app/page.js) (Space chooser), [`src/hooks/useSpacePlayer.js`](https://github.com/srisatyalokesh/paatalashala/blob/main/src/hooks/useSpacePlayer.js) (Player state), [`src/data/sammelanam.js`](https://github.com/srisatyalokesh/paatalashala/blob/main/src/data/sammelanam.js) (Cross-space mix)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Space discovery"]
  node_home["Space chooser<br/>[page.js]"]
  node_spacepages["Themed space pages"]
  node_catalog["Song catalogs<br/>[songs.js]"]
  node_sammelanam["Cross-space mix<br/>[sammelanam.js]"]
end

subgraph group_playback["Playback experience"]
  node_playerhook["Player state<br/>[useSpacePlayer.js]"]
  node_shortcuts["Keyboard controls"]
  node_capsule["Player capsule<br/>[PlayerCapsule.js]"]
  node_hud["Space HUD<br/>[SpaceHudHeader.js]"]
  node_floating["Floating player"]
  node_youtube["YouTube playback<br/>[YouTubePlayer.js]"]
  node_quote["Lyrics and quotes<br/>[QuoteDisplay.js]"]
end

subgraph group_ambience["Ambient spaces"]
  node_weather["Weather particles<br/>[AmbientWeather.js]"]
  node_crossfade["Ambient crossfade"]
  node_ocean["Ocean environment"]
  node_campfire["Campfire environment"]
end

subgraph group_support["Realtime and app support"]
  node_listeners["Listener counts<br/>[ListenersBadge.js]"]
  node_supabase[("Supabase presence<br/>[supabase.js]")]
  node_recovery["Playlist recovery API<br/>[route.js]"]
  node_updates["Update badge<br/>[AppUpdateBadge.js]"]
  node_cache["Cache management<br/>[cacheManager.js]"]
  node_sw["Offline service worker<br/>[sw.js]"]
end

node_listener(("Listener"))
node_youtube_service["YouTube"]
node_supabase_service["Supabase Realtime"]

node_listener -->|"chooses space"| node_home
node_home -->|"opens space"| node_spacepages
node_spacepages -->|"loads songs"| node_catalog
node_spacepages -->|"uses playback state"| node_playerhook
node_spacepages -->|"registers controls"| node_shortcuts
node_spacepages -->|"renders controls"| node_capsule
node_spacepages -->|"renders HUD"| node_hud
node_spacepages -->|"renders player"| node_floating
node_floating -->|"wraps player"| node_youtube
node_youtube -.->|"loads video"| node_youtube_service
node_spacepages -->|"renders lyrics"| node_quote
node_spacepages -->|"renders particles"| node_weather
node_spacepages -->|"renders ocean"| node_ocean
node_spacepages -->|"renders campfire"| node_campfire
node_spacepages -->|"loads mixed catalog"| node_sammelanam
node_sammelanam -->|"merges catalogs"| node_catalog
node_spacepages -->|"uses ambient transitions"| node_crossfade
node_spacepages -->|"renders counts"| node_listeners
node_playerhook -->|"uses client"| node_supabase
node_supabase -.->|"syncs presence"| node_supabase_service
node_playerhook -.->|"requests track removal"| node_recovery
node_home -->|"shows update badge"| node_updates
node_updates -->|"purges caches"| node_cache
node_listener -.->|"installs app"| node_sw

click node_home "https://github.com/srisatyalokesh/paatalashala/blob/main/src/app/page.js"
click node_spacepages "https://github.com/srisatyalokesh/paatalashala/tree/main/src/app/spaces"
click node_catalog "https://github.com/srisatyalokesh/paatalashala/blob/main/src/data/songs.js"
click node_sammelanam "https://github.com/srisatyalokesh/paatalashala/blob/main/src/data/sammelanam.js"
click node_playerhook "https://github.com/srisatyalokesh/paatalashala/blob/main/src/hooks/useSpacePlayer.js"
click node_shortcuts "https://github.com/srisatyalokesh/paatalashala/blob/main/src/hooks/useSpaceKeyboardShortcuts.js"
click node_capsule "https://github.com/srisatyalokesh/paatalashala/blob/main/src/components/space/PlayerCapsule.js"
click node_hud "https://github.com/srisatyalokesh/paatalashala/blob/main/src/components/space/SpaceHudHeader.js"
click node_floating "https://github.com/srisatyalokesh/paatalashala/blob/main/src/components/space/FloatingYouTubePlayer.js"
click node_youtube "https://github.com/srisatyalokesh/paatalashala/blob/main/src/components/YouTubePlayer.js"
click node_quote "https://github.com/srisatyalokesh/paatalashala/blob/main/src/components/space/QuoteDisplay.js"
click node_weather "https://github.com/srisatyalokesh/paatalashala/blob/main/src/components/AmbientWeather.js"
click node_crossfade "https://github.com/srisatyalokesh/paatalashala/blob/main/src/hooks/useCrossfadingAmbientAudio.js"
click node_ocean "https://github.com/srisatyalokesh/paatalashala/blob/main/src/components/space/SamudraTheeramBackground.jsx"
click node_campfire "https://github.com/srisatyalokesh/paatalashala/blob/main/src/components/space/ThreeCampfireBackground.jsx"
click node_listeners "https://github.com/srisatyalokesh/paatalashala/blob/main/src/components/space/ListenersBadge.js"
click node_supabase "https://github.com/srisatyalokesh/paatalashala/blob/main/src/utils/supabase.js"
click node_recovery "https://github.com/srisatyalokesh/paatalashala/blob/main/src/app/api/delete-song/route.js"
click node_updates "https://github.com/srisatyalokesh/paatalashala/blob/main/src/components/AppUpdateBadge.js"
click node_cache "https://github.com/srisatyalokesh/paatalashala/blob/main/src/utils/cacheManager.js"
click node_sw "https://github.com/srisatyalokesh/paatalashala/blob/main/public/sw.js"

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_spacepages,node_catalog,node_sammelanam toneBlue
class node_playerhook,node_shortcuts,node_capsule,node_hud,node_floating,node_youtube,node_quote toneAmber
class node_weather,node_crossfade,node_ocean,node_campfire toneMint
class node_listeners,node_supabase,node_recovery,node_updates,node_cache,node_sw toneRose
class node_listener,node_youtube_service,node_supabase_service toneIndigo
```

## Components

### Space discovery

- [Space chooser](https://github.com/srisatyalokesh/paatalashala/blob/main/src/app/page.js): `src/app/page.js`
- [Themed space pages](https://github.com/srisatyalokesh/paatalashala/tree/main/src/app/spaces): `src/app/spaces`
- [Song catalogs](https://github.com/srisatyalokesh/paatalashala/blob/main/src/data/songs.js): `src/data/songs.js`
- [Cross-space mix](https://github.com/srisatyalokesh/paatalashala/blob/main/src/data/sammelanam.js): `src/data/sammelanam.js`

### Playback experience

- [Player state](https://github.com/srisatyalokesh/paatalashala/blob/main/src/hooks/useSpacePlayer.js): `src/hooks/useSpacePlayer.js`
- [Keyboard controls](https://github.com/srisatyalokesh/paatalashala/blob/main/src/hooks/useSpaceKeyboardShortcuts.js): `src/hooks/useSpaceKeyboardShortcuts.js`
- [Player capsule](https://github.com/srisatyalokesh/paatalashala/blob/main/src/components/space/PlayerCapsule.js): `src/components/space/PlayerCapsule.js`
- [Space HUD](https://github.com/srisatyalokesh/paatalashala/blob/main/src/components/space/SpaceHudHeader.js): `src/components/space/SpaceHudHeader.js`
- [Floating player](https://github.com/srisatyalokesh/paatalashala/blob/main/src/components/space/FloatingYouTubePlayer.js): `src/components/space/FloatingYouTubePlayer.js`
- [YouTube playback](https://github.com/srisatyalokesh/paatalashala/blob/main/src/components/YouTubePlayer.js): `src/components/YouTubePlayer.js`
- [Lyrics and quotes](https://github.com/srisatyalokesh/paatalashala/blob/main/src/components/space/QuoteDisplay.js): `src/components/space/QuoteDisplay.js`

### Ambient spaces

- [Weather particles](https://github.com/srisatyalokesh/paatalashala/blob/main/src/components/AmbientWeather.js): `src/components/AmbientWeather.js`
- [Ambient crossfade](https://github.com/srisatyalokesh/paatalashala/blob/main/src/hooks/useCrossfadingAmbientAudio.js): `src/hooks/useCrossfadingAmbientAudio.js`
- [Ocean environment](https://github.com/srisatyalokesh/paatalashala/blob/main/src/components/space/SamudraTheeramBackground.jsx): `src/components/space/SamudraTheeramBackground.jsx`
- [Campfire environment](https://github.com/srisatyalokesh/paatalashala/blob/main/src/components/space/ThreeCampfireBackground.jsx): `src/components/space/ThreeCampfireBackground.jsx`

### Realtime and app support

- [Listener counts](https://github.com/srisatyalokesh/paatalashala/blob/main/src/components/space/ListenersBadge.js): `src/components/space/ListenersBadge.js`
- [Supabase presence](https://github.com/srisatyalokesh/paatalashala/blob/main/src/utils/supabase.js): `src/utils/supabase.js`
- [Playlist recovery API](https://github.com/srisatyalokesh/paatalashala/blob/main/src/app/api/delete-song/route.js): `src/app/api/delete-song/route.js`
- [Update badge](https://github.com/srisatyalokesh/paatalashala/blob/main/src/components/AppUpdateBadge.js): `src/components/AppUpdateBadge.js`
- [Cache management](https://github.com/srisatyalokesh/paatalashala/blob/main/src/utils/cacheManager.js): `src/utils/cacheManager.js`
- [Offline service worker](https://github.com/srisatyalokesh/paatalashala/blob/main/public/sw.js): `public/sw.js`

### Other components

- **Listener**
- **YouTube**
- **Supabase Realtime**

## Connections

- Listener → Space chooser: chooses space
- Space chooser → Themed space pages: opens space (evidence: `src/app/page.js`)
- Themed space pages → Song catalogs: loads songs (evidence: `src/app/spaces/ammama/page.js`)
- Themed space pages → Player state: uses playback state (evidence: `src/app/spaces/ammama/page.js`)
- Themed space pages → Keyboard controls: registers controls (evidence: `src/app/spaces/ammama/page.js`)
- Themed space pages → Player capsule: renders controls (evidence: `src/app/spaces/ammama/page.js`)
- Themed space pages → Space HUD: renders HUD (evidence: `src/app/spaces/ammama/page.js`)
- Themed space pages → Floating player: renders player (evidence: `src/app/spaces/ammama/page.js`)
- Floating player → YouTube playback: wraps player (evidence: `src/components/space/FloatingYouTubePlayer.js`)
- YouTube playback → YouTube: loads video
- Themed space pages → Lyrics and quotes: renders lyrics (evidence: `src/app/spaces/ammama/page.js`)
- Themed space pages → Weather particles: renders particles (evidence: `src/app/spaces/ammama/page.js`)
- Themed space pages → Ocean environment: renders ocean (evidence: `src/app/spaces/samudra-theeram/page.js`)
- Themed space pages → Campfire environment: renders campfire (evidence: `src/app/spaces/campfire-jamming/page.js`)
- Themed space pages → Cross-space mix: loads mixed catalog (evidence: `src/app/spaces/sammelanam/page.js`)
- Cross-space mix → Song catalogs: merges catalogs (evidence: `src/data/sammelanam.js`)
- Themed space pages → Ambient crossfade: uses ambient transitions (evidence: `src/app/spaces/sammelanam/page.js`)
- Themed space pages → Listener counts: renders counts (evidence: `src/app/spaces/ammama/page.js`)
- Player state → Supabase presence: uses client (evidence: `src/hooks/useSpacePlayer.js`)
- Supabase presence → Supabase Realtime: syncs presence
- Player state → Playlist recovery API: requests track removal
- Space chooser → Update badge: shows update badge (evidence: `src/app/page.js`)
- Update badge → Cache management: purges caches (evidence: `src/components/AppUpdateBadge.js`)
- Listener → Offline service worker: installs app
