Skip to content

Dev setup

  • Node.js 24 (matches the version pinned in .github/workflows/release.yml)
  • Docker (used to bring up Postgres 16 + pgvector)
  • git, openssl

The repo does not pin a Node version via .nvmrc or volta. CI containers run node:24, so use 24 locally to stay in sync.

Terminal window
git clone https://github.com/azrtydxb/kryton.git
cd kryton
cp .env.example .env
npm install

Then open .env and set, at minimum:

Terminal window
POSTGRES_URL=postgres://kryton:kryton@localhost:5432/kryton
BETTER_AUTH_SECRET=$(openssl rand -hex 32)

BETTER_AUTH_SECRET is validated at startup and must be at least 32 characters (see packages/server/src/config/env.ts).

The bundled docker-compose.yml runs pgvector/pgvector:pg16 and an init script that enables the vector extension:

Terminal window
docker compose up -d postgres

Postgres listens on localhost:5432 with database kryton, user kryton, password kryton.

Terminal window
npm run db:migrate --workspace=packages/server
Terminal window
npm run dev

This runs the server and client in parallel (see the dev script in package.json):

There is no seed user. Register through the web UI; the server assigns the admin role to the user whose registration brings the user count from 0 to 1 (see packages/server/src/modules/identity/auth-config.ts). Subsequent registrations get the user role.

From package.json:

CommandWhat it does
npm run devServer + client dev servers in parallel
npm run buildProduction build of server then client
npm run typecheckTypeScript check across server + client
npm run lintESLint across server + client
npm run lint:fixESLint with --fix
npm testVitest across server + client
npm run test:serverServer tests only
npm run test:clientClient tests only
npm run build:sharedBuild the packages/ui and packages/sdk workspaces
npm run sync:checkVerifies compose/helm/operator stay in lockstep

npm install runs husky via the prepare script. The .husky/ directory configures:

  • commit-msg — runs npx --no -- commitlint --edit $1
  • pre-commit — runs npx lint-staged (ESLint --fix on staged .ts/.tsx under packages/client and packages/server)