Architecture Overview
Client (React) → Django REST API → PostgreSQL
↓
Celery + Redis → FFmpeg HLS Pipeline → AWS S3
↓
CloudFront CDN → Client Player
Key Technical Decisions
HLS Adaptive Streaming
- Audio files are transcoded into multiple quality tiers (128k, 256k, 320k) via FFmpeg
- Celery workers handle async transcoding jobs with retry logic
- M3U8 manifests are generated for each track for adaptive bitrate switching
Real-Time Features
- WebSocket-based now-playing updates
- Live listener count per track
- Artist notification system for new followers/plays
Payment Integration
- Razorpay subscription billing for premium features
- Webhook-based payment verification
- Wallet system for artist payouts
Tech Stack Details
| Layer | Technology |
|---|---|
| Frontend | React.js, Redux Toolkit, Tailwind CSS |
| Backend | Django 5.x, Django REST Framework |
| Task Queue | Celery + Redis |
| Storage | AWS S3 + CloudFront |
| Database | PostgreSQL with optimized indexes |
| Payments | Razorpay API |
Key Highlights
- 10+ database models covering users, artists, albums, tracks, playlists, subscriptions
- Background task pipeline with Celery for audio processing and email notifications
- JWT Authentication with refresh token rotation
- Rate limiting on API endpoints to prevent abuse