Development
Local development workflow, hot reload, and debugging for CodePilot.
This page covers the local development workflow for CodePilot, including how to run services, make changes, and debug issues.
Starting Development
Start All Services
Run all applications with hot reload via Turborepo:
pnpm devThis starts:
- Web on http://localhost:3000
- API on http://localhost:8080
- Worker (background)
- Docs on http://localhost:3001
Running Individual Services
You can run individual services independently:
# API only
pnpm --filter api run dev
# Frontend only
pnpm --filter web run dev
# Worker only
pnpm --filter worker run dev
# Docs only
pnpm --filter docs run devAvailable Commands
# Development
pnpm dev # Start all apps
pnpm build # Build all packages and apps
pnpm lint # Lint all packages
pnpm format # Format with Prettier
pnpm typecheck # TypeScript type checking
# Database
pnpm --filter @repo/db run db:generate # Generate Prisma client
pnpm --filter @repo/db run db:migrate # Create + apply migrations
pnpm --filter @repo/db run db:studio # Open Prisma StudioMaking Schema Changes
When modifying the Prisma schema:
Edit the Schema
Modify packages/database/prisma/schema.prisma.
Create a Migration
pnpm --filter @repo/db run db:migrateThis creates a new migration file and applies it.
Regenerate the Client
pnpm --filter @repo/db run db:generateThe updated Prisma client is now available to all apps.
Code Quality
Before committing, ensure code quality:
# Type checking
pnpm typecheck
# Linting
pnpm lint
# Formatting
pnpm formatDebugging
API Server
The Express API uses Pino for structured logging. Log output is available in the terminal where pnpm dev is running.
Worker
Worker job processing logs are output to stdout. Failed jobs can be inspected in Redis via RedisInsight at http://localhost:8001.
Database
Use Prisma Studio for visual database inspection:
pnpm --filter @repo/db run db:studioThis opens a web UI at http://localhost:5555 for browsing and editing database records.
Environment Configuration
For local development, host-based services use localhost:
DATABASE_URL=postgresql://codepilot:codepilot@localhost:5432/codepilot
REDIS_HOST=localhost
OLLAMA_URL=http://localhost:11434
FRONTEND_URL=http://localhost:3000