Quickstart
LatticeDX (0.4.2) ships two independent local startup workflows: an isolated single-command clean lab (pnpm native:clean) backed by infra/compose/native-rehearsal.yml, and a multi-service development stack (pnpm local:up) combining core.yml and nocobase.yml. All local development listeners bind strictly to 127.0.0.1 so unauthenticated lab services never expose ports on external interfaces.
Workstation Prerequisites
Verify the required Pure-OSI toolchain versions before cloning the repository or installing workspace dependencies:
| Component | Required Version | Verification Command | Role in Workspace |
|---|---|---|---|
| Node.js | >=24 <25 (24.x) | node -v | Runs workspace builds (TypeScript 7.0.2), companion Fastify services, and all 7 NocoBase plugin builds. |
| pnpm | 10.23.0 | pnpm -v | Monorepo package and lockfile manager ("packageManager": "pnpm@10.23.0"). |
| npm CLI | Bundled with Node 24 | npm -v | Restores locked offline dependencies for @latticedx/plugin-enterprise-auth (npm ci --ignore-scripts). |
| Git | 2.30+ | git --version | Exports clean committed source via git archive during pnpm native:clean. |
| tar | GNU or BSD tar | tar --version | Extracts source.tar archives into isolated clean-lab directories. |
| Docker Engine & Compose | Compose v2+ | docker compose version | Runs nocobase/nocobase:2.2.50 alongside pgvector, Valkey, Keycloak, and Apache APISIX. |
On Windows 10/11 (WSL 2 + Docker Desktop), ensure Docker Desktop uses the desktop-linux context (pnpm docker:start invokes scripts/docker-desktop.ps1). If pnpm@10.23.0 is not active, enable it via Corepack:
corepack enable
corepack prepare pnpm@10.23.0 --activatePath 1: Isolated Clean Lab (pnpm native:clean)
The scripts/native-clean-install.mjs runner exports committed HEAD source via git archive, verifies an empty nocobase-db (0 tables in public), boots nocobase/nocobase:2.2.50, builds and enables all 7 @latticedx/* plugins, runs database migrations, and writes a structured execution report to output/native-clean/<id>/report.json.
| Parameter | Type | Default | Description |
|---|---|---|---|
--port | integer (13004..13999) | 13004 | Loopback 127.0.0.1 port mapped to the isolated NocoBase container. |
--blank-slate | boolean flag | false | Sets LATTICE_SKIP_DEMO_SEED=1, asserts 0 seeded demo rows, runs the App Builder + MCP lifecycle check, and tears down on exit. |
--keep | boolean flag | false | Preserves the clean-lab containers and volumes after a --blank-slate verification run. |
git clone https://github.com/CTU-OpenPaw/lattice-dx.git
cd lattice-dx
pnpm install --frozen-lockfile
pnpm native:clean -- --port=13004Execution phases inside nativeCleanInstall:
- Generates a
12-character hex<id>and assigns an isolated Docker Compose project (lattice-native-clean-<id>) after asserting zero pre-existing containers, volumes, or networks for that project name. - Starts
nocobase-db(pgvector/pgvector:0.8.1-pg16) and assertsSELECT count(*) FROM pg_tables WHERE schemaname='public'equals0. - Starts
nocobase(nocobase/nocobase:2.2.50) and pollsGET http://127.0.0.1:<port>/api/app:getLanguntil HTTP200. - Captures a pre-install
pg_dumpbackup, compiles all7plugins, packs offline.tgztarballs inside the container, runsyarn nocobase pm add+yarn nocobase pm enable, and executesyarn nocobase upgrade. - Verifies all
/@latticedx/migrations are recorded inmigrations. Without--blank-slate, the script provisions local UI fixtures and printspageUrlandreportPathto stdout.
Path 2: Full Local Development Stack (pnpm local:up)
When developing against Apache APISIX, Keycloak 26.8.2, ClamAV, @dx/api (Fastify), FIWARE Orion-LD, or n8n, use scripts/start-local.mjs to validate and start core.yml, nocobase.yml, and optional integration.yml / iiot.yml stacks.
cp .env.example .env
pnpm install --frozen-lockfile
pnpm local:upAfter modifying plugin code under plugins/nocobase/*, rebuild and re-register all seven plugins into the running nocobase.yml container with a single command:
pnpm workspace:installThe pnpm workspace:install script writes a pg_dump snapshot to output/backups/ before rebuilding all 7 plugins, recreating the nocobase container, and re-enabling every package through yarn nocobase pm.
Service Readiness & Database Verification
Run pnpm local:doctor (scripts/check-local.mjs) to probe loopback metadata endpoints without writing records or invoking LLM providers:
pnpm local:doctorExpected loopback endpoints for the local development stack:
| Service | Loopback Origin | Readiness Probe | Expected Response |
|---|---|---|---|
| APISIX Gateway & Fastify API | http://127.0.0.1:8080 | GET /ready | {"status":"ready","service":"api"} |
Keycloak OIDC (lattice) | http://127.0.0.1:8081 | GET /realms/lattice/.well-known/openid-configuration | issuer matches http://localhost:8081/realms/lattice |
NocoBase Host (2.2.50) | http://127.0.0.1:13000 | GET /api/app:getLang | Non-empty data.lang string |
FIWARE Orion-LD (1.12.0) | http://127.0.0.1:1026 | GET /version | Contains orionld version field |
Stock n8n (2.48.1) | http://127.0.0.1:5678 | GET /healthz | {"status":"ok"} |
Node-RED (4.0.9) | http://127.0.0.1:1880 | GET / | HTTP status < 500 |
/api/dxosAi:listProfilesSecurity Boundaries & Teardown
Pre-flight Collision Guards
scripts/native-clean-install.mjs aborts if the target Compose project already owns containers, volumes, or networks, and refuses to bootstrap against a non-empty public schema.
Loopback Fixture Credentials
Credentials written to output/native-platform/ui-lab.json or defaulted in .env.example are strictly for 127.0.0.1 development. Never expose local lab ports externally; switch to infra/compose/prod.yml with generated secrets for live environments.
Clean Teardown
Always stop local stacks and clean labs when finished to free host RAM and temporary volumes:
# Stop core + nocobase stacks
docker compose -f infra/compose/core.yml -f infra/compose/nocobase.yml down
# Stop full stack including integration and iiot
docker compose -f infra/compose/core.yml -f infra/compose/nocobase.yml -f infra/compose/integration.yml -f infra/compose/iiot.yml down
# Remove a specific clean-lab project ID from report.json
docker compose -p lattice-native-clean-<id> down -v --remove-orphansRelated
- Installation Profiles — Compare Compose files, the
5production profiles, and CPU/RAM sizing limits. - Configuration — Complete environment variable reference by subsystem.
- Production Deployment — Hardened Caddy TLS, APISIX, Keycloak MFA, and
nocobase_appdatabase setup. - Testing & Verification — Unit, integration, and RLS isolation verification workflows.
