Skip to content

Divyanshi-10/MusicMeniaApp

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

85 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎡 MusicMenia

A full-stack music streaming web application where artists can upload music and users can discover, stream, and enjoy tracks from their favorite artists.


πŸš€ Live Demo


✨ Features

πŸ‘€ Users

  • Register & Login with OTP email verification
  • Stream music from followed artists
  • Browse local feed for new music
  • Receive email notifications on new music drops

🎀 Artists

  • Artist account registration & verification
  • Upload music (MP3) with thumbnail
  • Audio compression on upload (large files auto-compressed)
  • Manage uploaded tracks

πŸ” Authentication & Security

  • JWT-based authentication
  • OTP email verification
  • Rate limiting with express-rate-limit
  • Role-based access (User / Artist)

πŸ“§ Email Notifications

  • Welcome email on registration
  • OTP email for verification & password reset
  • Login & logout notification emails
  • New music drop notification to followers
  • Password reset confirmation

πŸ› οΈ Tech Stack

Frontend

Technology Purpose
React.js UI Framework
Vite Build Tool
Axios HTTP Client
React Router Navigation
Tailwind CSS Styling

Backend

Technology Purpose
Node.js Runtime
Express.js Web Framework
MongoDB Database
Mongoose ODM
JWT Authentication
Multer File Upload Handling
Imagekit Audio & Image Storage
Brevo API Transactional Emails
FFmpeg Audio Compression
Helmet to secure web applications by setting various HTTP security headers
express-rate-limit Rate Limiting

πŸ“ Project Structure

MusicMeniaApp/
β”œβ”€β”€ client/                  # React Frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/      # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ pages/           # Page components
β”‚   β”‚   β”œβ”€β”€ context/         # React context (auth, player)
β”‚   β”‚   └── utils/           # Helper functions
β”‚   └── package.json
β”‚
β”œβ”€β”€ server/                  # Node.js Backend
β”‚   β”œβ”€β”€ controllers/         # Route controllers
β”‚   β”œβ”€β”€ middleware/           # Auth & other middleware
β”‚   β”œβ”€β”€ models/              # Mongoose models
β”‚   β”œβ”€β”€ routes/              # Express routes
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”œβ”€β”€ sendEmail.js     # Brevo email utility
β”‚   β”‚   └── compressAudio.js # FFmpeg audio compression
β”‚   └── package.json

βš™οΈ Environment Variables

Backend (server/.env)

# Server
PORT=5000
NODE_ENV=production

# Database
MONGO_URI=your_mongodb_connection_string

# JWT
JWT_SECRET=your_jwt_secret

# Imagekit
IMAGEKIT_PRIVATE_KEY=your_api_secret

# Brevo Email API
BREVO_API_KEY=your_brevo_api_key
BREVO_SENDER_EMAIL=your_brevo_registered_email

# Client
CLIENT_URL=https://your-frontend-url.vercel.app

Frontend (client/.env)

VITE_API_URL=https://musicmenia.onrender.com

πŸƒ Getting Started

Prerequisites

  • Node.js v18+
  • MongoDB Atlas account
  • Cloudinary account
  • Brevo account (free tier β€” 300 emails/day)

Installation

1. Clone the repository

git clone https://github.com/nikhil-tiwari1419/MusicMeniaApp.git
cd MusicMeniaApp

2. Install Backend Dependencies

cd server
npm install

3. Install Frontend Dependencies

cd client
npm install

4. Setup Environment Variables

Create .env files in both server/ and client/ folders using the variables above.

5. Run the App

Backend:

cd server
npm run dev

Frontend:

cd client
npm run dev

πŸ“§ Email Setup (Brevo)

This project uses Brevo HTTP API for transactional emails (works on Render free tier).

  1. Sign up at brevo.com (free β€” 300 emails/day)
  2. Go to SMTP & API β†’ API Keys β†’ Generate key
  3. Add BREVO_API_KEY to your environment variables
  4. Add BREVO_SENDER_EMAIL (your Brevo registered email)

⚠️ Do NOT use SMTP on Render free tier β€” ports 587/465 are blocked. Use Brevo HTTP API instead.


🎡 Audio Upload & Compression

  • Users can upload MP3 files up to 50MB
  • Server automatically compresses audio using FFmpeg before storing
  • Compressed files are stored on Cloudinary
  • File size is saved in the database in KB format
20MB MP3 uploaded β†’ compressed to ~2-3MB β†’ stored on Cloudinary

πŸš€ Deployment

Backend β€” Render

  1. Connect GitHub repo to Render
  2. Set build command: npm install
  3. Set start command: node server.js
  4. Add all environment variables
  5. Add app.set('trust proxy', 1) for rate limiting to work correctly

Frontend β€” Vercel

  1. Connect GitHub repo to Vercel
  2. Set root directory to client/
  3. Add VITE_API_URL environment variable

πŸ‘¨β€πŸ’» Author

Nikhil Tiwari


πŸ“„ License

This project is licensed under the MIT License β€” see LICENSE for details..

About

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 99.5%
  • Other 0.5%