Dirework

Getting Started

How to self-host Dirework

Prerequisites

1. Clone the repository

git clone https://github.com/mrdemonwolf/dirework.git
cd dirework

2. Install dependencies

pnpm install

3. 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 32

See Environment Variables for a full reference.

4. Start the database

pnpm db:start

This starts a PostgreSQL container via Docker Compose.

5. Push the database schema

pnpm db:push

6. Start the development server

pnpm dev

This starts all apps via Turborepo:

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

On this page