Skip to content

puneetkr-06/Muysnc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

36 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽต Musync - Modern Music Streaming Platform

A full-stack music streaming web application built with React.js, Node.js, Tailwind,Firebase and MongoDB

๐Ÿ“‹ Table of Contents

โœจ Features

๐ŸŽง Core Music Features

  • 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

๐Ÿ‘ค User Management

  • 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

๐ŸŽจ User Interface

  • 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

๐Ÿ”ง Technical Features

  • 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

๐Ÿ›  Tech Stack

Frontend

  • 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

Backend

  • 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

Authentication & External Services

  • Firebase Auth 11.9.1 - User authentication
  • Spotify Web API - Music data and streaming
  • NoCodeAPI - Spotify API wrapper

Development Tools

  • ESLint - Code linting
  • dotenv - Environment variables
  • Git - Version control

๐Ÿ— Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Frontend      โ”‚    โ”‚    Backend      โ”‚    โ”‚   External      โ”‚
โ”‚   (React)       โ”‚โ—„โ”€โ”€โ–บโ”‚   (Express)     โ”‚โ—„โ”€โ”€โ–บโ”‚   Services      โ”‚
โ”‚                 โ”‚    โ”‚                 โ”‚    โ”‚                 โ”‚
โ”‚ โ€ข User Auth     โ”‚    โ”‚ โ€ข REST API      โ”‚    โ”‚ โ€ข Spotify API   โ”‚
โ”‚ โ€ข Music Player  โ”‚    โ”‚ โ€ข User Mgmt     โ”‚    โ”‚ โ€ข Firebase Auth โ”‚
โ”‚ โ€ข UI Components โ”‚    โ”‚ โ€ข Music Data    โ”‚    โ”‚ โ€ข MongoDB Atlas โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿš€ Installation

Prerequisites

  • Node.js (v16 or higher)
  • npm
  • MongoDB database
  • Firebase project
  • Spotify API access (via NoCodeAPI)

Clone Repository

git clone https://github.com/puneetkr-06/musync.git
cd musync

Backend Setup

cd Backend
npm install

Frontend Setup

cd Frontend
npm install

โš™๏ธ Configuration

Backend Environment Variables

Create 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_key

Frontend Firebase Configuration

Update 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"
};

๐ŸŽฏ Usage

Development Mode

  1. Start Backend Server
cd Backend
npm start
# Server runs on http://localhost:4000
  1. Start Frontend Development Server
cd Frontend
npm run dev
# Application runs on http://localhost:5173

User Journey

  1. Authentication: Sign up or login with email/password or Google
  2. Explore Music: Browse trending songs on the home page
  3. Play Music: Click "Listen Now" to stream 30-second previews
  4. Track History: Recently played songs are automatically saved
  5. Manage Account: View profile and account settings

๐Ÿ“ก API Documentation

Base URL

http://localhost:4000

Authentication Endpoints

Register User

POST /user/register
Content-Type: application/json

{
  "firebaseUid": "string",
  "name": "string",
  "email": "string",
  "photoURL": "string"
}

Login User

POST /user/login
Content-Type: application/json

{
  "firebaseUid": "string"
}

Music Endpoints

Get Trending Songs

GET /musync/trending

Response:

{
  "trending": [
    {
      "id": "string",
      "name": "string",
      "image": "string",
      "artists": "string",
      "preview_url": "string"
    }
  ]
}

User Data Endpoints

Add to Recently Played

POST /user/recent
Content-Type: application/json

{
  "userId": "string",
  "song": {
    "name": "string",
    "artists": "string",
    "image": "string",
    "preview_url": "string"
  }
}

Get Recently Played

GET /user/recent/:userId

๐Ÿ“ Project Structure

Musync/
โ”œโ”€โ”€ 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

๐Ÿ”ฎ Future Enhancements

Planned Features

  • 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

Technical Improvements

  • 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

๐Ÿค Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow existing code style and conventions
  • Write meaningful commit messages
  • Update documentation for new features
  • Test your changes thoroughly

๐Ÿ“„ License

This project is licensed under the ISC License. See the LICENSE file for details.

๐Ÿ‘ฅ Team

๐Ÿ™ Acknowledgments


Happy Streaming! ๐ŸŽต

Built with โค๏ธ and lots of โ˜•

About

A Full Stack Music Streaming Web Application.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors