A full-stack Spotify-inspired music streaming application with real-time chat functionality, built with React, Node.js, and MongoDB. Users can stream music, create playlists, chat with friends, and admins can manage songs and albums.
- π΅ Music Streaming: Browse and play songs from various albums
- π¬ Real-time Chat: Chat with other users while listening to music
- π€ User Authentication: Secure authentication powered by Clerk
- π¨ Beautiful UI: Modern, responsive interface built with React and Tailwind CSS
- π Admin Dashboard: Manage songs, albums, and platform statistics
- π Statistics: Track user engagement and platform metrics
- π§ Music Player: Full-featured audio player with playlist support
- πΌοΈ Media Management: Upload and manage album artwork with Cloudinary
- β‘ Real-time Updates: Socket.io for live chat and notifications
- React 19 - UI framework
- TypeScript - Type safety
- Vite - Build tool and dev server
- Tailwind CSS - Styling
- Zustand - State management
- React Router - Navigation
- Axios - HTTP client
- Socket.io Client - Real-time communication
- Clerk React - Authentication
- Radix UI - UI components
- Lucide React - Icons
- Node.js - Runtime environment
- Express - Web framework
- MongoDB - Database
- Mongoose - ODM
- Socket.io - Real-time communication
- Clerk Express - Authentication middleware
- Cloudinary - Media storage
- Node-cron - Scheduled tasks
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher)
- npm or yarn
- MongoDB (local installation or MongoDB Atlas account)
You'll also need accounts for:
- Clerk - For authentication
- Cloudinary - For media storage
- MongoDB Atlas - For database (if not using local MongoDB)
-
Clone the repository
git clone https://github.com/Abhilash-0322/dcXspotify.git cd dcXspotify -
Install dependencies
# Install root dependencies npm install # Install backend dependencies cd backend npm install # Install frontend dependencies cd ../frontend npm install cd ..
-
Navigate to the
backenddirectory and create a.envfile:cd backend -
Add the following environment variables to
.env:PORT=5000 NODE_ENV=development MONGODB_URI=your_mongodb_connection_string CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key CLERK_SECRET_KEY=your_clerk_secret_key CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name CLOUDINARY_API_KEY=your_cloudinary_api_key CLOUDINARY_API_SECRET=your_cloudinary_api_secret
-
Navigate to the
frontenddirectory and create a.env.localfile:cd frontend -
Add the following environment variables to
.env.local:VITE_API_URL=http://localhost:5000/api VITE_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
Note: Ensure the port in
VITE_API_URLmatches thePORTconfigured in your backend.envfile.
-
Start the backend server
cd backend npm run devThe backend will run on
http://localhost:5000 -
Start the frontend development server (in a new terminal)
cd frontend npm run devThe frontend will run on
http://localhost:5173 -
Access the application
- Open your browser and navigate to
http://localhost:5173
- Open your browser and navigate to
-
Build the application
# From root directory npm run build -
Start the production server
npm start
To populate your database with sample songs and albums:
cd backend
# Seed songs
npm run seed:songs
# Seed albums
npm run seed:albumsThis project is configured for deployment on Render. See the deployment documentation files for detailed instructions:
RENDER_SETUP_COMPLETE.md- Complete deployment guideACTION_REQUIRED.md- Quick deployment checklistRENDER_DEPLOYMENT_FIX.md- Troubleshooting common deployment issuesAD_BLOCKER_FIX.md- Fixing ad blocker issues with localhost
-
Backend (Web Service)
- Build Command:
npm install - Start Command:
npm start - Root Directory:
backend - Add all environment variables from backend
.env
- Build Command:
-
Frontend (Static Site)
- Build Command:
npm install && npm run build - Publish Directory:
dist - Root Directory:
frontend - Environment Variables:
VITE_API_URL: Your backend URL +/apiVITE_CLERK_PUBLISHABLE_KEY: Your Clerk publishable key
- Build Command:
dcXspotify/
βββ backend/ # Backend Node.js application
β βββ src/
β β βββ controllers/ # Route controllers
β β βββ lib/ # Utility libraries (DB, Socket.io, Cloudinary)
β β βββ middleware/ # Express middleware
β β βββ models/ # Mongoose models
β β βββ routes/ # API routes
β β βββ seeds/ # Database seeders
β β βββ index.js # Entry point
β βββ package.json
β
βββ frontend/ # Frontend React application
β βββ src/
β β βββ assets/ # Static assets
β β βββ components/ # React components
β β βββ layout/ # Layout components
β β βββ lib/ # Utility functions
β β βββ pages/ # Page components
β β βββ providers/ # Context providers
β β βββ stores/ # Zustand stores
β β βββ types/ # TypeScript types
β β βββ App.tsx # Main App component
β β βββ main.tsx # Entry point
β βββ public/ # Public assets
β βββ package.json
β
βββ package.json # Root package.json with build scripts
npm run build- Build both frontend and backendnpm start- Start the production server
npm start- Start production servernpm run dev- Start development server with auto-reloadnpm run seed:songs- Seed database with sample songsnpm run seed:albums- Seed database with sample albums
npm run dev- Start development servernpm run build- Build for productionnpm run lint- Run ESLintnpm run preview- Preview production build
Uses Clerk for secure user authentication with support for multiple sign-in methods.
- Browse albums and songs
- Play/pause/skip tracks
- Volume control
- Playlist management
- WebSocket-based chat using Socket.io
- See who's online
- Send and receive messages instantly
- Upload new songs and albums
- Manage existing content
- View platform statistics
- User management
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your 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 ISC License.
- Design inspired by Spotify
- Built with modern web technologies
- Thanks to all contributors and the open-source community
If you encounter any issues or have questions, please open an issue in the GitHub repository.
Happy Streaming! π΅