Skip to content

affilpm/Wave

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Wave

🎡 Wave - Music Streaming Platform

Wave Logo

A comprehensive full-stack music streaming platform for artists and listeners

License Version Backend Frontend

πŸ“‹ Table of Contents

πŸš€ Overview

Wave is a powerful, feature-rich music streaming platform designed for both artists and listeners. The platform consists of a robust Django backend and a modern React frontend, providing a seamless experience for music discovery, playback, and artist promotion.

Wave enables artists to upload, manage, and monetize their music while giving listeners a personalized experience for discovering, streaming, and organizing music. With premium subscription options, real-time interactions through WebSockets, and a responsive design for all devices, Wave offers a comprehensive solution for music streaming needs.

✨ Features

For Listeners

🎧 Music Discovery

Personalized recommendations and genre-based exploration

πŸ“‹ Playlist Management

Create, share, and discover playlists

πŸ“š Library Organization

Save songs, albums, and playlists

πŸŽ›οΈ Audio Controls

Equalizer with custom presets

πŸ•°οΈ Listening History

Track and revisit your listening patterns

πŸ‘₯ Social Features

Follow artists and share music

For Artists

🎀 Artist Profile

Customizable profiles with verification

πŸ’Ώ Music Management

Upload, organize, and publish music

πŸ“Š Analytics

Track play counts and listener demographics

πŸ’° Monetization

Earn from streams and premium features

πŸ”΄ Livestreaming

Host live performances for followers

πŸ” Discovery Options

Genre tagging and promotion tools

Premium Features

🎡 High-Quality Audio

Access to lossless audio streaming

πŸ“΄ Offline Playback

Download music for offline listening

🚫 Ad-Free Experience

Uninterrupted listening without ads

πŸ› οΈ Tech Stack

Backend

Django DRF PostgreSQL Redis Django Channels JWT Razorpay

Frontend

React Vite Redux Toolkit React Router Tailwind CSS Material UI Chakra UI Framer Motion Axios

πŸ—οΈ Architecture

System Architecture

graph TD
    Client[Client Browser/App] --> |HTTP/WS| LoadBalancer[Load Balancer]
    LoadBalancer --> |HTTP| WebServer[Nginx Web Server]
    LoadBalancer --> |WS| WSServer[WebSocket Server]
    WebServer --> |WSGI| DjangoApp[Django Application]
    WSServer --> |ASGI| Channels[Django Channels]
    DjangoApp --> |Queries| PostgreSQL[(PostgreSQL Database)]
    DjangoApp --> |Cache| Redis[(Redis Cache)]
    DjangoApp --> |Auth| JWT[JWT Auth]
    DjangoApp --> |Payments| Razorpay[Razorpay API]
    DjangoApp --> |Storage| S3[S3 Storage]
    Channels --> Redis
Loading

Data Model

Wave uses a comprehensive data model with the following key components:

πŸ‘€ User System

  • CustomUser: Extended user model
  • Profile: User profile details
  • EmailVerification: Verification system

🎀 Artist Management

  • Artist: Artist profiles
  • Follow: User-artist relationship
  • ArtistGenres: Genre categorization

🎡 Music Content

  • Music: Individual tracks
  • Album: Collections of tracks
  • Genre: Music categorization
  • AlbumTrack: Track ordering

🎧 User Features

  • Library: Saved music
  • Playlist & PlaylistTrack: Playlists
  • PlayCount & PlayHistory: Analytics
  • EqualizerPreset: Audio settings

πŸ’° Premium Features

  • PremiumPlan: Subscription tiers
  • UserSubscription: User subscriptions
  • RazorpayTransaction: Payment records

πŸ“₯ Installation

Backend Setup

# Clone the repository
git clone https://github.com/yourusername/wave-backend.git
cd wave-backend

# Create and activate virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Set up environment variables
# Create a .env file with required variables (see below)

# Set up database
python manage.py migrate
python manage.py createsuperuser

# Run the development server
python manage.py runserver

Required Environment Variables (.env):

DEBUG=True
SECRET_KEY=your_secret_key
DATABASE_URL=postgres://user:password@localhost:5432/wave
RAZORPAY_KEY_ID=your_razorpay_key
RAZORPAY_KEY_SECRET=your_razorpay_secret
EMAIL_HOST_USER=your_email
EMAIL_HOST_PASSWORD=your_email_password
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
REDIS_URL=redis://localhost:6379/0

Frontend Setup

# Clone the repository
git clone https://github.com/yourusername/wave-frontend.git
cd wave-frontend

# Install dependencies
npm install
# or
yarn install

# Set up environment variables
# Create a .env file with required variables (see below)

# Start development server
npm run dev
# or
yarn dev

Required Environment Variables (.env):

VITE_API_BASE_URL=http://localhost:8000/api
VITE_WS_BASE_URL=ws://localhost:8001/ws
VITE_GOOGLE_CLIENT_ID=your_google_client_id

Docker Setup (Optional)

# Start both frontend and backend
docker-compose up -d

# Access frontend at http://localhost:5173
# Access backend at http://localhost:8000

πŸ’» Development

Backend Project Structure

wave-backend/
β”œβ”€β”€ users/              # User management
β”œβ”€β”€ artists/            # Artist profiles and management
β”œβ”€β”€ music/              # Track and music management
β”œβ”€β”€ album/              # Album-specific functionality
β”œβ”€β”€ playlist/           # Playlist functionality
β”œβ”€β”€ library/            # User's saved content
β”œβ”€β”€ premium/            # Subscription management
β”œβ”€β”€ listening_history/  # Play tracking
β”œβ”€β”€ livestream/         # Live performance functionality
β”œβ”€β”€ home/               # Main landing page and discovery
β”œβ”€β”€ config/             # Main project settings
β”œβ”€β”€ static/             # Static files
└── media/              # User-uploaded content

Frontend Project Structure

src/
β”œβ”€β”€ components/              # Reusable UI components
β”‚   β”œβ”€β”€ player/             # Music player components
β”‚   β”œβ”€β”€ admin/              # Admin-specific components
β”‚   β”œβ”€β”€ artist/             # Artist-specific components
β”‚   β”œβ”€β”€ livestream/         # Livestreaming components
β”‚   └── user/               # User/listener components
β”œβ”€β”€ pages/                   # Application pages
β”‚   β”œβ”€β”€ admin/              # Admin dashboard pages
β”‚   β”œβ”€β”€ artist/             # Artist studio pages
β”‚   └── user/               # User/listener pages
β”œβ”€β”€ slices/                  # Redux slices
β”œβ”€β”€ services/                # API service modules
β”œβ”€β”€ utils/                   # Utility functions
β”œβ”€β”€ hooks/                   # Custom React hooks
β”œβ”€β”€ constants/               # Application constants
β”œβ”€β”€ App.jsx                  # Main application component
β”œβ”€β”€ api.js                   # Main API configuration
└── main.jsx                 # Application entry point

Development Tools

Backend

# Enhanced Python shell with auto-imports
python manage.py shell_plus

# Generate model diagrams
python manage.py graph_models -a -o wave_models.png

# Display all registered URLs
python manage.py show_urls

Frontend

# Lint code
npm run lint

# Format code
npm run format

# Run tests
npm run test

# Build for production
npm run build

πŸ“– API Documentation

Wave exposes a comprehensive RESTful API with these key endpoint groups:

πŸ” Authentication

  • POST /api/auth/register/: User registration
  • POST /api/auth/login/: User login
  • POST /api/auth/token/refresh/: Refresh token
  • POST /api/auth/google/: Google OAuth

πŸ‘€ User Management

  • GET /api/users/me/: Current user profile
  • PATCH /api/users/me/: Update profile
  • GET /api/users/settings/: User settings
  • PATCH /api/users/settings/: Update settings

🎡 Music and Albums

  • GET /api/music/: List tracks
  • POST /api/music/: Upload track
  • GET /api/albums/: List albums
  • POST /api/albums/: Create album
  • GET /api/genres/: List genres

πŸ“‹ Playlists and Library

  • GET /api/playlists/: List playlists
  • POST /api/playlists/: Create playlist
  • GET /api/library/: User library
  • POST /api/library/tracks/add/: Add to library
  • POST /api/library/tracks/remove/: Remove from library

🎀 Artists

  • GET /api/artists/: List artists
  • GET /api/artists/{id}/: Artist details
  • POST /api/artists/{id}/follow/: Follow artist
  • POST /api/artists/{id}/unfollow/: Unfollow artist
  • POST /api/artists/verify/: Request verification

πŸ’° Premium Features

  • GET /api/premium/plans/: List plans
  • POST /api/premium/subscribe/: Subscribe
  • GET /api/premium/subscriptions/: User subscriptions
  • POST /api/premium/payment/verify/: Verify payment

Websocket Endpoints

  • /ws/notifications/ - Real-time notifications
  • /ws/livestream/{room_id}/ - Livestream chat and events

🚒 Deployment

Production Requirements

  • Backend: Django, PostgreSQL, Redis, Nginx, Daphne/Uvicorn
  • Frontend: Node.js, NPM/Yarn
  • Infrastructure: Docker, AWS/GCP/Azure

Deployment Options

🐳 Docker Deployment

# Build and deploy with Docker Compose
docker-compose -f docker-compose.prod.yml up -d

☁️ AWS Deployment

# Deploy backend with Elastic Beanstalk
eb init
eb create wave-production

# Deploy frontend with Amplify
amplify init
amplify publish

πŸš€ Vercel (Frontend)

# Install Vercel CLI
npm i -g vercel

# Deploy
vercel

🌐 Heroku (Backend)

# Login to Heroku
heroku login

# Create app and push
heroku create wave-backend
git push heroku main

πŸ”’ Security

Wave implements several security measures:

  • JWT Authentication: Short-lived tokens (5 minutes) with rotation
  • Token Blacklisting: Prevention of token reuse
  • CORS Configuration: Strict cross-origin resource sharing
  • Content Security Policy: Protection against XSS attacks
  • Password Validation: Strong password requirements
  • HTTPS Enforcement: Secure communication
  • Rate Limiting: Protection against brute force attacks
  • Signed URLs: Secure media access

πŸ“Έ Screenshots

Home Dashboard Music Player Artist Profile Playlist Management

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Here's the properly formatted version with your phone number and social media links added:

πŸ“œ License

This project is licensed under the MIT License – see the LICENSE file for details.

πŸ“ž Contact

AFFIL P M
πŸ“§ affilpm2004@gmail.com

🌐 Social Media:

πŸ”— Project Links:


πŸš€ Built with care for an exceptional user experience! πŸ’™


Crafted with care by AFFIL P M

About

Music Streaming website

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published