Skip to content

A full-featured backend for a video-sharing platform (YouTube clone) built with Node.js, Express.js, and MongoDB.

Notifications You must be signed in to change notification settings

Noah-04/youtube-clone-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YouTube Clone - Backend A full-featured backend for a video-sharing platform built with Node.js, Express.js, and MongoDB, featuring secure JWT authentication, video processing, and advanced data aggregation.

Run in Postman

Postman Setup

After importing the collection, you will need to set up an environment variable to run the requests.

  1. Create a new environment in Postman.
  2. Add a variable named server.
  3. Set the value of the server variable to your local server address (e.g., http://localhost:8000).
  4. Make sure to select this environment in Postman before sending any requests.

About The Project This project is the complete backend infrastructure for a video-sharing platform modeled after YouTube. It provides a robust, scalable, and secure RESTful API to handle all server-side operations, from user authentication and video processing to complex data relationships like subscriptions, likes, comments, and playlists. The architecture is designed to efficiently support a dynamic, interactive front-end application. Tech Stack Backend Framework: Node.js, Express.js Database: MongoDB (with Mongoose as the ODM) Authentication: JWT (JSON Web Tokens), bcrypt File & Media Management: Cloudinary (for cloud storage), Multer (for file uploads) API Development: RESTful API Principles, Postman Environment Management: dotenv Key Features User Authentication: Secure user registration and login system with JWT access and refresh tokens. Video Management: Complete CRUD operations for videos, including uploads, updates, and deletion. Cloudinary Integration: Seamless video and image (thumbnails, avatars) uploads and management. Subscription System: Full functionality for users to subscribe and unsubscribe to channels. Like/Unlike System: Polymorphic "like" feature for videos, comments, and tweets. Commenting: Full CRUD functionality for comments on videos. Playlists: User-curated video playlists with complete management capabilities. Advanced Data Aggregation: Complex database queries using MongoDB's Aggregation Pipeline to generate: User Channel Profiles (subscriber counts, etc.) Creator Dashboards (total views, likes, subscribers, and videos) Tweet Functionality: A simple Twitter-like feature for users to post short text updates. Getting Started To get a local copy up and running, follow these simple steps. Prerequisites Node.js and npm installed MongoDB instance (local or cloud) A Cloudinary account Installation Clone the repository: git clone https://github.com/Noah-04/youtube-clone-backend.git

Navigate to the project directory: cd your-repo-name

Install NPM packages: npm install

Set up environment variables: Create a .env file in the root of the project and add the following variables: PORT=8000 MONGODB_URI=your_mongodb_connection_string CORS_ORIGIN=*

ACCESS_TOKEN_SECRET=your_access_token_secret ACCESS_TOKEN_EXPIRY=1d REFRESH_TOKEN_SECRET=your_refresh_token_secret REFRESH_TOKEN_EXPIRY=10d

CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name CLOUDINARY_API_KEY=your_cloudinary_api_key CLOUDINARY_API_SECRET=your_cloudinary_api_secret

Start the server: npm run dev

About

A full-featured backend for a video-sharing platform (YouTube clone) built with Node.js, Express.js, and MongoDB.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published