A modern video upload and streaming platform with automatic transcoding to HLS.
- Video Upload: Drag-and-drop uploads with progress tracking
- Auto Transcoding: FFmpeg processing to multiple HLS resolutions (240p-1080p)
- Adaptive Streaming: Direct HLS streaming from Cloudflare R2
- Real-time Status: Monitor transcoding progress
- Modern UI: Next.js 16 + React 19 + Tailwind CSS
- Web App (
web/): Next.js frontend with API routes - Worker (
worker/): Node.js transcoding service - Database: PostgreSQL with Prisma
- Queue: Redis (Upstash)
- Storage: UploadThing (temp) + Cloudflare R2 (HLS)
# Web app
cd web && npm install
# Worker
cd ../worker && npm installcd web
npx prisma generate
npx prisma db pushweb/.env:
DATABASE_URL="postgresql://..."
UPSTASH_REDIS_REST_URL="..."
UPSTASH_REDIS_REST_TOKEN="..."
R2_PUBLIC_URL="..."
UPLOADTHING_TOKEN="..."worker/.env:
CLOUDFLARE_ACCOUNT_ID="..."
R2_ACCESS_KEY_ID="..."
R2_SECRET_ACCESS_KEY="..."
UPSTASH_REDIS_REST_URL="..."
UPSTASH_REDIS_REST_TOKEN="..."
BACKEND_URL="http://localhost:3000"# Terminal 1: Web app
cd web && npm run dev
# Terminal 2: Worker
cd worker && npm start- Go to http://localhost:3000/upload
- Upload a video file
- Monitor progress at /tasks
- Watch at /w/{video-id}
POST /api/upload- Create video recordPOST /api/status/:id- Update statusGET /api/sw/:id- Get streaming URLPOST /api/delete- Delete video
- Node.js 18+
- FFmpeg
- PostgreSQL
- Redis (Upstash)
- Cloudflare R2
- UploadThing account
- Frontend: Vercel
- Worker: Docker/Railway
- Database: Railway/Supabase
- Ensure FFmpeg is installed:
ffmpeg -version - Check database:
npx prisma studio - View logs in terminal for both services