Skip to main content

Documentation 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.

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 single /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 page and limit query parameters, plus text search and sort controls.
  • Centralized error handling — All errors flow through a consistent ApiError class with HTTP status codes and a structured JSON shape.

Tech stack

LayerTechnology
RuntimeNode.js (ESM modules)
FrameworkExpress 4
DatabaseMongoDB + Mongoose 8
File uploadsMulter + Cloudinary SDK v2
AuthJSON Web Tokens (jsonwebtoken)
Video processingFFmpeg (ffmpeg-static, fluent-ffmpeg)
Dev toolingNodemon, Prettier
HostingRender

Base URL

https://vidtube-ke5w.onrender.com/api/v1
All endpoint paths in this documentation are relative to this base URL. Public endpoints work without authentication. Protected endpoints require an Authorization: Bearer <token> header or an accessToken cookie.

License

VidTube is released under the MIT License.

Build docs developers (and LLMs) love