Skip to content

anand-devx/Youtube-backend

Repository files navigation

📺 YouTube Backend

A scalable and modular backend clone of YouTube built with Node.js and Express.js, featuring user authentication, video management — inspired by YouTube’s core features.


🌟 Features

  • User registration and login with JWT
  • Upload videos with Cloudinary
  • View history, playlists, and user-specific content
  • RESTful APIs using Express
  • MongoDB + Mongoose for database layer

🛠 Tech Stack

  • Node.js
  • Express.js
  • MongoDB + Mongoose
  • JWT (Authentication)
  • Multer (file uploads)
  • Cloudinary (optional)
  • dotenv for environment management

📂 Project Structure

Youtube-backend/
├── public/temp/
│   └── .gitkeep
├── src/
│   ├── controllers/
│   ├   └── user.controller.js
|   ├── middlewares/
│   |   └── auth.middleware.js
│   |   └── multer.middleware.js
|   ├── db/
│   |   └── index.js
|   ├── models/
│   |   └── subscription.model.js
│   |   └── user.models.js
|   |   └── video.models.js
|   ├── routes/
│   |   └── user.route.js
|   ├── utils/
│   |   └── ApiError.js
│   |   └── ApiResponse.js
│   |   └── cloudinary.js
│   |   └── asyncHandler.js
│   ├── app.js
│   ├── constants.js
│   ├── index.js
├── .env.sample
├── .gitignore
├── .prettierignore
├── .prettierrc
├── package-lock.json
├── Screenshot 2025-03-05 205445.png
├── package.json
└── Readme.md

⚙️ Getting Started

📦 Prerequisites

  • Node.js v18+
  • MongoDB (local or Atlas)
  • Cloudinary account

🚀 Installation

git clone https://github.com/anand11206/Youtube-backend.git
cd Youtube-backend

npm install

⚙️ Environment Setup

Create a .env file in the root directory renaming the .env.sample file and filling values


🧪 Running the Server

npm run dev

Server will run on:

http://localhost:PORT (PORT in .env file)

📡 API Endpoints

Auth

  • POST /api/v1/users/register
  • POST /api/v1/users/login
  • POST /api/v1/users/logout
  • POST /api/v1/users/refresh-access-token
  • POST /api/v1/users/change-password
  • POST /api/v1/users/update-details
  • POST /api/v1/users/update-avatar-cover-images

🧪 Testing Tools

  • Postman or Thunder Client for API testing
  • MongoDB Compass for DB inspection

📄 License

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


👤 Author

Your Name
GitHub: @anand11206


🤝 Contributions

PRs and suggestions are always welcome.
Please fork the repository and submit a pull request.


About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published