VidTube is a production-ready RESTful API that gives you a complete backend for a video-sharing platform, inspired by YouTube. Built with Node.js, Express, and MongoDB, it covers the full lifecycle of a video platform: user accounts with JWT authentication, video uploads via Cloudinary, social interactions (comments, likes, tweets, subscriptions), curated playlists, and channel analytics — all accessible under a singleDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Pragyat-Nikunj/VidTube/llms.txt
Use this file to discover all available pages before exploring further.
/api/v1 base path. You can run it locally or hit the live demo at https://vidtube-ke5w.onrender.com/api/v1 immediately.
Quickstart
Clone the repo, configure environment variables, and make your first API call in minutes.
Authentication
Understand how access tokens and refresh tokens work, and which endpoints require them.
API Reference
Full endpoint reference for users, videos, comments, likes, playlists, tweets, subscriptions, and dashboard.
Video uploads
Upload videos and thumbnails to Cloudinary with automatic duration detection via FFmpeg.
Key features
- JWT authentication — Short-lived access tokens (default 1 h) paired with long-lived refresh tokens (default 10 d) secure every protected endpoint.
- Video upload via Cloudinary — Multer handles multipart uploads locally; files are then streamed to Cloudinary. FFmpeg extracts video duration automatically.
- Social interactions — Likes, comments, tweets, and channel subscriptions with toggle semantics (one endpoint to subscribe or unsubscribe).
- Channel analytics — Dashboard endpoints expose total views, subscribers, video count, and like counts per channel.
- Pagination and filtering — Video listings support page-based pagination with
pageandlimitquery parameters, plus text search and sort controls. - Centralized error handling — All errors flow through a consistent
ApiErrorclass with HTTP status codes and a structured JSON shape.
Tech stack
| Layer | Technology |
|---|---|
| Runtime | Node.js (ESM modules) |
| Framework | Express 4 |
| Database | MongoDB + Mongoose 8 |
| File uploads | Multer + Cloudinary SDK v2 |
| Auth | JSON Web Tokens (jsonwebtoken) |
| Video processing | FFmpeg (ffmpeg-static, fluent-ffmpeg) |
| Dev tooling | Nodemon, Prettier |
| Hosting | Render |
Base URL
Authorization: Bearer <token> header or an accessToken cookie.