Getting Started
Prerequisites
- Node.js >= 18
- pnpm >= 9 — install with
npm install -g pnpm
1. Install dependencies
pnpm installThe 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.localEach app reads from the root .env.local during development. For production, each app gets its own environment variables.
Required variables
| Variable | Description | Example |
|---|---|---|
NEXT_PUBLIC_API_BASE_URL | API base URL | https://api.numalogistics.com |
NEXT_PUBLIC_API_HOST | Public API host | https://api.numalogistics.com |
NEXT_PUBLIC_AUTH_COOKIE_DOMAIN | Parent domain for shared auth cookies (omit on localhost) | .dev.numalogistics.com |
NEXT_PUBLIC_GATEWAY_APP_URL | Gateway app URL | http://localhost:3000 |
NEXT_PUBLIC_ENERGY_APP_URL | Energy app URL | http://localhost:3001 |
3. Run all apps
pnpm devThis 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/energyAvailable scripts
| Script | Command | Description |
|---|---|---|
pnpm dev | node scripts/run.mjs dev | Start apps in dev mode |
pnpm build | node scripts/run.mjs build | Build apps |
pnpm lint | turbo run lint | Lint all packages |
pnpm type:check | turbo run type:check | TypeScript type checking |
pnpm format | prettier --write ... | Format all files |
pnpm clean | node scripts/clean.mjs | Remove build artifacts |
pnpm clean:all | node scripts/clean.mjs --all | Remove all artifacts + node_modules |
pnpm validate | typecheck + lint:staged + lint | Full validation pipeline |
pnpm gc | node scripts/gc.mjs | Add shadcn components |
Building for production
# Build all apps
pnpm build
# Build a specific app
pnpm turbo run build --filter=@numa/energyTurborepo 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 --dockerLast updated on