Getting Started
How to self-host Dirework
Prerequisites
- Node.js v20+
- pnpm v10+
- Docker (for PostgreSQL)
- A Twitch Developer Application
1. Clone the repository
git clone https://github.com/mrdemonwolf/dirework.git
cd dirework2. Install dependencies
pnpm install3. Configure environment variables
Create a .env file in apps/web/:
# Database
DATABASE_URL="postgresql://postgres:password@localhost:5432/dirework"
# Better Auth
BETTER_AUTH_SECRET="<generate-a-random-32-char-string>"
BETTER_AUTH_URL="http://localhost:3001"
CORS_ORIGIN="http://localhost:3001"
# Twitch OAuth (from dev.twitch.tv)
TWITCH_CLIENT_ID="<your_client_id>"
TWITCH_CLIENT_SECRET="<your_client_secret>"
# User allowlist (comma-separated Twitch user IDs, empty = allow all)
ALLOWED_TWITCH_IDS=""You can generate a secret with:
openssl rand -base64 32See Environment Variables for a full reference.
4. Start the database
pnpm db:startThis starts a PostgreSQL container via Docker Compose.
5. Push the database schema
pnpm db:push6. Start the development server
pnpm devThis starts all apps via Turborepo:
- Web app: http://localhost:3001
- Documentation: http://localhost:4000
7. Sign in
Open the web app and click Sign in with Twitch. You'll be redirected to Twitch to authorize the application. Make sure you've set up your Twitch OAuth application first.
Next steps
- Set up Twitch OAuth if you haven't already
- Add overlays to OBS
- Learn the chat commands
- Deploy to production