A modern, full-featured music streaming web application with premium subscriptions
Features • Tech Stack • Getting Started • Screenshots • License
🎶 PlayLoud brings your music to life! A feature-rich, full-stack streaming platform designed for music lovers who want a seamless, ad-free listening experience.
PlayLoud is built with modern web technologies and powered by Appwrite for backend services, offering everything from user authentication to cloud storage. Whether you're creating playlists, discovering new artists, or going premium for exclusive perks, PlayLoud has got you covered! 🚀
- ✅ 100% Beginner-Friendly - Easy setup with step-by-step guides
- ✅ Modern Tech Stack - Built with latest React, Vite, and Tailwind CSS
- ✅ Secure Payments - Integrated with Razorpay for safe transactions
- ✅ Cloud-Powered - Appwrite handles auth, database, and storage
- ✅ Responsive Design - Works perfectly on all devices 📱💻
- ✅ Open Source - Learn, contribute, and grow! 🌱
|
|
|
|
| Category | Technology | Version | Purpose |
|---|---|---|---|
| Framework | React | 19.1.1 | UI Library for building components |
| Build Tool | Vite | 7.1.2 | Fast development & build tool |
| Styling | Tailwind CSS | 4.1.13 | Utility-first CSS framework |
| Routing | React Router | 7.9.1 | Client-side routing |
| Icons | Heroicons | 2.2.0 | Beautiful hand-crafted SVG icons |
| Backend | Express | 5.1.0 | Web framework for Node.js |
| Payments | Razorpay SDK | 2.9.6 | Payment gateway integration |
| BaaS | Appwrite | 20.1.0 | Backend services platform |
| Server SDK | node-appwrite | 20.0.0 | Appwrite server-side SDK |
| CORS | cors | 2.8.5 | Cross-origin resource sharing |
| Env | dotenv | 17.2.3 | Environment variable management |
💡 New to coding? Don't worry! We'll guide you through every step. Just follow along! 🌟
Before starting, make sure you have these installed on your computer:
| Tool | Version | Purpose | Download Link |
|---|---|---|---|
| 🟢 Node.js | v18+ | JavaScript runtime | Download |
| 📦 npm | Latest | Package manager | Comes with Node.js |
| ☁️ Appwrite Account | Free | Backend services | Sign Up |
| 💳 Razorpay Account | Free | Payment gateway | Sign Up |
| 💻 Code Editor | Any | VS Code recommended | Download |
| 🌐 Web Browser | Modern | Chrome/Firefox/Safari | Any modern browser |
# Open your terminal and run:
git clone https://github.com/ChiragVasava/PlayLoud.git
cd playloud💡 Tip: Not sure how to open terminal?
- Windows: Press
Win + R, typecmd, press Enter- Mac: Press
Cmd + Space, typeterminal, press Enter- Linux: Press
Ctrl + Alt + T
# Make sure you're in the playloud folder
# Install all frontend dependencies (this might take a few minutes ☕)
npm installCreate your environment file:
# For Windows users:
copy .env.example .env
# For Mac/Linux users:
cp .env.example .envEdit .env file (use any text editor):
# 🔧 Copy these values from your Appwrite Console
VITE_APPWRITE_ENDPOINT=https://cloud.appwrite.io/v1
VITE_APPWRITE_PROJECT_ID=your_project_id_here
VITE_APPWRITE_DATABASE_ID=your_database_id_here
VITE_APPWRITE_BUCKET_ID=your_bucket_id_here
VITE_APPWRITE_STORAGE_ID=your_storage_id_here🤔 Where do I find these values? Don't worry! We'll show you in Step 4: Appwrite Setup below.
# Go to backend folder
cd playloud-backend
# Install backend dependencies
npm install
# Create environment file
# For Windows:
copy .env.example .env
# For Mac/Linux:
cp .env.example .envEdit playloud-backend/.env file:
# 💳 Razorpay Configuration (Get from Razorpay Dashboard)
RAZORPAY_KEY_ID=rzp_test_XXXXXXXXXXXX
RAZORPAY_KEY_SECRET=XXXXXXXXXXXXXXXX
# ☁️ Appwrite Configuration (Same as frontend + API Key)
APPWRITE_ENDPOINT=https://cloud.appwrite.io/v1
APPWRITE_PROJECT_ID=your_project_id_here
APPWRITE_API_KEY=your_server_api_key_here
APPWRITE_DATABASE_ID=your_database_id_here
# 📊 Collection IDs (We'll get these from Appwrite)
SUBSCRIPTIONS_COLLECTION_ID=your_subscriptions_collection_id
PAYMENTS_COLLECTION_ID=your_payments_collection_id
# 🔧 Optional Settings
WEBHOOK_SECRET=your_webhook_secret_here
CORS_ORIGIN=http://localhost:5173
PORT=5000📌 Important: Never share your
.envfiles or commit them to GitHub!
Appwrite provides backend services so you don't need to build your own server! Here's how to set it up:
🔷 4.1 Create Appwrite Project (Click to expand)
- Go to Appwrite Console
- Click "Create Project"
- Name it:
PlayLoud - Click Create
- 📋 Copy your Project ID (you'll see it at the top)
- Paste it in both
.envfiles forPROJECT_ID
🔷 4.2 Configure Authentication (Click to expand)
- In your project, click "Auth" in sidebar
- Click "Settings" tab
- Enable Email/Password:
- Toggle "Email/Password" to ON ✅
- Enable Google OAuth:
- Toggle "Google" to ON ✅
- Follow the instructions to set up Google OAuth
- Add callback URL:
https://cloud.appwrite.io/v1/account/sessions/oauth2/callback/google/YOUR_PROJECT_ID
🔷 4.3 Create Database (Click to expand)
- Click "Databases" in sidebar
- Click "Create Database"
- Name:
PlayLoud_DB - Click Create
- 📋 Copy the Database ID
- Paste it in both
.envfiles
🔷 4.4 Create Collections (Click to expand)
Now we'll create tables (called Collections) to store our data. Create these 7 collections:
Collection 1: 🎵 songs
Click "Create Collection" → Name: songs → Create
Then add these attributes (Click "Add Attribute"):
- title → String → Size: 255 → Required ✅
- artist → String → Size: 255 → Required ✅
- album → String → Size: 255
- genre → String → Size: 100
- duration → Integer → Required ✅
- audioFileId → String → Size: 255 → Required ✅
- coverImageId → String → Size: 255
- releaseDate → DateTime
Collection 2: 📝 playlists
- userId → String → Size: 255 → Required ✅
- name → String → Size: 255 → Required ✅
- description → String → Size: 1000
- coverImageId → String → Size: 255
- isPublic → Boolean → Default: false
- createdAt → DateTime → Required ✅
Collection 3: 🔗 playlist_songs
- playlistId → String → Size: 255 → Required ✅
- songId → String → Size: 255 → Required ✅
- addedAt → DateTime → Required ✅
- order → Integer → Default: 0
Collection 4: ❤️ liked_songs
- userId → String → Size: 255 → Required ✅
- songId → String → Size: 255 → Required ✅
- likedAt → DateTime → Required ✅
Collection 5: 🕒 recently_played
- userId → String → Size: 255 → Required ✅
- songId → String → Size: 255 → Required ✅
- playedAt → DateTime → Required ✅
Collection 6: 💎 subscriptions
- userId → String → Size: 255 → Required ✅
- planId → String → Size: 50 → Required ✅
- planName → String → Size: 100 → Required ✅
- amount → Integer → Required ✅
- status → String → Size: 20 → Required ✅
- startDate → DateTime → Required ✅
- endDate → DateTime → Required ✅
- razorpayPaymentId → String → Size: 255
Collection 7: 💳 payments
- userId → String → Size: 255 → Required ✅
- planId → String → Size: 50 → Required ✅
- planName → String → Size: 100 → Required ✅
- amount → Integer → Required ✅
- currency → String → Size: 10 → Required ✅
- status → String → Size: 20 → Required ✅
- razorpayPaymentId → String → Size: 255
- razorpayOrderId → String → Size: 255
- paidAt → DateTime → Required ✅
💡 Pro Tip: For
subscriptionsandpaymentscollections:
- After creating, click on the collection
- Look at the URL:
.../collection-XXXXX- Copy that
XXXXX- that's your Collection ID!- Paste in backend
.envfile
🔷 4.5 Create Storage Bucket (Click to expand)
- Click "Storage" in sidebar
- Click "Create Bucket"
- Name:
media - File Size Limit: 50MB
- Allowed File Extensions: mp3, mp4, jpg, jpeg, png, webp
- Permissions:
- Read:
role:all(anyone can view) - Create:
role:users(logged-in users can upload)
- Read:
- Click Create
- 📋 Copy the Bucket ID
- Paste it in frontend
.envasBUCKET_IDandSTORAGE_ID
🔷 4.6 Generate API Key (Click to expand)
This is for your backend server to securely access Appwrite:
- Click "Settings" (bottom of sidebar)
- Click "API Keys" tab
- Click "Create API Key"
- Name:
Backend Server - Expiration: Never (or set a date)
- Scopes: Select ALL of these ✅
databases.readdatabases.writecollections.readcollections.writedocuments.readdocuments.writefiles.readfiles.write
- Click Create
- 📋 COPY THE KEY IMMEDIATELY (you won't see it again!)
- Paste in backend
.envasAPPWRITE_API_KEY
Razorpay handles all payment processing securely!
🔶 5.1 Create Razorpay Account (Click to expand)
- Go to Razorpay
- Sign up with your email
- Complete verification
- Switch to Test Mode (toggle at top)
🔶 5.2 Get API Keys (Click to expand)
- Go to Settings → API Keys
- Click "Generate Test Key"
- You'll see:
- Key ID (starts with
rzp_test_) - Key Secret (click eye icon to reveal)
- Key ID (starts with
- 📋 Copy both
- Paste in backend
.env:RAZORPAY_KEY_IDRAZORPAY_KEY_SECRET
🔶 5.3 Test Cards (Click to expand)
Use these cards for testing payments:
✅ Successful Payment:
- Card:
4111 1111 1111 1111 - CVV:
123 - Expiry: Any future date
- Name: Your name
❌ Failed Payment:
- Card:
4000 0000 0000 0002
UPI:
- UPI ID:
success@razorpay
Now let's start both servers!
# Make sure you're in playloud-backend folder
cd playloud-backend
# Start the backend server
npm run dev
# ✅ You should see:
# 🚀 Server running on http://localhost:5000
# ✅ Razorpay Key ID: Configured
# ✅ Appwrite API Key: ConfiguredOpen a NEW terminal window and run:
# Go back to project root (if you're in backend folder)
cd ..
# Start the frontend
npm run dev
# ✅ You should see:
# VITE v7.1.2 ready in XXX ms
# ➜ Local: http://localhost:5173/- Open your browser
- Go to: http://localhost:5173
- You should see PlayLoud homepage! 🎵
🎊 Congratulations! You've successfully set up PlayLoud!
When you're ready to deploy:
# Build frontend for production
npm run build
# This creates a 'dist' folder with optimized files
# Preview production build locally
npm run preview
# For backend in production
cd playloud-backend
npm start
|
|
|
|
# 1. Test Backend Health
curl http://localhost:5000/
# Should return: {"status": "Server is running ✅"}
# 2. Test Frontend
# Open http://localhost:5173 in browser
# You should see PlayLoud homepage
# 3. Test Authentication
# Try signing up with a test email
# Try Google login
# 4. Test Music Player
# Play a song (if you have songs in database)
# Check if audio plays correctly
# 5. Test Payment (Use Test Cards!)
# Go to Premium page
# Click "Subscribe Now"
# Use card: 4111 1111 1111 1111
# CVV: 123, Expiry: 12/25
# Check backend logs for payment verification| Scenario | Card Number | CVV | Result |
|---|---|---|---|
| Success | 4111 1111 1111 1111 | 123 | Payment successful |
| Failure | 4000 0000 0000 0002 | 123 | Payment fails |
| 3D Secure | 4000 0000 0000 3220 | 123 | Requires OTP |
Test UPI: success@razorpay
*Main landing page with featured songs and persistent music player*
*Discover new music, artists, and genres with smart search*
*Your personal collection: playlists, liked songs, and recently played*
*Easy playlist creation with custom cover images*
*Quick access to all your favorite tracks*
*Simple registration with email or Google OAuth*
*Manage your account, avatar, and preferences*
*Choose your subscription plan with detailed features comparison*
*Secure Razorpay checkout with multiple payment options*
*Confirmation page after successful subscription*
- Never commit
.envfiles to version control - Add
.envto.gitignore - Use different API keys for development and production
- Rotate API keys periodically
- Keep Razorpay Key Secret server-side only
- Validate all payment signatures on backend
- Use Appwrite API keys with minimal required permissions
- Implement rate limiting for API endpoints
- Enable CORS with specific origin whitelist
- Never expose sensitive keys in frontend code
- Validate user inputs
- Implement proper authentication checks
- Use secure session management
Successful Payment:
- Card Number:
4111 1111 1111 1111 - CVV:
123 - Expiry: Any future date
- Name: Any name
Failed Payment:
- Card Number:
4000 0000 0000 0002
UPI:
- UPI ID:
success@razorpay
PlayLoud/
├── playloud-backend/ # Backend server
│ ├── .env # Backend environment variables
│ ├── server.js # Express server entry point
│ └── package.json # Backend dependencies
│
├── src/ # Frontend source code
│ ├── components/ # React components
│ │ ├── auth/ # Authentication components
│ │ ├── pages/ # Page components
│ │ ├── profile/ # User profile
│ │ └── ui/ # Reusable UI components
│ ├── context/ # React Context (state management)
│ ├── lib/ # Configuration files
│ │ └── appwrite.js # Appwrite client setup
│ ├── utils/ # Helper functions
│ ├── App.jsx # Main App component
│ └── main.jsx # Entry point
│
├── public/ # Public assets
├── .env # Frontend environment variables
├── package.json # Frontend dependencies
└── README.md # This file
Solution: Razorpay SDK is loaded dynamically in Premium.jsx. Ensure your internet connection is stable.
Solution:
- Verify Razorpay Key Secret in backend
.env - Ensure backend server is running
- Check signature verification logic
Solution:
- Verify
CORS_ORIGINin backend.envmatches your frontend URL - Ensure backend is running before starting frontend
Solution:
- Verify all Appwrite IDs in
.envfiles are correct - Check Appwrite project settings
- Ensure API key has required permissions
Solution:
- Get actual Collection IDs from Appwrite Console
- Collection ID is in the URL when viewing a collection
- Update backend
.envwith correct IDs
| Method | Endpoint | Description |
|---|---|---|
| GET | / |
Health check |
| POST | /create-order |
Create Razorpay order |
| POST | /verify-payment |
Verify payment signature |
| POST | /webhook |
Handle Razorpay webhooks |
-
Build the project:
npm run build
-
Deploy
distfolder to:- Vercel:
vercel --prod - Netlify: Drag & drop
distfolder
- Vercel:
-
Add environment variables in hosting platform
- Push backend to separate repository
- Configure environment variables on platform
- Deploy and note the production URL
- Update frontend to use production backend URL
- Switch Razorpay to Live Mode
- Update all API keys to production values
- Enable HTTPS
- Configure production CORS origins
- Set up monitoring and logging
- Test all payment flows
- Configure webhooks with production URL
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the terms specified in LICENSE.txt.
- Appwrite - For providing excellent BaaS platform
- Razorpay - For secure payment processing
- React - For the amazing frontend framework
- Tailwind CSS - For rapid UI development
- Vite - For blazing fast development experience
For questions or support, please open an issue on GitHub or contact:
- Project Repository: PlayLoud
- Email: v.chira.007@gmail.com
Made with ❤️ by Chirag Vasava
⭐ Star this repo if you find it helpful!