Dev setup
Prerequisites
Section titled “Prerequisites”- 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.
Clone and install
Section titled “Clone and install”git clone https://github.com/azrtydxb/kryton.gitcd krytoncp .env.example .envnpm installThen open .env and set, at minimum:
POSTGRES_URL=postgres://kryton:kryton@localhost:5432/krytonBETTER_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).
Start Postgres
Section titled “Start Postgres”The bundled docker-compose.yml runs pgvector/pgvector:pg16 and an init script that enables the vector extension:
docker compose up -d postgresPostgres listens on localhost:5432 with database kryton, user kryton, password kryton.
Run migrations
Section titled “Run migrations”npm run db:migrate --workspace=packages/serverStart the dev servers
Section titled “Start the dev servers”npm run devThis runs the server and client in parallel (see the dev script in package.json):
- Client (Vite): http://localhost:5173
- Server (Fastify): http://localhost:3001
- OpenAPI UI: http://localhost:3001/docs (
OPENAPI_ENABLEDdefaults totrue)
First user
Section titled “First user”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.
Useful scripts
Section titled “Useful scripts”From package.json:
| Command | What it does |
|---|---|
npm run dev | Server + client dev servers in parallel |
npm run build | Production build of server then client |
npm run typecheck | TypeScript check across server + client |
npm run lint | ESLint across server + client |
npm run lint:fix | ESLint with --fix |
npm test | Vitest across server + client |
npm run test:server | Server tests only |
npm run test:client | Client tests only |
npm run build:shared | Build the packages/ui and packages/sdk workspaces |
npm run sync:check | Verifies compose/helm/operator stay in lockstep |
Git hooks
Section titled “Git hooks”npm install runs husky via the prepare script. The .husky/ directory configures:
commit-msg— runsnpx --no -- commitlint --edit $1pre-commit— runsnpx lint-staged(ESLint--fixon staged.ts/.tsxunderpackages/clientandpackages/server)