← Back to portfolio
Express
TypeScript
MongoDB
Mongoose
JWT
Cloudinary

2024 - Present

Video Streaming API

A production-grade REST API covering the full surface of a video platform: upload, stream, comment, like, subscribe, and tweet. MongoDB aggregation pipelines power the subscription feed, watch history, and channel analytics — no N+1 queries. Auth uses short-lived JWT access tokens paired with rotating refresh tokens stored in HTTP-only cookies, keeping sessions stateless on the server. Indexes are tuned per query pattern so hot paths stay fast as data volume grows.

🎥 VideoTube API

VideoTube is a modern backend API for a YouTube-inspired video platform built with Node.js, Express, and TypeScript. It provides a secure, scalable foundation for user authentication, video management, community features, and media uploads.

This project is designed to showcase strong backend engineering practices such as modular architecture, input validation, authentication, file handling, and production-ready middleware.


🚀 Why This Project Stands Out


✨ Core Features


🛠️ Tech Stack

Backend

Security & Reliability


🏗️ Architecture

The application follows a modular backend architecture:

Client
  │
  ▼
Express Server
  │
  ├─ Middleware (Auth, Security, Validation, Logging)
  │
  ├─ Routes
  │   ├─ Users
  │   ├─ Videos
  │   ├─ Tweets
  │   ├─ Comments / Likes / Subscriptions / Playlists
  │   └─ Dashboard
  │
  ├─ Controllers
  ├─ Models
  └─ Database / Cloud Storage
         ├─ MongoDB
         └─ Cloudinary

Request Flow

  1. Client sends a request to an Express route
  2. Middleware validates authentication, security, and input
  3. Controller handles the business logic
  4. Model interacts with MongoDB
  5. Media files are uploaded to Cloudinary when required
  6. Response is returned in a standardized API format

📁 Project Structure

src/
├── app.ts
├── index.ts
├── config/
├── controllers/
├── db/
├── middlewares/
├── models/
├── routes/
├── schema/
├── utils/
└── multithreading/

🔐 Environment Variables

Create a .env file in the root directory with the following variables:

PORT=5000
CORS_ORIGIN=http://localhost:3000
DB_URI=<your_mongodb_connection_string>
ACCESS_TOKEN_SECRET=<your_access_token_secret>
ACCESS_TOKEN_EXPIRY=1d
REFRESH_TOKEN_SECRET=<your_refresh_token_secret>
REFRESH_TOKEN_EXPIRY=10d
CLOUDINARY_CLOUD_NAME=<your_cloudinary_cloud_name>
CLOUDINARY_API_KEY=<your_cloudinary_api_key>
CLOUDINARY_API_SECRET=<your_cloudinary_api_secret>
NODE_ENV=development

⚙️ Installation & Setup

1. Clone the repository

git clone <repository-url>
cd rest_api_videotube_app

2. Install dependencies

npm install

3. Start the development server

npm run dev

4. Build for production

npm run build

📡 API Highlights

Authentication

Videos

Social Features

Other Modules


🧠 What I Learned While Building This


📜 License

This project is licensed under the ISC License.


👤 Contact