This project is a backend API for a Youtube-like video sharing platform, built with Node.js, Express, and MongoDB. It supports user authentication, video upload and streaming, likes, comments, subscriptions, watch history, and more.
- User Authentication: Register, login, logout, JWT-based auth.
 - Video Upload & Streaming: Upload videos and thumbnails, stream videos.
 - Cloudinary Integration: Store videos and images on Cloudinary.
 - Likes & Comments: Like videos, comment on videos, reply to comments.
 - Subscriptions: Subscribe/unsubscribe to channels.
 - Watch History: Track and retrieve user watch history.
 - Fuzzy Search: Search videos by title/description with typo tolerance (Atlas Search or Fuse.js).
 - Pagination & Sorting: Paginated video lists, sort by views, date, etc.
 - Profile Management: Update avatar, cover image, and account details.
 
- Node.js & Express
 - MongoDB with Mongoose
 - Cloudinary for media storage
 - JWT for authentication
 - Multer for file uploads
 - Fuse.js or MongoDB Atlas Search for fuzzy search
 
https://github.com/gaurav4288/VideoTube_Backend.git
cd youtube-like-backendnpm installCreate a .env file in the root directory and add:
PORT=5000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
npm run devPOST /api/v1/users/register— Register a new userPOST /api/v1/users/login— LoginPOST /api/v1/users/logout— Logout
POST /api/v1/videos— Upload a videoGET /api/v1/videos— Get all videos (with search, pagination)GET /api/v1/videos/:videoId— Get video by IDDELETE /api/v1/videos/:videoId— Delete a video
POST /api/v1/videos/:videoId/likePOST /api/v1/videos/:videoId/commentPOST /api/v1/users/subscribe/:channelIdGET /api/v1/users/history
- Fuzzy search is supported using MongoDB Atlas Search (recommended) or Fuse.js (in-memory, for small datasets).
 
This project is inspired by and based on the work of Hitesh Choudhary.
Special thanks for the open-source chai-backend repository and educational content.
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.