A full-stack video sharing platform built with Next.js 15, featuring video transcoding, real-time features, content moderation, and YouTube-style UI.
-
🎥 Video Upload & Processing
- Multi-quality transcoding (360p, 480p, 720p, 1080p)
- Automatic thumbnail generation
- FFmpeg-based processing pipeline
- Queue-based background processing with BullMQ
-
👤 User Authentication
- Email/password registration
- Secure session management
- Profile customization
- Avatar uploads
-
🎨 Modern UI
- Dark mode YouTube-style interface
- Responsive design (mobile & desktop)
- Custom gradient logo
- Horizontal scrolling content rows (Trending, New, Recommended, Subscriptions)
-
💬 Comments System
- Nested comments with replies
- Real-time updates
- Like/dislike comments
-
👍 Reactions
- Like/dislike videos
- View counts
- Engagement tracking
-
🔔 Subscriptions
- Follow channels
- Subscription feed
- Subscriber counts
-
🔍 Search & Discovery
- Full-text video search
- Trending videos
- Personalized recommendations
- New videos feed
-
🛡️ Hash-based Content Safety
- SHA256/MD5 hashing of all uploads
- Blocked content database (CSAM, terrorism detection)
- Automatic rejection of flagged content
-
📋 Reporting System
- Public content reporting form
- Anonymous reporting support
- Priority flagging for critical violations
- Rate limiting to prevent abuse
-
⚖️ DMCA Compliance
- Copyright takedown notice submission
- 24-hour response commitment
- Full 17 USC 512(c) compliance
-
👮 Admin Moderation Dashboard
- Review pending reports
- One-click video takedowns
- Three-strike user system
- Complete audit logging
-
⚡ Performance
- Redis caching
- Rate limiting on all APIs
- Optimized database queries
- CDN-ready architecture
-
🔒 Security
- JWT session tokens
- XSS/CSRF protection
- Input validation & sanitization
- SQL injection prevention
- Secure file uploads
- Next.js 15.5.4 - React framework with App Router
- TypeScript - Type safety
- Tailwind CSS - Utility-first styling
- Lucide React - Icon library
- Next.js API Routes - RESTful API
- MySQL 8.0 - Primary database
- Redis - Caching & sessions
- BullMQ - Job queue for video processing
- FFmpeg - Video transcoding
- Fluent-FFmpeg - Node.js wrapper
- Multiple quality outputs - 360p to 1080p
- PM2 - Process management
- Nginx - Reverse proxy
- Linode - Hosting platform
video-platform/
├── src/
│ ├── app/ # Next.js App Router pages
│ │ ├── api/ # API endpoints
│ │ ├── admin/ # Admin dashboard
│ │ ├── upload/ # Upload page
│ │ ├── watch/ # Video player
│ │ ├── channel/ # Channel pages
│ │ ├── search/ # Search page
│ │ ├── dmca/ # DMCA form
│ │ ├── report/ # Report form
│ │ └── terms/ # Legal pages
│ ├── components/ # React components
│ │ ├── layout/ # Header, Logo
│ │ ├── video/ # VideoCard, VideoPlayer
│ │ └── ui/ # Reusable UI components
│ ├── lib/ # Utilities & services
│ │ ├── db/ # Database connections
│ │ ├── auth.ts # Authentication
│ │ ├── storage.ts # File storage
│ │ └── contentSafety.ts # Content moderation
│ └── middleware/ # Request middleware
├── workers/ # Background job workers
│ └── video-processor.ts # Video transcoding worker
├── scripts/ # Utility scripts
│ ├── setup-database.sql # Database schema
│ └── grant-moderator.sh # Admin access script
└── public/ # Static assets
- Node.js 18+
- MySQL 8.0
- Redis
- FFmpeg
-
Clone the repository
git clone https://github.com/yourusername/videotube.git cd videotube -
Install dependencies
npm install
-
Setup environment variables
cp .env.example .env.local
Edit
.env.localwith your configuration -
Setup database
mysql -u root -p < scripts/setup-database.sql mysql -u root -p < scripts/add-moderation-tables.sql
-
Run development server
npm run dev
-
Start video processing worker
npm run worker
Visit http://localhost:3000
This project taught me about:
- Video processing pipelines - FFmpeg transcoding, queue management
- Real-time features - Live updates, subscriptions
- Content moderation - Hash-based detection, legal compliance
- Scalability challenges - Database optimization, caching strategies
- Infrastructure costs - Why YouTube loses money!
Running a production video platform requires:
- Significant infrastructure costs ($1000s/month for storage)
- Legal compliance (DMCA agent registration)
- Content moderation team
- CDN for global delivery
- Scalable storage solution
This is a learning/portfolio project, not production-ready without major investment.
MIT License - See LICENSE file for details
Built as a learning project to understand full-stack development and video platform architecture.
Note: YouTube loses money for a reason! This project helped me understand why. 😅