CodePilot
Deployment

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 Infrastructure

Start PostgreSQL and Redis:

docker compose up -d

Start All Services

Run all applications with hot reload via Turborepo:

pnpm dev

This starts:

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 dev

Available 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 Studio

Making 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:migrate

This creates a new migration file and applies it.

Regenerate the Client

pnpm --filter @repo/db run db:generate

The 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 format

Debugging

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:studio

This opens a web UI at http://localhost:5555 for browsing and editing database records.

Environment Configuration

For local development, host-based services use localhost:

.env.api
DATABASE_URL=postgresql://codepilot:codepilot@localhost:5432/codepilot
REDIS_HOST=localhost
OLLAMA_URL=http://localhost:11434
FRONTEND_URL=http://localhost:3000

On this page