Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/barcode8/VideoHub/llms.txt

Use this file to discover all available pages before exploring further.

VideoHub is an open-source, full-stack video sharing platform that blends YouTube-style video hosting with Twitter-style social interactions — all in a single cohesive application. Developers can self-host the entire stack, extend the REST API with new routes and models, or use it as a reference architecture for building media-driven platforms on Node.js, Express 5, and MongoDB.

Key Features

Video Hosting

Upload, stream, and manage videos through Cloudinary. Multer handles multipart uploads server-side, and the API exposes full CRUD for video resources including title, description, thumbnail, and view tracking.

JWT Authentication

Stateless auth with short-lived access tokens and long-lived refresh tokens. Tokens are issued as both HTTP-only cookies and JSON response fields, giving clients flexibility on how they store credentials.

Social Interactions

Users can like videos and comments, post threaded comments, and subscribe to channels. Mongoose aggregation pipelines power subscriber counts and liked-content feeds.

Playlists

Create, update, and delete playlists. Add or remove individual videos. Playlists are tied to a user’s account and exposed through a dedicated REST resource.

Channel Dashboard

Each user has a channel dashboard surfacing total video views, subscriber count, total likes, and a full list of uploaded videos — all computed server-side via MongoDB aggregations.

Watch History

View endpoints automatically record watch events per user. History is stored per-account and retrievable through the user profile API so the frontend can render a personalised “continue watching” feed.

Tech Stack

Backend

PackageVersionRole
Express^5.1.0HTTP server and routing framework
Mongoose^8.15.0MongoDB ODM with schema validation
mongoose-aggregate-paginate-v2^1.1.4Cursor-based pagination for aggregate queries
Cloudinary SDK^2.7.0Cloud media storage and transformation
Multer^2.0.1Multipart form-data (file upload) middleware
bcrypt^6.0.0Password hashing
jsonwebtoken^9.0.2JWT signing and verification
cookie-parser^1.4.7Parse cookies from incoming requests
dotenv^16.5.0Environment variable loading
cors^2.8.5Cross-origin resource sharing middleware

Frontend

PackageVersionRole
React^19.1.0UI component library
Vite^7.0.4Build tool and dev server
Tailwind CSS^4.1.11Utility-first styling
Framer Motion^12.42.1Animation and transitions
Axios^1.10.0HTTP client for API calls
React Router^7.7.0Client-side routing

Architecture Overview

VideoHub is organised as a monorepo with two top-level directories:
VideoHub/
├── Backend/          # Node.js REST API (Express 5 + MongoDB)
│   ├── src/
│   │   ├── index.js         # Entry point — loads env, checks temp dir, connects DB, starts server
│   │   ├── app.js           # Express app — middleware stack and route mounting
│   │   ├── db/index.js      # Mongoose connection helper
│   │   ├── routes/          # One file per resource (users, videos, likes, …)
│   │   ├── controllers/     # Business logic for each route
│   │   ├── models/          # Mongoose schemas
│   │   └── middlewares/     # Auth guard, Multer config, error handlers
│   ├── Dockerfile
│   └── .env.sample
└── Frontend/         # React 19 SPA (Vite + Tailwind)
    ├── src/
    │   ├── pages/           # Route-level page components
    │   ├── components/      # Reusable UI components
    │   └── api/             # Axios instances and request helpers
    └── vite.config.js
The backend exposes a versioned REST API under /api/v1/. Every resource — users, videos, likes, comments, subscriptions, playlists, dashboard, watch history, and healthcheck — is mounted as its own Express router. The frontend communicates exclusively through this API, so the two halves can be deployed independently or containerised separately.

Next Steps

Quickstart

Clone the repo, configure your environment, and make your first API call in five minutes.

API Reference

Explore every endpoint — authentication, videos, playlists, comments, subscriptions, and more.

Build docs developers (and LLMs) love