Dirework

Getting Started

Run Dirework on your own computer in a few minutes

This guide gets Dirework running on your own machine so you can try it before you deploy it anywhere. Going to production instead? Jump to Deployment.

No deep tech knowledge needed. You'll copy a few commands, paste two Twitch keys, and you're done. Take it one step at a time — each step says exactly what to do.

What you need first

Install these once. Click each name if you don't have it yet:

That's the whole shopping list. No Docker, no database to install — a local database is created for you automatically.

1. Get the code

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

2. Install

bun install

3. Create your .env file

cp .env.example packages/infra/.env

Open packages/infra/.env and fill in three values:

TWITCH_CLIENT_ID="paste_your_client_id"
TWITCH_CLIENT_SECRET="paste_your_client_secret"
BETTER_AUTH_SECRET="paste_a_generated_secret"

Generate the BETTER_AUTH_SECRET with one command:

openssl rand -base64 32

Don't have the Twitch keys yet? The Twitch OAuth Setup page walks you through getting them — it takes about two minutes. For local use, add both of these redirect URLs to your Twitch app:

http://localhost:3001/api/auth/callback/twitch
http://localhost:3001/api/bot/callback/twitch

Everything else in the .env file already has a sensible default for local use. You don't need to touch it.

4. Start it up

bun run dev

This starts everything at once:

  • The APIhttp://localhost:3000 (works behind the scenes)
  • Your Dirework apphttp://localhost:3001
  • This documentationhttp://localhost:4000
  • A local database — created automatically, with all tables set up for you

✅ You should now see the Dirework welcome screen at localhost:3001.

First start taking a moment? That's the local database being created and the apps compiling. It's much faster after the first run.

5. Claim your instance

The first time you open the app, it sends you to a setup screen. Click Claim with Twitch and sign in. That makes you the owner — one streamer, one instance.

✅ After signing in you land on your dashboard. You're in.

The setup screen only appears once. After you claim the instance, it turns off for good.

Where to go next

Handy commands

You'll mostly use bun run dev. These are here when you need them:

CommandWhat it does
bun run devStart the API, the web app, the docs, and the local database together
bun run dev:webStart just the web app
bun run dev:serverStart just the API
bun run check-typesCheck the code for TypeScript errors
bun run testRun the unit tests
bun run db:generateCreate a new database migration after schema changes
bun run deployDeploy to Cloudflare from your machine (see Deployment)
bun run destroyTear a Cloudflare deployment back down

On this page