This is a real-time Spotify clone application with the following features:
- 🎸 Listen to music, play next and previous songs
- 🔈 Update the volume with a slider
- 🎧 Admin dashboard to create albums and songs
- 💬 Real-time Chat App integrated into Spotify
- 👨🏼💼 Online/Offline status
- 👀 See what other users are listening to in real-time
- 📊 Aggregate data for the analytics page
package.json- Root package file with scripts to build and start the application.env- Environment variables for the application
The backend is built with Node.js, Express, and MongoDB.
src/index.js- Main entry point for the backend serversrc/lib/- Contains utility functions for database, socket.io, and cloudinarysrc/controller/- Contains controller functions for handling API requestssrc/models/- MongoDB schema definitionssrc/routes/- API route definitionssrc/middleware/- Custom middleware functionssrc/seeds/- Seed data for the application
The frontend is built with React, TypeScript, and Vite.
src/main.tsx- Main entry point for the React applicationsrc/App.tsx- Main component with route definitionssrc/components/- Reusable UI componentssrc/pages/- Page components for different routessrc/layout/- Layout components for the applicationsrc/stores/- State management using Zustandsrc/lib/- Utility functionssrc/providers/- Context providers
PORT=5000
MONGODB_URI=your_mongodb_connection_string
ADMIN_EMAIL=your_admin_email
NODE_ENV=development
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
CLERK_SECRET_KEY=your_clerk_secret_key
VITE_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
-
Install dependencies:
npm install -
Start the application:
npm start -
For development:
- Backend:
cd backend && npm run dev - Frontend:
cd frontend && npm run dev
- Backend:
This section provides detailed documentation for key files in the project.
The main entry point for the backend server. It sets up Express, middleware, routes, and starts the server.
Handles the MongoDB connection.
Sets up Socket.IO for real-time communication.
Configures Cloudinary for image and audio file uploads.
The entry point for the React application, sets up the Clerk authentication provider.
Defines the routes for the application using React Router.
Manages the state for music playback using Zustand.
Manages the state for the chat functionality.
Contributions are welcome! Please feel free to submit a Pull Request.
