RepoPilot

Development

Run Postgres, Redis, the API, worker, and web app locally. Build with Turbo and Yarn workspaces.

Prerequisites

  • Node.js 20+ and Yarn 1.22
  • PostgreSQL 15 with pgvector (or Docker Compose)
  • Redis 7
  • Git

Quick setup

The setup script installs deps, migrates the DB, starts API + worker, and smoke-tests endpoints:

yarn setup:test

# Or step by step:
docker compose up -d db redis
cp api/.env.example api/.env
cp web/.env.example web/.env.local
yarn install
yarn --cwd api prisma generate
yarn --cwd api prisma migrate deploy
yarn dev

yarn dev runs API (3001) and web (3000) in parallel via Turbo. Start the worker separately for queued indexing:

yarn --cwd api worker

Docker Compose

Full stack including API, web, worker, Postgres (pgvector), and Redis:

docker compose up --build

# Services:
#   web  → http://localhost:3000
#   api  → http://localhost:3001
#   db   → localhost:5432
#   redis → localhost:6379

Build commands

CommandDescription
yarn buildBuild all workspaces (Turbo)
yarn --cwd api buildCompile API TypeScript
yarn --cwd web buildNext.js production build
yarn lintESLint all packages
yarn type-checkTypeScript check all packages
yarn testUnit tests (api + web + common)
yarn test:coverageUnit tests with coverage thresholds
yarn test:e2ePlaywright UI route coverage (demo mode)
yarn cilint + type-check + build + coverage + e2e

Full local setup notes: see docs/SETUP.md in the repo. Deploy guide: docs/FREE_DEPLOY.md. AI keys: docs/AI_PROVIDERS.md.

Environment variables

API (api/.env)

VariablePurpose
DATABASE_URLPostgreSQL connection string
REDIS_HOST / REDIS_PORTJob queue (or REDIS_URL for Upstash)
PORTAPI listen port (default 3001)
CORS_ORIGINSAllowed web app origins
LLM_PROVIDER + API keysGroq, Gemini, OpenAI, or Ollama for Ask
EMBEDDING_PROVIDERopenai | ollama | local (default local-hash)
GITHUB_TOKENHigher rate limits for public repo metadata
INDEX_INLINERun index jobs in API process (local dev)
SYNC_CONCURRENCYParallel file parse workers
HISTORY_MAX_COMMITSCap git history ingest (default 300)
PRISMA_TX_TIMEOUT_MSInteractive transaction timeout for bulk inserts

Web (web/.env.local)

VariablePurpose
NEXT_PUBLIC_API_URLFastify API base URL
NEXT_PUBLIC_APP_URLPublic app origin (canonical URLs, OAuth callback)
NEXT_PUBLIC_MARKETING_URLSeparate marketing site URL
NEXT_PUBLIC_DEMO_MODEShow seeded dashboard without indexing
GITHUB_CLIENT_ID / SECRETOAuth for private repos
SESSION_SECRETCookie signing key
INTERNAL_API_SECRETShared secret with API BFF routes

Indexing scripts

# Index a repo by GitHub slug (uses api/.env)
./scripts/index-repo.sh owner/repo [local-path]

# Pre-index example repos for browse page
./scripts/preindex-examples.sh

Health check

curl http://localhost:3001/health