Local development
Prerequisites
Section titled “Prerequisites”- Node.js ≥ 24 (see
.node-version) - pnpm ≥ 10 (
npm install -g pnpm) - OrbStack or Docker Desktop for the Postgres container
First-time setup
Section titled “First-time setup”pnpm installdocker compose up -dCopy the environment files:
cp apps/api/.env.example apps/api/.envcp apps/web/.env.example apps/web/.envEdit apps/api/.env — at minimum set BETTER_AUTH_SECRET to any random string (e.g. openssl rand -base64 32).
Run migrations:
pnpm --filter @inntrig/db db:migrateRunning locally
Section titled “Running locally”pnpm --filter @inntrig/api dev # API on :3001pnpm --filter @inntrig/web dev # Web on :5173Or both together via Turborepo (streams output):
pnpm devEnvironment variables
Section titled “Environment variables”apps/api/.env
Section titled “apps/api/.env”| Variable | Default | Description |
|---|---|---|
DATABASE_URL | postgres://inntrig:inntrig@localhost:5432/inntrig | Postgres connection string |
PORT | 3001 | API port |
BETTER_AUTH_SECRET | — | Required. Secret key for Better Auth session signing |
BETTER_AUTH_URL | http://localhost:3001 | Full URL of the API (used by Better Auth) |
BETTER_AUTH_TRUSTED_ORIGINS | http://localhost:5173 | Comma-separated list of trusted origins for CSRF |
apps/web/.env
Section titled “apps/web/.env”| Variable | Default | Description |
|---|---|---|
API_URL | http://localhost:3001 | API base URL (server-side only) |
Database
Section titled “Database”Postgres runs via Docker Compose with these defaults:
| Setting | Value |
|---|---|
| Host | localhost:5432 |
| Database | inntrig |
| User | inntrig |
| Password | inntrig |
Useful commands:
pnpm --filter @inntrig/db db:generate # generate migrations from schema changespnpm --filter @inntrig/db db:migrate # apply pending migrationspnpm --filter @inntrig/db db:studio # open Drizzle Studio in browserTesting
Section titled “Testing”pnpm test # Vitest (all packages)pnpm --filter @inntrig/web test:e2e # Playwright e2e (requires both servers running)