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 enableto 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 installSet Up the Database
Create a Cloudflare D1 database:
npx wrangler d1 create fangdash-dbCopy the database ID from the output and update apps/api/wrangler.toml.
Run migrations:
npx wrangler d1 migrations apply fangdash-db --localConfigure 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.localFill 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-secretFill in apps/web/.env.local:
NEXT_PUBLIC_API_URL=http://localhost:8787Start Development
pnpm devThe web app runs at http://localhost:3000 and the API at http://localhost:8787.
Available Scripts
| Command | Description |
|---|---|
pnpm dev | Start all apps in development mode |
pnpm build | Build all packages and apps |
pnpm test | Run all tests with Vitest |
pnpm test:coverage | Run tests with coverage report |
pnpm type-check | Type-check all packages |
pnpm lint | Lint all packages |
pnpm clean | Remove all build artifacts |