Prerequisites
- Node.js
>=22.22.0and<23(rootpackage.jsonengines.node) - npm
>=10(rootengines.npm; the repo pinspackageManagernpm@10.9.4) - Docker and Docker Compose, used for local Postgres (
docker-compose.yml) and integration-test Postgres (docker-compose.test.yml) - Git
1. Clone and Install
apps/site, apps/web, apps/worker, packages/*). Install from the repository root.
2. Infrastructure (Database)
Local npm development talks to Postgres onlocalhost:5432. In the default docker-compose.yml that service is named db (image pgvector/pgvector:pg16), not postgres.
npm run dev: it also starts a web container on port 3000 and a second worker. docker-compose.selfhost.yml is the packaged self-host stack (postgres + web + worker), not the contributor npm run dev path. docker-compose.test.yml is only for integration tests (host port 5433).
The default compose file also defines a redis service. Local .env.example does not set REDIS_URL; npm dev does not start Redis.
3. Environment Variables
Copy the public template. PointDATABASE_URL at local Postgres (the example already uses localhost).
.env.example includes ADMIN_EMAIL / ADMIN_PASSWORD for the bootstrap admin, SESSION_COOKIE_SECRET, and optional MODEL_PROVIDER / MODEL_API_KEY for hosted models. If you plan to test AI completions locally, set a valid MODEL_API_KEY and matching MODEL_PROVIDER. Never commit .env files.
4. Prisma Setup
Before you start the Next.js server, generate the Prisma Client and apply pending migrations. Use migrate deploy locally; do not useprisma db push or npm run prisma:push.
CORGTEX_AUTO_SEED_JNJ_DEMO=true so each deploy refreshes the demo after migrations and the base seed.
5. Run the Application
Rootnpm run dev starts both processes with concurrently:
npm run dev:web→@corgtex/web(next devwith../../.env), typically http://localhost:3000npm run dev:worker→@corgtex/worker(tsx watchwith the same.env)
ADMIN_EMAIL and ADMIN_PASSWORD from .env. The marketing app (npm run dev:site, Next.js on port 3008 in apps/site) is not started by npm run dev.