How lakshya-saini/music-streaming-app works
Sonora’s main workflow is catalog browsing and authenticated playback, alongside two admin ingestion paths: direct WAV upload and YouTube import. The React client routes pages, maintains auth/library state, and calls a NestJS API; the backend manages catalog metadata, processes audio into renditions, and streams byte ranges from S3. The graph preserves documented adaptive playback and cover-art capabilities. Some client playback and backend streaming details are described only in the README; those links are cited there rather than presented as inspected implementation.
Main entry points: tracks.service.ts Track service · App.tsx App routes · tracks.controller.ts Track endpoints · auth.controller.ts Auth endpoints
Components 23
React client
- App routes
client/src/App.tsx - Auth state
client/src/state/AuthContext.tsx - Library state
client/src/state/LibraryContext.tsx - Browse pages
client/src/pages/BrowsePage.tsx - Upload page
client/src/pages/UploadPage.tsx - Auth API
client/src/api/auth.ts - Tracks API
client/src/api/tracks.ts - Music player
client/src/components/MusicPlayer.tsx
Identity
- Auth endpoints
server/src/modules/auth/controllers/auth.controller.ts - Auth service
server/src/modules/auth/services/auth.service.ts - User records
server/src/modules/auth/schemas/user.schema.ts - JWT guard
server/src/modules/auth/guards/jwt-auth.guard.ts
Catalog and playback
- Track endpoints
server/src/modules/tracks/controllers/tracks.controller.ts - Track service
server/src/modules/tracks/services/tracks.service.ts - Track records
server/src/modules/tracks/schemas/track.schema.ts - Audio assets
server/src/modules/tracks/schemas/audio-asset.schema.ts - MongoDB
Ingestion and media
- Audio processing
server/src/modules/tracks/services/audio-processing.service.ts - YouTube import
server/src/modules/tracks/services/youtube-import.service.ts - Audio storage
server/src/modules/tracks/services/audio-storage.service.ts - S3 storage
Other components
- Listener
- Admin
Connections 27
- Listener → App routes: browses
- Admin → App routes: uses upload
- App routes → Browse pages: routes to
client/src/App.tsx - App routes → Upload page: guards route
client/src/App.tsx - App routes → Auth state: provides
client/src/App.tsx - App routes → Library state: provides
client/src/App.tsx - Auth state → Auth API: uses
client/src/state/AuthContext.tsx - Library state → Tracks API: loads catalog
client/src/state/LibraryContext.tsx - Upload page → Tracks API: requests uploads
client/src/pages/UploadPage.tsx - Browse pages → Library state: reads library
client/src/pages/BrowsePage.tsx - Auth API → Auth endpoints: calls auth API
- Tracks API → Track endpoints: calls tracks API
- Listener → Music player: starts playback
- Music player → Track endpoints: requests stream
- Auth endpoints → Auth service: delegates
server/src/modules/auth/controllers/auth.controller.ts - Auth service → User records: reads and writes
server/src/modules/auth/services/auth.service.ts - Auth endpoints → JWT guard: protects profile
server/src/modules/auth/controllers/auth.controller.ts - Track endpoints → Track service: delegates
server/src/modules/tracks/controllers/tracks.controller.ts - Track endpoints → JWT guard: guards stream
server/src/modules/tracks/controllers/tracks.controller.ts - Track service → Track records: reads and writes
server/src/modules/tracks/services/tracks.service.ts - Track service → Audio assets: reads and writes
server/src/modules/tracks/services/tracks.service.ts - Track service → Audio processing: encodes renditions
server/src/modules/tracks/services/tracks.service.ts - Track service → YouTube import: downloads media
server/src/modules/tracks/services/tracks.service.ts - Track service → Audio storage: uploads and streams
server/src/modules/tracks/services/tracks.service.ts - Audio storage → S3 storage: reads and writes
server/src/modules/tracks/services/audio-storage.service.ts - Track service → MongoDB: persists catalog
- Track service → S3 storage: stores media