A Spotify-like music streaming web application built with the MERN stack, powered by YouTube Data API v3.
🌐 Live Demo: https://pranayy1.github.io/Muse
- 🎵 Music Search: Search for songs, artists, and albums using YouTube Data API
- 🔥 Trending Songs: View trending music videos in the Indian region
▶️ Audio Player: Play, pause, skip, and control music playback with YouTube embed- 🎨 Modern UI: Beautiful, responsive design inspired by Spotify
- 📱 Responsive Design: Works on desktop, tablet, and mobile devices
- 🎯 Real-time Controls: Forward/backward buttons, volume control, and progress bar
- Node.js - Runtime environment
- Express.js - Web framework
- YouTube Data API v3 - Music data source
- Axios - HTTP client
- CORS - Cross-origin resource sharing
- Helmet - Security middleware
- Express Rate Limit - API rate limiting
- React - UI library
- React Router - Client-side routing
- Styled Components - CSS-in-JS styling
- React Icons - Icon library
- Axios - HTTP client
- YouTube IFrame Player - Audio playback
The frontend is successfully deployed on GitHub Pages:
Live URL: https://pranayy1.github.io/Muse
To redeploy after making changes:
cd client
npm run build
npm run deployThe deployment uses the gh-pages npm package to automatically build and deploy the React app to the gh-pages branch.
For local development, the backend runs on port 5000:
npm startFor production, deploy the backend to a cloud service:
- Render: https://render.com
- Heroku: https://heroku.com
- Railway: https://railway.app
- Vercel: https://vercel.com
- Node.js (v16 or higher)
- npm or yarn
- YouTube Data API v3 key
- Clone the repository:
git clone <repository-url>
cd Muse- Install backend dependencies:
npm install- Create a
.envfile in the root directory:
YOUTUBE_API_KEY=your_youtube_api_key_here
NODE_ENV=development
PORT=5000- Start the backend server:
npm run server- Navigate to the client directory:
cd client- Install frontend dependencies:
npm install- Start the React development server:
npm startFrom the root directory, you can run both servers simultaneously:
npm run devGET /api/search?q={query}&maxResults={number}- Search for songsGET /api/search/{videoId}- Get video details
GET /api/trending?maxResults={number}- Get trending songs in IndiaGET /api/trending/category/{categoryId}- Get trending by category
GET /api/audio/stream/{videoId}- Get audio stream infoGET /api/audio/info/{videoId}- Get video info for player
Muse/
├── client/ # React frontend
│ ├── public/ # Static files
│ ├── src/
│ │ ├── components/ # Reusable components
│ │ ├── pages/ # Page components
│ │ ├── services/ # API services and context
│ │ └── styles/ # Global styles
│ └── package.json
├── routes/ # Express routes
│ ├── search.js # Search endpoints
│ ├── trending.js # Trending endpoints
│ └── audio.js # Audio endpoints
├── server.js # Express server
├── package.json # Backend dependencies
└── README.md
- Home Page: View trending songs and quick actions
- Search: Search for specific songs, artists, or albums
- Trending: Browse trending music videos in India
- Player: Control playback with play/pause, skip, and volume controls
- Play/pause functionality
- Forward/backward navigation
- Progress bar with click-to-seek
- Volume control with mute option
- Track information display
- Search with YouTube Data API
- Responsive search results grid
- Click to play functionality
- Fetches trending music videos from India
- Displays view counts and like counts
- Filter by categories (Bollywood, Punjabi, Tamil, etc.)
- Ranked by popularity
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the YouTube Data API v3
- Create credentials (API Key)
- Add the API key to your
.envfile
- Audio Streaming: This demo uses YouTube embed URLs. For production, you would need to implement actual audio stream extraction using tools like
youtube-dlor similar services. - Rate Limiting: YouTube Data API has rate limits. The app includes basic rate limiting middleware.
- CORS: Make sure to configure CORS properly for production deployment.
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License.
- YouTube Data API v3 for music data
- Spotify for UI/UX inspiration
- React and Express.js communities