How chandi977/youtube-backend works
Project type and purpose
• This is a Node.js/Express backend for a video-streaming platform (“VideoTube”), using MongoDB for storage, Redis (Upstash) for caching/queues, Cloudinary for media hosting, and BullMQ workers for background jobs. It exposes REST APIs and WebSocket endpoints, and uses Docker (without Nginx per your instruction).
File structure
• Top-level: Dockerfile, docker-compose.yml, package.json, README, src/, public/
• src/app.js and src/index.js bootstrap the Express app and socket server.
• src/controllers and src/routes implement REST endpoints following an MVC-style division.
• src/middleware holds authentication, error-handling, file-upload, and security middleware.
• src/models defines Mongoose schemas for Users, Videos, Comments, etc.
• src/queues and src/workers implement BullMQ job producers (e.g., video processing, syncLikes) and consumers in separate worker processes.
• src/socket/socketHandler.js ties in WebSocket logic for live streaming/chat.
• src/config holds environment and third-party client (Redis, Passport) setup.
• src/utils holds shared helpers (ApiError/Response, asyncHandler, cloudinary wrapper, video processing).
README for additional insights
• Confirms tech stack (Express, MongoDB, Mongoose, JWT, Cloudinary, Redis/BullMQ).
• Describes features: User auth (JWT), video CRUD, pagination, upload → Cloudinary, live streaming.
• Mentions Docker Compose orchestration (app + RTMP server under Nginx normally, but you’re omitting Nginx).