Skip to content

SonuPaikrao/ottbox

Repository files navigation

🎬 OTT Box - Premium Streaming Experience

⭐⭐ If you find this project useful, please consider giving it a STAR! ⭐⭐

It helps the algorithm and motivates me to add more enterprise features!

OTT Box Banner



✨ Stream Unlimited. Watch Anywhere. Enjoy Everything. ✨

Next.js React TypeScript Supabase TMDB API


🌟 Project Overview

OTT Box is a premium streaming platform that brings the cinema experience to your screen. Built with cutting-edge Next.js 16 and powered by TMDB API, it delivers a rich, immersive viewing experience with auto-playing trailers, dynamic content discovery, and a sleek Netflix-inspired interface.

πŸ”₯ Hot New Features

  • πŸ” Zero-Click QR Login - Real-time Netflix-style WebSocket auth from mobile to desktop.
  • πŸ’Œ Premium Emailing - Automated, custom-branded Welcome & Magic Link emails.
  • πŸ›‘οΈ Secure Magic Links - Advanced database checks to prevent ghost account creation.
  • 🎬 Shorts/Reels Feed - Shorts/Reels-style vertical video feed for immersive trailer discovery.
  • πŸ›‘οΈ Smart Watchlist - Protected watchlist with authentication and easy management.
  • πŸ“± PWA Support - Installable as a native app on all devices.
  • πŸ‘† Touch Interactions - Swipe, scroll, and long-press gestures optimization.

🎯 Key Features

  • πŸŽ₯ Auto-Playing Trailers - Cinematic hero section with YouTube video backgrounds
  • πŸ“± Fully Responsive - Seamless experience across all devices
  • 🎭 Premium UI/UX - Netflix-style design with glassmorphism effects
  • πŸ” Smart Search - Real-time content discovery across movies and TV shows
  • 🎬 Dynamic Categories - Trending, Top Rated, Series, and Genre-based browsing
  • ⚑ Lightning Fast - Server-Side Rendering with Next.js App Router
  • 🎨 Rich Animations - Smooth transitions and interactive hover effects
  • πŸ“Ί Video Player - Integrated streaming capabilities
  • 🌐 Multi-Content Support - Movies, TV Series, Seasons, and Episodes

πŸš€ Live Demo

Live Demo



✨ Full streaming experience with unlimited content! ✨


GitHub Repository

πŸ› οΈ Tech Stack

Frontend Framework

  • βš›οΈ Next.js 16 - Latest App Router with React Server Components
  • 🎨 React 19 - Server Components & Concurrent Features
  • πŸ“˜ TypeScript - Full type safety throughout the application

Backend & Data

  • πŸ—„οΈ Supabase - Backend as a Service for user management
  • 🎬 TMDB API - The Movie Database for content metadata
  • πŸ” Authentication - Secure user authentication with Supabase

Styling & UI

  • 🎨 Vanilla CSS - Custom design system with CSS Modules
  • ✨ Glassmorphism - Modern frosted glass UI effects
  • πŸ”Ή Lucide React - Beautiful, consistent iconography
  • 🎭 Smooth Animations - CSS transitions and transforms

Video & Media

  • πŸ“Ή Video.js - Professional video player integration
  • πŸŽ₯ YouTube Embed - Trailer playback in hero section
  • πŸ–ΌοΈ Next/Image - Optimized image loading and caching

πŸ—οΈ System Architecture

Our architecture is designed to handle real-time concurrency, secure authentication, and edge-deployed frontend delivery.

System_Architecture_Map β€” Executive Overview

System Architecture Map

This diagram presents the platform at an architectural level, focused on service responsibilities and runtime boundaries:

  • Edge-first frontend delivery: Next.js 16 SSR/RSC is deployed on Vercel Edge for low-latency global rendering, static asset optimization, and CDN-assisted distribution.
  • Client intelligence at the edge: Desktop browser and PWA/mobile clients maintain local capabilities (service worker, cache, playback state) to reduce round trips and improve UX continuity.
  • Real-time trust path: Zero-click QR login bridges desktop and mobile through Supabase Auth + Realtime channels, enabling secure cross-device session initiation.
  • Core data domains: User profiles, watchlist state, playback tracking, and search analytics are modeled as first-class backend domains for personalization and observability.
  • External provider integration: TMDB powers metadata discovery, YouTube powers trailer/media surfaces, and SMTP/Nodemailer handles transactional communication.

System_Connectivity_Map β€” Operational Flow Overview

System Connectivity Map

This diagram explains how requests, auth events, and realtime signals move across layers in production:

  • Layered topology: Client Edge -> Delivery (Vercel CDN) -> Application (Next.js App Router + API routes) -> Backend (Supabase services).
  • Zero-click auth choreography: Desktop generates QR token, mobile scans and authenticates, backend validates and publishes session state, desktop completes login without manual credential entry.
  • API surface separation: Dedicated routes for auth, analytics tracking, notifications/email, and search/view logging isolate concerns and simplify scaling.
  • Data and event pipelines: Realtime streams handle instant state updates while relational tables persist durable entities like users, watchlist, and search logs.
  • Media + metadata routing: Catalog intelligence (TMDB) and trailer delivery (YouTube) are integrated as upstream systems behind the application layer.

πŸ“¦ Installation & Setup

Prerequisites

  • Node.js (v18 or higher)
  • NPM or Yarn package manager
  • Supabase account (free tier available)
  • TMDB API key (free registration)

Quick Start

# 1. Clone the repository
git clone https://github.com/SonuPaikrao/ottbox.git

# 2. Navigate to project directory
cd ott-box

# 3. Install dependencies
npm install

# 4. Setup environment variables
# Create .env.local file and add:
# NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
# NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key

# 5. Start development server
npm run dev

# 6. Open in browser
# Visit http://localhost:3000

Environment Variables

Create a .env.local file in the root directory:

# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url_here
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key_here

### **Authentication Setup (Important)**
To enable Google Sign-In:
1. Go to **Authentication > Providers** in Supabase Dashboard.
2. Enable **Google**.
3. **In Google Cloud Console**:
   - Create Credentials > OAuth Client ID.
   - **Application Type**: Select **Web application** (NOT Chrome Extension).
   - **Name**: "OttBox Web" or similar.
4. Add **Authorized redirect URIs** in Google Cloud: 
   - `https://wkfynjofytyfpvimlfno.supabase.co/auth/v1/callback`
### **Production & Vercel Setup**
When deploying to Vercel:
1. Go to **Supabase Dashboard > Authentication > URL Configuration**.
2. **Site URL**: Set this to your production URL (e.g., `https://ott-box-weld.vercel.app`).
3. **Redirect URLs**: Add the following:
   - `https://ott-box-weld.vercel.app/**`
   - `http://localhost:3000/**`
   
**Note**: You do NOT need to change anything in Google Cloud Console if you are using the Supabase Callback URL correctly. Just ensure Supabase allows your Vercel domain.


🎨 Design Features

Visual Design

  • 🎨 Dark Cinema Palette - Deep blacks (#0a0a0a), rich purples, and vibrant accents
  • 🌟 Hero Section - Full-screen video background with auto-playing trailers
  • 🎭 Micro-Interactions - Hover effects, scale transforms, and smooth transitions
  • πŸ“± Responsive Grid - Adaptive layouts for all screen sizes
  • πŸ” Blur Effects - Strategic use of backdrop filters for depth

Typography

  • 🎨 Display Font - Bold, cinematic headings
  • πŸ“ Body Font - Clean, readable sans-serif
  • 🎯 Hierarchy - Clear visual distinction between content types

πŸ“ Project Structure

ottbox/
β”œβ”€β”€ πŸ“ public/                    # Static assets, PWA files, architecture maps
β”‚   β”œβ”€β”€ πŸ—ΊοΈ System_Architecture_Map.png
β”‚   β”œβ”€β”€ πŸ—ΊοΈ System_Connectivity_Map.png
β”‚   β”œβ”€β”€ 🎬 ott-banner.png
β”‚   β”œβ”€β”€ πŸ“„ manifest.json
β”‚   β”œβ”€β”€ βš™οΈ sw.js / workbox-*.js
β”‚   └── 🎨 icons/, svg/jpg/png assets
β”œβ”€β”€ πŸ“ src/
β”‚   β”œβ”€β”€ πŸ“ app/                   # App Router: pages + route handlers
β”‚   β”‚   β”œβ”€β”€ 🏠 page.tsx            # Home
β”‚   β”‚   β”œβ”€β”€ πŸ“ api/               # REST endpoints (auth, track, logs, notifications)
β”‚   β”‚   β”œβ”€β”€ 🎬 movies/, πŸ“Ί series/, πŸ”₯ trending/
β”‚   β”‚   β”œβ”€β”€ πŸ” search/, 🎞️ shorts/, ❀️ watchlist/
β”‚   β”‚   β”œβ”€β”€ πŸ“– title/[id]/, ▢️ watch/[id]/
β”‚   β”‚   β”œβ”€β”€ πŸ” auth/callback/, πŸ“± qr/
β”‚   β”‚   └── 🎨 layout.tsx, globals.css, loading/error boundaries
β”‚   β”œβ”€β”€ πŸ“ components/            # Feature-organized UI modules
β”‚   β”‚   β”œβ”€β”€ Home/, Navbar/, Player/, Search/
β”‚   β”‚   β”œβ”€β”€ Title/, Shared/, Shorts/, Skeletons/, Analytics/
β”‚   β”‚   └── NotificationPopup.tsx
β”‚   β”œβ”€β”€ πŸ“ context/               # Global state providers
β”‚   β”‚   β”œβ”€β”€ AuthContext.tsx
β”‚   β”‚   β”œβ”€β”€ WatchlistContext.tsx
β”‚   β”‚   β”œβ”€β”€ HistoryContext.tsx
β”‚   β”‚   └── ToastContext.tsx
β”‚   β”œβ”€β”€ πŸ“ lib/                   # Integrations and utility services
β”‚   β”‚   β”œβ”€β”€ api.ts, tracker.tsx
β”‚   β”‚   β”œβ”€β”€ supabase.ts, supabase-browser.ts, supabase-admin.ts
β”‚   β”‚   └── email.ts, email-templates.ts
β”‚   └── πŸ“ types/                 # Project type declarations
β”œβ”€β”€ πŸ“„ package.json                # Scripts and dependencies
β”œβ”€β”€ πŸ“„ next.config.ts              # Next.js runtime config
β”œβ”€β”€ πŸ“„ tsconfig.json               # TypeScript config
β”œβ”€β”€ πŸ“„ vercel.json                 # Deployment config
β”œβ”€β”€ πŸ“„ eslint.config.mjs           # Lint rules
β”œβ”€β”€ πŸ“„ *.sql                       # Supabase setup/migration scripts
β”œβ”€β”€ πŸ“„ .env                         # Local environment variables
└── πŸ“„ README.md

🎯 Key Components

🎬 Hero Section

  • Full-screen video background with YouTube trailers
  • Auto-rotation between trending content
  • Smooth fade transitions between videos and images
  • CTAs for "Play Now" and "More Info"

🎞️ Content Rows

  • Horizontally scrollable movie/series cards
  • Categories: Trending Today, Top Rated, TV Series, By Genre
  • Lazy loading for optimal performance
  • Hover effects with scale and elevation

πŸ” Search & Discovery

  • Real-time search across all content
  • Genre-based filtering
  • Advanced discovery with sort options
  • Responsive grid layouts

πŸ“Ί Video Player

  • Custom video player interface
  • Episode selection for TV series
  • Playback controls and settings
  • Fullscreen support

πŸš€ Deployment

Vercel (Recommended)

# Install Vercel CLI
npm i -g vercel

# Login to Vercel
vercel login

# Deploy to production
vercel --prod

Environment Variables on Vercel

Add the following environment variables in Vercel Dashboard:

  • NEXT_PUBLIC_SUPABASE_URL
  • NEXT_PUBLIC_SUPABASE_ANON_KEY

GitHub Integration

Connect your repository to Vercel for automatic deployments on every push.


🎬 Content Categories

πŸ”₯ Trending

  • Daily trending movies and TV shows
  • Real-time updates from TMDB
  • Personalized recommendations

⭐ Top Rated

  • Highest-rated films across all time
  • Curated collections
  • Award-winning content

πŸ“Ί TV Series

  • Popular series with season tracking
  • Episode-by-episode viewing
  • Binge-worthy collections

🎭 By Genre

  • Action & Adventure
  • Comedy & Drama
  • Sci-Fi & Fantasy
  • Horror & Thriller
  • Romance & Animation

🀝 Contributing

We welcome contributions! Please follow these steps:

  1. 🍴 Fork the repository
  2. 🌿 Create a feature branch (git checkout -b feature/amazing-feature)
  3. πŸ’Ύ Commit your changes (git commit -m 'Add amazing feature')
  4. πŸ“€ Push to the branch (git push origin feature/amazing-feature)
  5. πŸ”„ Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments

  • 🎬 TMDB - For providing comprehensive movie and TV data
  • πŸ—„οΈ Supabase - For backend infrastructure
  • βš›οΈ Next.js Team - For an amazing framework
  • 🎨 Design Inspiration - Netflix, Disney+, and other streaming platforms

πŸ‘¨πŸ’» Developer

Developed with ❀️ by Sonu Rao


πŸ’Ό GitHub Profile


February 2026


🎬 Made for Movie & TV Enthusiasts 🍿

If you love this project, give it a ⭐ star!

Happy Streaming! πŸ“Ίβœ¨

About

A high-performance, enterprise-ready OTT streaming architecture built on Next.js & Supabase. Delivering cinematic UX, real-time WebSocket auth, and edge-optimized media discovery.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors