Skip to main content

Setup

Prerequisites

  • Node.js 22+ (repo is developed on Node 24; .nvmrc pins 22 for CI/deploy).
  • npm with workspaces (the lockfile is package-lock.json).

Install

npm install

A single root install hoists dependencies for every workspace and the documentation tooling.

Develop

The repo is a monorepo; pick an app:

npm run dev tracking # @enode/tracking → http://localhost:3000
npm run dev portal # @enode/portal → http://localhost:3001
npm run help # list all commands

In dev, next.config.ts proxies /api/* to the backend so the browser sees same-origin requests (no CORS).

Choosing the backend. Which backend the apps talk to is defined in one place, packages/core/src/api/servers.ts, and read by both the dev proxy and the runtime API client — so there is no second place to keep in sync. Switch it with env vars, no code edit:

  • NEXT_PUBLIC_API_SERVER=<name> — pick a named server from API_SERVERS.
  • NEXT_PUBLIC_API_BASE_URL=<url> — point at any host (a local backend, an ngrok tunnel); wins over the named server.
  • Neither set → the default (develop).

Add a new named environment by extending API_SERVERS (and the ApiServerName union) in that file.

Each app opens on a login gate. Authenticate with backend credentials to reach the main feature.

Repo-wide commands

CommandWhat it does
npm run dev <app>Dev server for tracking (:3000) or portal (:3001)
npm run build <app>Production build → static export in the app's out/
npm run run <app>Serve the built out/
npm run lintESLint across all workspaces
npm run testVitest unit tests (@enode/core)
npm run typechecktsc over the whole monorepo

Documentation commands

CommandWhat it does
npm run storybookStorybook dev server (:6006)
npm run docs:buildBuild the full documentation website
npm run docs:serveServe the built docs site (:4000)
npm run docs:checkLint + typecheck + docs build (CI gate)

See Testing for the docs build/check pipeline.