A cloud-based music streaming application that integrates with YouTube and Spotify APIs.
- Search and stream music from YouTube and Spotify
- User authentication and management
- Playlist management
- Audio download and streaming capabilities
- Node.js (v12 or higher)
- MongoDB Atlas account
- YouTube Data API key
- Spotify Developer account (optional, for Spotify integration)
git clone https://github.com/AstronDaniel/Music-cloud.git
cd Music-cloudnpm installCopy the .env.example file to .env and fill in your actual credentials:
cp .env.example .envEdit the .env file with your actual values:
# MongoDB connection string
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/database
# YouTube API Key - Get from Google Cloud Console
YOUTUBE_API_KEY=your_actual_youtube_api_key
# Server Port (default: 5000)
PORT=5000
# Spotify API credentials - Get from Spotify Developer Dashboard
SPOTIFY_CLIENT_ID=your_actual_spotify_client_id
SPOTIFY_CLIENT_SECRET=your_actual_spotify_client_secret- Create a free account at MongoDB Atlas
- Create a new cluster
- Get your connection string from the "Connect" button
- Add your connection string to
.envasMONGODB_URI
- 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
.envasYOUTUBE_API_KEY
- Go to Spotify Developer Dashboard
- Create a new app
- Get your Client ID and Client Secret
- Add them to
.envasSPOTIFY_CLIENT_IDandSPOTIFY_CLIENT_SECRET
npm startThe server will start on port 5000 (or the port specified in your .env file).
- Never commit the
.envfile - It contains sensitive credentials - The
.pemfiles should never be committed to the repository - API keys should be kept secret - Don't share them publicly
- Password Security Warning: The current implementation stores passwords in plain text. This is not secure for production use. Consider implementing proper password hashing with bcrypt before deploying to production.
Music-cloud/
├── api/
│ ├── controllers/ # API controllers
│ └── routes/ # API routes
├── models/ # MongoDB models
├── assets/ # Static assets
├── flask-server/ # Flask server for downloads
├── index.html # Main application page
├── login.html # Login page
├── signup.html # Signup page
├── about.html # About page
├── server.js # Main Express server
├── youtubeService.js # YouTube API integration
├── musicServer.js # Spotify API integration
└── package.json # Node.js dependencies
npm start- Start the production server
- Backend: Node.js, Express.js
- Database: MongoDB (with Mongoose)
- APIs: YouTube Data API v3, Spotify Web API
- Frontend: HTML, CSS, JavaScript, jQuery
- Authentication: Custom user authentication
- Fork the repository
- Create a feature branch
- Make your changes
- Ensure all sensitive data is in environment variables
- Submit a pull request
ISC
AstronDaniel