Skip to content

mukul1612/musicApp-Backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎵 Music App Backend

A scalable backend API for a Music Streaming Application built using Node.js and Express. This project handles user authentication, music management, and secure API operations, designed to simulate a real-world backend system.


🚀 Features

  • 🔐 User Authentication (JWT-based)
  • 👤 User Registration & Login
  • 🎶 Music Upload & Management
  • 📂 Organized MVC Architecture
  • 🔑 Secure Password Hashing
  • ⚡ RESTful API Design
  • 🌐 Environment-based configuration

🛠️ Tech Stack

  • Node.js
  • Express.js
  • MongoDB (Mongoose)
  • JWT (Authentication)
  • bcrypt.js (Password Hashing)
  • dotenv

📁 Project Structure

musicApp-Backend/
│
├── controllers/     # Business logic
├── models/          # Database schemas
├── routes/          # API routes
├── middleware/      # Auth & error handling
├── config/          # DB & environment setup
├── utils/           # Helper functions
├── app.js           # App configuration
├── server.js        # Entry point
└── .env             # Environment variables (not committed)

⚙️ Installation & Setup

  1. Clone the repository:
git clone https://github.com/mukul1612/musicApp-Backend.git
  1. Navigate to the project folder:
cd musicApp-Backend
  1. Install dependencies:
npm install
  1. Create a .env file and add:
PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_secret_key
  1. Start the server:
npm run dev

📌 API Endpoints (Sample)

Auth Routes

  • POST /api/auth/register → Register user
  • POST /api/auth/login → Login user

Music Routes

  • GET /api/music → Get all songs
  • POST /api/music → Upload music
  • DELETE /api/music/:id → Delete song

🔐 Authentication

This API uses JWT (JSON Web Tokens) for secure authentication. Protected routes require a valid token in headers:

Authorization: Bearer <token>

About

Production-ready backend for a music app with JWT auth, secure APIs, and scalable architecture using Node.js, Express, and MongoDB.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors