Development
Local development guide for Danvas
Local Development
Start all apps
bun run dev # All apps except docs (Turborepo parallel)
bun run dev:all # All apps including docsStart a single app
bun dev --filter
Local development guide for Danvas
bun run dev # All apps except docs (Turborepo parallel)
bun run dev:all # All apps including docsbun dev --filter
| App | Port | Purpose |
|---|---|---|
| app | 4000 | Main authenticated app |
| web | 4001 | Marketing / public site |
| api | 4002 | API server (webhooks, cron) |
| docs | 4004 | Documentation site |
| storybook | 6006 | Component library |
| 4003 | React Email preview | |
| studio | 3005 | Drizzle Studio (database browser) |
After editing packages/database/src/schema/ (any of the 9 domain modules):
bun db:push # Push changes to Neon (development)
bun db:generate # Generate migration files (production)bun db:seed # Seed 5 locations
bun db:seed-forms # Seed Opening Checklist + Daily Standup forms + sample submissions
bun db:seed-q12 # Seed Q12 Gallup Survey
bun db:seed-survey # Seed Customer Feedback + NPS surveys
bun db:seed-coupons # Seed coupon theme data + sample coupon
bun db:seed-slack-routes # Seed Slack channel routing (requires SLACK_BOT_TOKEN + CSV in tmp/)cd packages/database && bun drizzle-studioOpens a visual database editor at localhost:4983.
bun run check # Lint + type-check (Biome via ultracite)
bun run fix # Auto-fix lint issuesbun run test # Run all tests across monorepoRun a single test file:
cd apps/app && bun run test -- --reporter=verbose path/to/test.test.tsbun run build # Build all apps
bun run analyze # Bundle analysisEach app and package has its own .env.local (or .env for packages/database). Run bun setup to create them from .env.example files.
Required variables across the monorepo:
| Variable | Where | Purpose |
|---|---|---|
DATABASE_URL | packages/database/.env, apps/app/.env.local, apps/api/.env.local | Neon PostgreSQL connection |
CLERK_SECRET_KEY | apps/app/.env.local, apps/api/.env.local | Clerk server-side auth |
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY | apps/app/.env.local | Clerk client-side auth |
OPENROUTER_API_KEY | apps/app/.env.local | AI API access |
CANVAS_TEAM_ID | apps/app/.env.local, apps/api/.env.local, packages/database/.env | Default org ID |
BLOB_READ_WRITE_TOKEN | apps/app/.env.local | Vercel Blob storage |
CRON_SECRET | apps/api/.env.local | Vercel Cron auth |
app, web, api) as separate Vercel projectsBefore production deploy:
bun db:generate # Generate migration files
# Apply migrations via Neon Console or CI/CDRun bun setup and fill in all required variables. See Quickstart for the full list.
DATABASE_URL uses the pooled connection stringOPENROUTER_API_KEY is set and has creditsbun run clean # Remove all node_modules and build artifacts
bun install
bun run build