Skip to Content
Getting Started

Getting Started

Prerequisites

  • Node.js >= 18
  • pnpm >= 9 — install with npm install -g pnpm

1. Install dependencies

pnpm install

The root package.json enforces pnpm via a preinstall check — running npm install or yarn install will fail with an error.

2. Set up environment variables

cp .env.example .env.local

Each app reads from the root .env.local during development. For production, each app gets its own environment variables.

Required variables

VariableDescriptionExample
NEXT_PUBLIC_API_BASE_URLAPI base URLhttps://api.numalogistics.com
NEXT_PUBLIC_API_HOSTPublic API hosthttps://api.numalogistics.com
NEXT_PUBLIC_AUTH_COOKIE_DOMAINParent domain for shared auth cookies (omit on localhost).dev.numalogistics.com
NEXT_PUBLIC_GATEWAY_APP_URLGateway app URLhttp://localhost:3000
NEXT_PUBLIC_ENERGY_APP_URLEnergy app URLhttp://localhost:3001

3. Run all apps

pnpm dev

This starts all apps in parallel using Turborepo. Each app runs on its assigned port.

4. Run a single app

# Using Turborepo filter pnpm turbo run dev --filter=@numa/energy

Available scripts

ScriptCommandDescription
pnpm devnode scripts/run.mjs devStart apps in dev mode
pnpm buildnode scripts/run.mjs buildBuild apps
pnpm lintturbo run lintLint all packages
pnpm type:checkturbo run type:checkTypeScript type checking
pnpm formatprettier --write ...Format all files
pnpm cleannode scripts/clean.mjsRemove build artifacts
pnpm clean:allnode scripts/clean.mjs --allRemove all artifacts + node_modules
pnpm validatetypecheck + lint:staged + lintFull validation pipeline
pnpm gcnode scripts/gc.mjsAdd shadcn components

Building for production

# Build all apps pnpm build # Build a specific app pnpm turbo run build --filter=@numa/energy

Turborepo caches build outputs. Unchanged apps skip rebuilding.

Deployment

Each app builds independently with output: "standalone":

# The standalone output is at: # apps/energy/.next/standalone/

For Docker deployments, use turbo prune for a minimal image:

turbo prune @numa/energy --docker
Last updated on