FangDash
Getting Started

Developer Setup

Set up FangDash for local development.

This guide is for developers who want to run FangDash locally or contribute to the project.

Prerequisites

  • Node.js 20 or higher
  • pnpm 10.x (run corepack enable to install)
  • A Cloudflare account (for D1 database)
  • A Twitch Developer application (for OAuth)

Clone and Install

git clone https://github.com/MrDemonWolf/fangdash.git
cd fangdash
pnpm install

Set Up the Database

Create a Cloudflare D1 database:

npx wrangler d1 create fangdash-db

Copy the database ID from the output and update apps/api/wrangler.toml.

Run migrations:

npx wrangler d1 migrations apply fangdash-db --local

Configure Environment Variables

Copy the example files (run from the repo root):

cp apps/api/.dev.vars.example apps/api/.dev.vars
cp apps/web/.env.local.example apps/web/.env.local

Fill in apps/api/.dev.vars:

BETTER_AUTH_SECRET=your-secret-here
BETTER_AUTH_URL=http://localhost:8787
TWITCH_CLIENT_ID=your-twitch-client-id
TWITCH_CLIENT_SECRET=your-twitch-client-secret

Fill in apps/web/.env.local:

NEXT_PUBLIC_API_URL=http://localhost:8787

Start Development

pnpm dev

The web app runs at http://localhost:3000 and the API at http://localhost:8787.

Available Scripts

CommandDescription
pnpm devStart all apps in development mode
pnpm buildBuild all packages and apps
pnpm testRun all tests with Vitest
pnpm test:coverageRun tests with coverage report
pnpm type-checkType-check all packages
pnpm lintLint all packages
pnpm cleanRemove all build artifacts