Skip to content

nitinkumar9877/Video-Streaming-Platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ₯ Video Streaming Platform - YouTube Clone Backend API

A scalable YouTube-inspired backend application built with Node.js, Express.js, MongoDB, and Mongoose. The project provides secure authentication, video management, and social interaction features through RESTful APIs, following industry-standard backend development practices.

πŸ—οΈ System Architecture

Architecture Diagram:
πŸ”— https://app.eraser.io/workspace/xloQG2vOVNTa4u4qOfsc?origin=share

The architecture diagram illustrates the complete backend workflow, including authentication, API request flow, Cloudinary integration, MongoDB data models, and relationships between Users, Videos, Comments, Likes, Playlists, and Subscriptions.


πŸš€ Features

  • User Registration & Login
  • JWT Authentication (Access & Refresh Tokens)
  • Secure Password Hashing with bcrypt
  • Video Upload & Management
  • Cloudinary Integration for Video & Image Storage
  • Avatar & Cover Image Upload
  • Thumbnail Upload
  • Like & Unlike Videos
  • Comment on Videos
  • Subscribe & Unsubscribe to Channels
  • Playlist Management
  • Watch History
  • Search, Filter & Sort Videos
  • Pagination
  • User Profile Management
  • Protected Routes
  • Centralized Error Handling
  • Modular MVC Architecture

πŸ› οΈ Tech Stack

Backend

  • Node.js
  • Express.js

Database

  • MongoDB
  • Mongoose

Authentication & Security

  • JWT
  • bcrypt
  • Cookie Parser
  • CORS

File Storage

  • Cloudinary
  • Multer

Development Tools

  • dotenv
  • Nodemon
  • Postman

Database Optimization

  • MongoDB Aggregation Pipeline
  • MongoDB Atlas Search
  • Pagination
  • $lookup

πŸ“‚ Project Structure

VideoTube/
β”‚
β”œβ”€β”€ public/
β”‚
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ controllers/
β”‚   β”œβ”€β”€ db/
β”‚   β”œβ”€β”€ middlewares/
β”‚   β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ routes/
β”‚   β”œβ”€β”€ utils/
β”‚   β”œβ”€β”€ constants.js
β”‚   β”œβ”€β”€ app.js
β”‚   └── index.js
β”‚
β”œβ”€β”€ .env
β”œβ”€β”€ package.json
└── README.md

πŸ“¦ Database Collections

  • Users
  • Videos
  • Comments
  • Likes
  • Playlists
  • Subscriptions
  • Tweets
  • Watch History

πŸ”‘ Authentication

The application uses JWT-based authentication.

  • Access Token
  • Refresh Token
  • HTTP-only Cookies
  • Protected Routes
  • bcrypt Password Hashing

πŸ“Ή Video Management

Users can

  • Upload Videos
  • Update Videos
  • Delete Videos
  • Publish / Unpublish Videos
  • Search Videos
  • Filter Videos
  • Stream Videos

πŸ‘€ User Features

  • Register
  • Login
  • Logout
  • Update Profile
  • Change Password
  • Update Avatar
  • Update Cover Image
  • View Channel Profile
  • Watch History

❀️ Social Features

  • Like Videos
  • Unlike Videos
  • Add Comments
  • Subscribe to Channels
  • Manage Playlists

⚑ Performance Optimizations

  • MongoDB Aggregation Pipelines
  • Pagination
  • Sorting
  • Filtering
  • MongoDB $lookup
  • MongoDB Atlas Search
  • Optimized Queries

πŸ“‘ API Modules

  • Authentication APIs
  • User APIs
  • Video APIs
  • Comment APIs
  • Like APIs
  • Playlist APIs
  • Subscription APIs
  • Dashboard APIs

βš™οΈ Installation

Clone Repository

git clone https://github.com/nitinkumar9877/VideoTube.git

Navigate to Project

cd VideoTube

Install Dependencies

npm install

Configure Environment Variables

Create a .env file in the root directory.

PORT=8000

MONGODB_URI=your_mongodb_connection_string

ACCESS_TOKEN_SECRET=your_access_secret
ACCESS_TOKEN_EXPIRY=1d

REFRESH_TOKEN_SECRET=your_refresh_secret
REFRESH_TOKEN_EXPIRY=10d

CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret

CORS_ORIGIN=http://localhost:5173

Start Development Server

npm run dev

πŸ§ͺ API Testing

The REST APIs can be tested using:

  • Postman
  • Thunder Client
  • Insomnia

πŸ“ˆ Future Improvements

  • Live Video Streaming
  • AI-based Video Recommendations
  • Notification System
  • Watch Later
  • Download Videos
  • Admin Dashboard
  • Trending Videos
  • Video Analytics
  • Real-time Chat
  • Content Moderation

🎯 Learning Outcomes

This project demonstrates practical experience in:

  • Backend Development with Node.js & Express.js
  • REST API Design
  • Authentication & Authorization
  • MongoDB Database Design
  • Mongoose Data Modeling
  • Cloudinary Media Management
  • File Upload Handling
  • MVC Architecture
  • Aggregation Pipelines
  • Scalable Backend Development
  • Production-ready API Development

πŸ‘¨β€πŸ’» Author

Nitin Kumar


πŸ“„ License

This project is developed for educational and portfolio purposes.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors