Development Environment Setup
CONTRIBUTING.md has the six-command version. This page is for when one of those commands doesn't do what it says.
Every step on this page runs in CI on Linux, macOS and Windows (WSL 2). The check is scripts/verify-dev-setup.sh, run by the Dev setup guide workflow. It runs whenever something the page depends on changes, and once a week.
Linux uses Docker for Postgres. macOS and WSL use their own Postgres, as in Using your own Postgres, because the hosted runners have no Docker. Docker Desktop itself isn't exercised on those two.
Prerequisites
| version | why that one | |
|---|---|---|
| Node.js | 24 | The version CI (.github/workflows/ci.yml) and the Docker image use. The setup check accepts 22 and later, but 22 is not tested |
| npm | 10+ | ships with Node 24 |
| Docker + Compose | any current | only used for Postgres; not needed if you use your own |
| Git | any current | |
| Java 17 + | only if you touch packages/idenplane-java — Maven comes from the wrapper |
You do not need Maven installed. packages/idenplane-java/mvnw downloads a pinned version on first use.
macOS / Linux / Windows
The commands below are identical on all three — with one condition on Windows.
The repo has shell scripts (seed.sh, mvnw, docker-entrypoint.sh) and .gitattributes forcing LF on them. Under native Windows git they still check out fine, but running them needs a POSIX shell.
Clone inside the WSL filesystem (~/code/idenplane), not under /mnt/c/. Node's file watching across the Windows/Linux boundary is slow enough to make start:dev feel broken.
The three things you can run
They're independent. Most changes need only one.
Each one installs with npm ci, not npm install: it installs exactly the versions in package-lock.json and stops if package.json disagrees with the lockfile, so you build what CI builds. Reach for npm install <package> only when you mean to change a dependency.
Backend (NestJS, port 3000)
npm ci
node scripts/setup-env.cjs # writes .env — see below
docker compose up -d db # Postgres on 127.0.0.1:5432
npm run db:setup # migrate + seed
npm run start:dev
db:setup is prisma migrate dev && ts-node prisma/seed.ts. To run them separately use npm run prisma:migrate and npm run prisma:seed.
Admin console (React + Vite)
cd admin-ui
npm ci
npm run dev
It proxies to the backend on 3000, so run that first, or you'll get a console full of network errors and a login page that never accepts anything.
Docs site (Docusaurus)
cd docs
npm ci
npm start
Independent of everything else — no backend, no database. Docusaurus also wants port 3000, so if the backend is running it asks whether to use another port. Answer yes, or start it with npm start -- --port 3001.
Using your own Postgres
Docker is only there to provide Postgres 16. Any local Postgres works, for example Homebrew on macOS or apt install postgresql in WSL. Create the role and database that .env.example points at:
CREATE ROLE idenplane LOGIN PASSWORD 'idenplane' CREATEDB;
CREATE DATABASE idenplane OWNER idenplane;
CREATEDB is required: prisma migrate dev, the first half of db:setup, creates a temporary shadow database to check the migrations. Without it, db:setup fails with a permission error before running anything.
Then skip docker compose up -d db and continue with npm run db:setup. Use another role, password or port if you like; just change DATABASE_URL in .env to match.
What goes in .env
node scripts/setup-env.cjs writes .env with unique random values for POSTGRES_PASSWORD, ADMIN_PASSWORD, ADMIN_API_KEY, WEBHOOK_SECRET_KEY and WEBHOOK_ENCRYPTION_SALT, and a DATABASE_URL that uses the same database password. docker compose up -d db creates the database with that password, so nothing needs editing. Sign in to the console as admin with the ADMIN_PASSWORD from .env.
The helper never overwrites an existing .env. Keep it: the webhook keys encrypt stored secrets, and changing POSTGRES_PASSWORD later does not change the password inside an existing database volume. To start over, run docker compose down -v and delete .env first.
With your own Postgres, change DATABASE_URL in .env to that server's role and password, for example postgresql://idenplane:idenplane@localhost:5432/idenplane for the role created above.
Keep .env in place before running docker compose: the compose file also defines the app service, and Compose refuses to start anything, even db alone, while a required value is missing.
.env.example lists every other setting with its default, if you want to change more.
ADMIN_API_KEY is refused at startup in production if it's a known placeholder or under 32 characters (src/main.ts). In development it only warns. The helper writes a 64-character random key, the same value you paste into API calls.
Running the tests
npm test # backend unit — no database needed
npm run test:e2e # backend e2e — needs Postgres running
cd admin-ui && npm test # console, vitest + MSW, fully mocked
cd packages/idenplane-java && ./mvnw verify # Java SDK
Only test:e2e needs the database up. The rest are self-contained.
Failures people actually hit
Can't reach database server at localhost:5432
Postgres isn't up, or it's up in another container from another project holding the port. docker compose ps to check, docker compose up -d db to start it.
client password must be a string or DatabaseDoesNotExist while seeding
The seed ran without DATABASE_URL. Checkouts before November 2026 had this bug: the seed didn't read .env, so db:setup migrated fine and then failed. Update your checkout, or run export $(grep ^DATABASE_URL .env) first.
permission denied to create database during db:setup
Your own Postgres role is missing CREATEDB, which the shadow database needs. See Using your own Postgres.
Unique constraint failed when seeding
The seed is not idempotent. Either you've already seeded, or a previous run half-completed. npx prisma migrate reset drops, re-migrates and re-seeds in one step.
@prisma/client did not initialize yet
The generated client is missing — it isn't committed, and it isn't regenerated automatically after a schema change. npm run prisma:generate. This is also what Property 'x' does not exist on type 'PrismaService' means after you edit schema.prisma.
Admin console loads but every request fails The backend isn't running on 3000. Vite serves the console fine on its own; nothing about the page tells you the API is absent.
bad interpreter: /bin/sh^M
A shell script checked out with CRLF. .gitattributes prevents this for tracked scripts — if you see it, you're on a checkout older than that file, or an editor rewrote the line endings. git checkout -- <file> restores it.
Java build can't find Maven
It shouldn't need to. Run ./mvnw from packages/idenplane-java, not mvn.
Where things live
src/ NestJS backend, ~70 self-contained modules
admin-ui/ React admin console
docs/ this site
packages/idenplane-*/ published SDKs (JS, Go, Java, MCP, CLI)
examples/ runnable quickstarts
prisma/schema.prisma the single source of truth for the data model
See Architecture for how the backend modules relate, and Coding Standards for what a change is expected to look like.
Still stuck
Open a discussion — and if the fix belongs on this page, say so, because it means someone else will hit it too.