A web application to generate Twitch VOD download commands for TwitchDownloaderCLI. Built with the T3 Stack (Next.js, TypeScript, tRPC, Tailwind CSS, Prisma, NextAuth).
- Add multiple Twitch channels to track
- Fetch latest VODs from Twitch API
- Generate copyable download commands for:
- Video download
- Chat download
- Chat render
- Customize chat dimensions and font
- Paginated VOD loading
- Persistent storage with PostgreSQL
- Google OAuth authentication
- Next.js 15 - React framework
- React 19 - UI library
- TypeScript - Type safety
- tRPC - Type-safe API
- Prisma - ORM
- PostgreSQL - Database
- NextAuth.js - Authentication
- Tailwind CSS v4 - Styling
- shadcn/ui - UI components
- Node.js 18+ and pnpm
- PostgreSQL database
- Google Cloud account
- Twitch Developer account
- Go to Google Cloud Console
- Create a new project or select an existing one
- Navigate to APIs & Services > Credentials
- Click Create Credentials > OAuth client ID
- Application type: Web application
- Authorized JavaScript origins:
http://localhost:3000(or your production URL) - Authorized redirect URIs:
http://localhost:3000/api/auth/callback/google(or your production URL +/api/auth/callback/google) - Click Create to get your Client ID and Client Secret
- Go to Twitch Developer Console
- Click Register Your Application
- Fill in the form:
- Name: VOD Creator (or any name you prefer)
- OAuth Redirect URLs:
http://localhost:3000(or your production URL) - Category: Integration
- Click Register to get your Client ID and Client Secret
- Click Manage on your application and ensure it has the correct redirect URL
Create a .env file in the root directory with the following variables:
# Google OAuth
AUTH_GOOGLE_ID="your-google-client-id"
AUTH_GOOGLE_SECRET="your-google-client-secret"
# Twitch API
TWITCH_CLIENT_ID="your-twitch-client-id"
TWITCH_CLIENT_SECRET="your-twitch-client-secret"
# NextAuth
AUTH_SECRET="generate-with: npx auth secret"
# Database
DATABASE_URL="postgresql://postgres:password@localhost:5432/vodcreator"# Start your PostgreSQL database
# Using Docker:
docker run -d --name vodcreator-db -e POSTGRES_PASSWORD=password -e POSTGRES_DB=vodcreator -p 5432:5432 postgres:latest
# Or use your existing database connection stringpnpm installpnpm db:generatepnpm devVisit http://localhost:3000 to start using the app.
- Sign In: Click "Sign in with Google" and authenticate
- Add Channel: Enter a Twitch username and click "Add Channel"
- Refresh VODs: Click the refresh button to fetch the latest VODs from the channel
- Copy Commands: Click the copy buttons to copy commands to your clipboard:
- Video Download: Downloads the VOD video file
- Chat Download: Downloads the chat JSON file
- Chat Render: Renders the chat as a video file
- Load More: Click "Load More" to fetch additional VODs from the database
- Settings: Customize chat dimensions, font, and VODs per load
# Install dependencies
pnpm install
# Start development server
pnpm dev
# Build for production
pnpm build
# Start production server
pnpm start
# Generate Prisma client
pnpm db:generate
# Push schema changes to database (development only)
pnpm db:push
# Run migrations (production)
pnpm db:migrate
# Open Prisma Studio
pnpm db:studio
# Run type checking
pnpm typecheck
# Run ESLint
pnpm lint
# Fix ESLint issues
pnpm lint:fix
# Format code with Prettier
pnpm format:writeSet the following environment variables in your deployment platform:
AUTH_GOOGLE_ID=""
AUTH_GOOGLE_SECRET=""
TWITCH_CLIENT_ID=""
TWITCH_CLIENT_SECRET=""
DATABASE_URL=""
AUTH_SECRET=""Before deploying, update your OAuth redirect URLs:
Google OAuth:
- Add your production URL to authorized JavaScript origins
- Add your production URL +
/api/auth/callback/googleto authorized redirect URIs
Twitch API:
- Update OAuth Redirect URLs to your production URL
- Push your code to GitHub
- Import project to Vercel
- Add environment variables
- Deploy
To learn more about the T3 Stack, check out these resources:
The Twitch API has rate limits (30 requests per minute). If you see rate limit errors, wait a moment before refreshing.
- Ensure your PostgreSQL database is running
- Check that
DATABASE_URLis correct - Verify your database user has the necessary permissions
- Verify your redirect URLs match exactly (including http/https)
- Check that your production URL is added to authorized origins/redirects
- Ensure your auth secret is set (
AUTH_SECRET)
MIT