This project is a backend clone of YouTube, designed to mimic the core functionalities of the popular video-sharing platform. It is built using Node.js, Express.js, and MongoDB. The main features include user authentication, video streaming, commenting on videos, subscription model, and watch history.
- User Authentication (Sign Up, Log In, Log Out)
- Video Streaming
- Commenting on Videos
- Like and Dislike Videos
- User Profile Management
- Subscription Model
- Watch History
- Node.js: JavaScript runtime for building the server-side application.
- Express.js: Web framework for Node.js.
- MongoDB: NoSQL database for storing user and video data.
- Mongoose: ODM for MongoDB and Node.js.
- JWT: JSON Web Tokens for authentication.
YOUTUBE BACKEND CLONE/
├── node_modules/
├── public/
│ └── temp/
│ └── .gitkeep
├── src/
│ ├── controllers/
│ │ └── user-controller.js
│ ├── db/
│ │ └── db.js
│ ├── middlewares/
│ │ ├── auth.js
│ │ └── multer.js
│ ├── models/
│ │ ├── subscription-model.js
│ │ ├── user-model.js
│ │ └── video-model.js
│ ├── routes/
│ │ └── user-routes.js
│ ├── utils/
│ │ ├── ApiError.js
│ │ ├── ApiResponse.js
│ │ ├── asyncHandler.js
│ │ └── cloudinary.js
├── app.js
├── constants.js
├── index.js
├── .env
├── .gitignore
├── .prettierignore
├── .prettierrc
├── package-lock.json
├── package.json
└── README.md
- Node.js installed
- MongoDB installed and running
- Clone the repository:
git clone https://github.com/Nitesh-18/Youtube-Backend-Clone.git
cd Youtube-Backend-Clone
- Install dependencies:
npm install
- Set up environment variables:
Create a .env
file in the root directory and add the following:
PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
- Start the server:
npm start
The server should now be running on http://localhost:5000
.
- Fork the repository
- Create a new branch (
git checkout -b feature/your-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin feature/your-feature
) - Create a new Pull Request
For any questions or feedback, please contact me via LinkedIn.