Getting Started

Commands

Reference for all npm scripts

TL;DR: npm run dev to start, npm run db:push for schema changes, npm run db:studio to browse data.

Development

CommandDescription
npm run devStart development server with hot reload
npm run dev:setupFirst-time setup: push schema + seed database
# Start developing
npm run dev

# First time? Run setup first
npm run dev:setup

Build & Production

CommandDescription
npm run buildCreate production build
npm run startStart production server (requires build)
npm run previewBuild and start in one command
# Test production build locally
npm run preview

Database

All database commands use Drizzle Kit.

CommandDescription
npm run db:pushPush schema changes to database (dev)
npm run db:generateGenerate migration files
npm run db:migrateRun migrations (production)
npm run db:studioOpen Drizzle Studio (visual database editor)
npm run db:seedCreate user and organization
npm run db:seed:demoAdd demo data (44 companies, 70+ contacts)
npm run db:resetDrop all tables and re-seed

Drizzle Studio

npm run db:studio

Opens a visual database editor at localhost:4983. It connects to whatever database is in your DATABASE_URL - local PostgreSQL or cloud (Neon, Supabase, etc.). Browse tables, view data, edit records directly. Like pgAdmin or TablePlus, but built into Drizzle.

When to use which

db:push vs db:migrate

  • Use db:push during development - it's faster and doesn't create migration files
  • Use db:generate + db:migrate for production deployments
# Development workflow
npm run db:push

# Production workflow
npm run db:generate
npm run db:migrate

Seeding

# Basic seed (1 user, 1 org, dictionaries)
npm run db:seed

# Demo data (companies, contacts, activities)
npm run db:seed:demo

# Start fresh
npm run db:reset

Requires ALLOW_DB_SEED=true in .env.local. See Environment Variables.


Docker

CommandDescription
npm run docker:upStart all containers
npm run docker:downStop all containers
npm run docker:rebuildRebuild and restart containers
npm run docker:cleanRemove volumes and rebuild (fresh start)
# Start everything
npm run docker:up

# Something broken? Clean slate
npm run docker:clean

See Docker Setup for full guide.


Code Quality

CommandDescription
npm run lintCheck for ESLint errors
npm run lint:fixFix auto-fixable ESLint errors
npm run formatFormat code with Prettier
npm run format:checkCheck formatting without changes
npm run typecheckRun TypeScript type checking
# Before committing
npm run lint:fix && npm run format

# CI checks
npm run lint && npm run format:check && npm run typecheck

Pre-commit hooks run lint-staged automatically via Husky.


Email

CommandDescription
npm run email:devStart React Email preview server
# Preview email templates at localhost:3005
npm run email:dev

Email templates live in src/emails/.

On this page