- Runtime: Bun
- Framework: Next.js 15 (App Router)
- Database: PostgreSQL + Drizzle ORM
- Deployment: Vercel Serverless
- UI: React + Tailwind CSS
bun install # Install dependencies
bun run dev # Start dev server
bun run build # Production build
bun run db:migrate # Apply database migrations
bun run db:generate # Generate migration from schema
bun run db:studio # Open Drizzle StudioNever use db:push - it's removed. All schema changes go through migrations.
- Edit schema in
db/schemas/ bun run db:generate- Review SQL in
db/migrations/ bun run db:migrate- Commit both schema + migration
npx drizzle-kit generate --custom --name=descriptive_name- No
CREATE INDEX CONCURRENTLY(runs in transaction) - Use
IF NOT EXISTS/IF EXISTSfor creating tables - Never edit applied migrations
- NEVER use omnibus migrations that recreate the full schema or existing objects - they will fail in production by locking active tables. Instead:
- Create small targeted migrations that ONLY add your new schema objects
- Use separate migrations for data backfills
- Put cleanup/drops in their own migration
- Group related objects together but limit migrations to <100 lines
- See
docs/database-migrations.mdfor details
bun run check-types has many pre-existing errors across the codebase (db/, lib/services/, app/). Don't try to fix them all — only verify your changed files have no new errors. Filter output:
bun run check-types 2>&1 | grep -E "(your-file\.ts|your-other-file\.ts)"If the grep returns empty, your changes are clean. bun run build also fails on unrelated env vars (ELIZA_APP_DISCORD_BOT_TOKEN). Use check-types filtered to your files instead.
app/ # Next.js App Router pages
lib/ # Business logic, services
db/
schemas/ # Drizzle schema definitions
migrations/ # SQL migration files
repositories/# Data access layer
components/ # React components
scripts/ # CLI utilities