A full-stack music streaming web application built with React.js, Node.js, Tailwind,Firebase and MongoDB
- Features
- Tech Stack
- Architecture
- Installation
- Configuration
- Usage
- API Documentation
- Project Structure
- Contributing
- License
- Trending Music: Browse and stream trending songs from Spotify
- Audio Streaming: High-quality 30-second preview playback
- Recently Played: Track and display user's listening history
- Custom Playlists: Create and manage personal playlists
- Liked Songs: Save favorite tracks for quick access
- Firebase Authentication: Secure login with email/password and Google OAuth
- User Profiles: Personalized user accounts with profile pictures
- Account Types: Basic and Premium account tiers
- Persistent Sessions: Automatic login state management
- Modern Design: Sleek dark theme with gradient backgrounds
- Responsive Layout: Mobile-first design with Tailwind CSS
- Interactive Components: Smooth animations and transitions
- Music Player: Full-featured playbar with controls
- Navigation: Intuitive sidebar and navbar navigation
- Real-time Updates: Live music data from Spotify API
- Swiper Integration: Touch-friendly carousels for music browsing
- State Management: Efficient React state handling
- RESTful API: Clean backend architecture
- Database Integration: MongoDB for user data persistence
- React 19.1.0 - Modern UI library with hooks
- React Router 7.6.2 - Client-side routing
- Tailwind CSS 4.1.10 - Utility-first CSS framework
- Axios 1.10.0 - HTTP client for API requests
- Swiper 11.2.8 - Touch-enabled sliders
- React Icons 5.5.0 - Icon library
- Vite 6.3.5 - Fast build tool and dev server
- Node.js - JavaScript runtime
- Express 5.1.0 - Web framework
- MongoDB - NoSQL database
- Mongoose 8.16.0 - MongoDB object modeling
- JWT - Authentication tokens
- Bcrypt 6.0.0 - Password hashing
- CORS 2.8.5 - Cross-origin resource sharing
- Firebase Auth 11.9.1 - User authentication
- Spotify Web API - Music data and streaming
- NoCodeAPI - Spotify API wrapper
- ESLint - Code linting
- dotenv - Environment variables
- Git - Version control
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Frontend │ │ Backend │ │ External │
│ (React) │◄──►│ (Express) │◄──►│ Services │
│ │ │ │ │ │
│ • User Auth │ │ • REST API │ │ • Spotify API │
│ • Music Player │ │ • User Mgmt │ │ • Firebase Auth │
│ • UI Components │ │ • Music Data │ │ • MongoDB Atlas │
└─────────────────┘ └─────────────────┘ └─────────────────┘
- Node.js (v16 or higher)
- npm
- MongoDB database
- Firebase project
- Spotify API access (via NoCodeAPI)
git clone https://github.com/puneetkr-06/musync.git
cd musynccd Backend
npm installcd Frontend
npm installCreate a .env file in the Backend directory:
# Database
DB_CONNECT=mongodb+srv://username:password@cluster.mongodb.net/musync
# Server
PORT=4000
# Spotify API (via NoCodeAPI)
SPOTIFY_API_KEY=your_nocode_api_keyUpdate src/firebase/firebase.js with your Firebase config:
const firebaseConfig = {
apiKey: "your-api-key",
authDomain: "your-project.firebaseapp.com",
projectId: "your-project-id",
storageBucket: "your-project.appspot.com",
messagingSenderId: "your-sender-id",
appId: "your-app-id"
};- Start Backend Server
cd Backend
npm start
# Server runs on http://localhost:4000- Start Frontend Development Server
cd Frontend
npm run dev
# Application runs on http://localhost:5173- Authentication: Sign up or login with email/password or Google
- Explore Music: Browse trending songs on the home page
- Play Music: Click "Listen Now" to stream 30-second previews
- Track History: Recently played songs are automatically saved
- Manage Account: View profile and account settings
http://localhost:4000
POST /user/register
Content-Type: application/json
{
"firebaseUid": "string",
"name": "string",
"email": "string",
"photoURL": "string"
}POST /user/login
Content-Type: application/json
{
"firebaseUid": "string"
}GET /musync/trendingResponse:
{
"trending": [
{
"id": "string",
"name": "string",
"image": "string",
"artists": "string",
"preview_url": "string"
}
]
}POST /user/recent
Content-Type: application/json
{
"userId": "string",
"song": {
"name": "string",
"artists": "string",
"image": "string",
"preview_url": "string"
}
}GET /user/recent/:userIdMusync/
├── Backend/ # Node.js backend application
│ ├── controllers/ # Business logic controllers
│ │ ├── user_controller.js
│ │ ├── trending_controller.js
│ │ ├── recentlyPlayed_controller.js
│ │ └── categories_controller.js
│ ├── models/ # Database models
│ │ └── user.js
│ ├── routes/ # API route definitions
│ │ ├── user_route.js
│ │ └── spotify_auth_route.js
│ ├── middlewares/ # Custom middleware
│ │ └── user_auth.js
│ ├── db/ # Database configuration
│ │ └── db.js
│ ├── app.js # Express app configuration
│ ├── server.js # Server entry point
│ └── package.json
│
├── Frontend/ # React frontend application
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ │ ├── Banner/
│ │ │ ├── Navbar/
│ │ │ ├── Sidebar/
│ │ │ ├── Playbar/
│ │ │ ├── RecentlyPlayed/
│ │ │ ├── TopCharts/
│ │ │ ├── BiggestHits/
│ │ │ ├── TopStreamedArtists/
│ │ │ └── SongSlider/
│ │ ├── pages/ # Page components
│ │ │ ├── Home/
│ │ │ ├── Login/
│ │ │ └── Signup/
│ │ ├── utils/ # Utility functions
│ │ │ ├── audioPlayer.js
│ │ │ └── updateRecentlyPlayed.js
│ │ ├── firebase/ # Firebase configuration
│ │ │ └── firebase.js
│ │ ├── assets/ # Static assets
│ │ ├── App.jsx # Main app component
│ │ └── main.jsx # App entry point
│ ├── public/ # Public assets
│ ├── package.json
│ ├── vite.config.js
│ ├── tailwind.config.js
│ └── eslint.config.js
│
├── README.md # Project documentation
└── .gitignore # Git ignore rules
- Full Song Streaming: Complete track playback (requires premium Spotify API)
- Social Features: Friend system and shared playlists
- Advanced Search: Search by artist, album, genre
- Offline Mode: Download and cache songs for offline listening
- Music Recommendations: AI-powered song suggestions
- Lyrics Integration: Real-time lyrics display
- Mobile App: React Native mobile application
- Performance: Implement lazy loading and code splitting
- Testing: Add comprehensive unit and integration tests
- Caching: Implement Redis for improved performance
- Deployment: Docker containerization and CI/CD pipelines
- Analytics: User behavior tracking and insights
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow existing code style and conventions
- Write meaningful commit messages
- Update documentation for new features
- Test your changes thoroughly
This project is licensed under the ISC License. See the LICENSE file for details.
- Developer: Puneet Kumar
- Contact: puneetkr.06@gmai.com
- GitHub: [https://github.com/puneetkr-06]
- Spotify Web API for music data
- NoCodeAPI for simplified API access
- Firebase for authentication services
- Tailwind CSS for styling framework
- React team for the amazing library
Happy Streaming! 🎵
Built with ❤️ and lots of ☕