Skip to content

Installation

This page covers the toolchain and prerequisites needed to work on dichit-backend. For the day-to-day run loop, see local-development.md.

Prerequisites

Tool Version Why
Node.js 24+ (see .nvmrc) Runtime. The build tooling targets Node 24+ ESM.
pnpm 9+ Package manager. preinstall enforces pnpm via only-allow.
Docker latest PostgreSQL and Redis containers for local dev/tests.
PostgreSQL 16 (via Docker) Primary datastore. Local images use postgres:16-alpine.
Redis latest (via Docker) Caching, BullMQ, WebSocket pub/sub.
git 2.x Version control.
AWS CLI / creds optional Only needed for S3 / production work.
  • Use the Node version pinned in .nvmrc.
  • volta or nvm can manage the Node version for you.

Install dependencies

# Node version from .nvmrc
nvm use                        # or: volta install node

# pnpm is the only package manager allowed
corepack enable
corepack prepare pnpm@latest --activate

# install
pnpm install

pnpm install runs a preinstall step (only-allow pnpm) — plain npm install will fail by design.

Pre-commit tooling

The repo ships husky hooks and lint-staged:

pnpm prepare          # installs husky hooks

Hooks run prettier --write and eslint --fix on staged files. Commit messages are validated by commitlint using Conventional Commits (see development/git-workflow.md).

Environment files

Copy/extend the relevant environment file. The loader picks the file from NODE_ENV (see environment-variables.md):

.env.local   # default local
.env.dev
.env.test
.env.staging
.env.prod    # not committed

At minimum, DATABASE_URL, REDIS_HOST, REDIS_PORT, and the JWT/encryption secrets must be present. docker:local:up only provides PostgreSQL + Redis — the app reads credentials from env.

Verify the toolchain

pnpm check          # typecheck + lint
pnpm docker:test:up # start test PG + Redis
pnpm test           # unit + functional
pnpm docker:test:down

If everything above passes, the toolchain is ready. Continue to local-development.md.