README

YouTube Clone

thumbnail

A modern YouTube clone built with Next.js, Drizzle ORM, and modern UI libraries, featuring advanced video processing, real-time transcription, and a responsive design.

Key Features

  • ๐ŸŽฅ Advanced video player with quality controls
  • ๐ŸŽฌ Real-time video processing with Mux
  • ๐Ÿ“ Automatic video transcription
  • ๐Ÿ–ผ๏ธ Smart thumbnail generation
  • ๐Ÿค– AI-powered title and description generation
  • ๐Ÿ“Š Creator Studio with metrics
  • ๐Ÿ—‚๏ธ Custom playlist management
  • ๐Ÿ“ฑ Responsive design across devices
  • ๐Ÿ”„ Multiple content feeds
  • ๐Ÿ’ฌ Interactive comment system
  • ๐Ÿ‘ Like and subscription system
  • ๐ŸŽฏ Watch history tracking
  • ๐Ÿ” Authentication system
  • ๐Ÿ“ฆ Module-based architecture
  • ๐Ÿ—„๏ธ PostgreSQL with DrizzleORM
  • ๐Ÿš€ Next.js 15 & React 19
  • ๐Ÿ”„ tRPC for type-safe APIs
  • ๐Ÿ’… TailwindCSS & ShadcnUI styling

Prerequisites

  • Node.js 18+ or Bun 1.0+
  • PostgreSQL or NeonDB account
  • Mux account for video processing
  • OpenAI API key for AI features
  • Upstash account for Redis and Workflows
  • Clerk account for authentication

Getting Started

Installation

Using Bun (Recommended)

# Install dependencies
bun install

# Copy environment variables
cp .env.example .env

Using npm

# Install dependencies
npm install
# If you get errors try
npm install --legacy-peer-deps

# Copy environment variables
cp .env.example .env

Environment Variables

Update the .env file with your configuration:

# Database
DATABASE_URL=your_postgres_url

# Global
NEXT_PUBLIC_APP_URL=http://localhost:3000

# Mux (Video Processing)
MUX_TOKEN_ID=your_mux_token_id
MUX_TOKEN_SECRET=your_mux_token_secret
MUX_WEBHOOK_SECRET=your_mux_webhook_secret

# OpenAI (AI Features)
OPENAI_API_KEY=your_openai_api_key

# Upstash (Redis & Workflows)
UPSTASH_REDIS_REST_URL=your_upstash_redis_url
UPSTASH_REDIS_REST_TOKEN=your_upstash_redis_token
UPSTASH_WORKFLOW_URL=your_upstash_workflow_url
QSTASH_TOKEN=your_qstash_token

# Clerk (Authentication)
CLERK_SIGNING_SECRET=your_clerk_signing_secret

Database Setup

# Using Bun
bun run src/scripts/seed-categories.ts
# Using TSX
tsx src/scripts/seed-categories.ts

Development

# Using Bun
bun run dev:all

# Using npm
npm run dev:all

Open http://localhost:3000 with your browser to see the result.

Available Scripts

  • dev - Start development server
  • build - Build for production
  • start - Start production server
  • lint - Run ESLint
  • dev:all - Start dev server and webhook tunnel (for local Stripe/webhooks)

Learn More