Skip to content

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:

ComponentRequired VersionVerification CommandRole in Workspace
Node.js>=24 <25 (24.x)node -vRuns workspace builds (TypeScript 7.0.2), companion Fastify services, and all 7 NocoBase plugin builds.
pnpm10.23.0pnpm -vMonorepo package and lockfile manager ("packageManager": "pnpm@10.23.0").
npm CLIBundled with Node 24npm -vRestores locked offline dependencies for @latticedx/plugin-enterprise-auth (npm ci --ignore-scripts).
Git2.30+git --versionExports clean committed source via git archive during pnpm native:clean.
tarGNU or BSD tartar --versionExtracts source.tar archives into isolated clean-lab directories.
Docker Engine & ComposeCompose v2+docker compose versionRuns 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:

sh
corepack enable
corepack prepare pnpm@10.23.0 --activate

Path 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.

pnpm native:clean CLI Flags
ParameterTypeDefaultDescription
--port
integer (13004..13999)13004Loopback 127.0.0.1 port mapped to the isolated NocoBase container.
--blank-slate
boolean flagfalseSets LATTICE_SKIP_DEMO_SEED=1, asserts 0 seeded demo rows, runs the App Builder + MCP lifecycle check, and tears down on exit.
--keep
boolean flagfalsePreserves the clean-lab containers and volumes after a --blank-slate verification run.
bash
git clone https://github.com/CTU-OpenPaw/lattice-dx.git
cd lattice-dx
pnpm install --frozen-lockfile
pnpm native:clean -- --port=13004

Execution phases inside nativeCleanInstall:

  1. 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.
  2. Starts nocobase-db (pgvector/pgvector:0.8.1-pg16) and asserts SELECT count(*) FROM pg_tables WHERE schemaname='public' equals 0.
  3. Starts nocobase (nocobase/nocobase:2.2.50) and polls GET http://127.0.0.1:<port>/api/app:getLang until HTTP 200.
  4. Captures a pre-install pg_dump backup, compiles all 7 plugins, packs offline .tgz tarballs inside the container, runs yarn nocobase pm add + yarn nocobase pm enable, and executes yarn nocobase upgrade.
  5. Verifies all /@latticedx/ migrations are recorded in migrations. Without --blank-slate, the script provisions local UI fixtures and prints pageUrl and reportPath to 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.

bash
cp .env.example .env
pnpm install --frozen-lockfile
pnpm local:up

After modifying plugin code under plugins/nocobase/*, rebuild and re-register all seven plugins into the running nocobase.yml container with a single command:

sh
pnpm workspace:install

The 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:

bash
pnpm local:doctor

Expected loopback endpoints for the local development stack:

ServiceLoopback OriginReadiness ProbeExpected Response
APISIX Gateway & Fastify APIhttp://127.0.0.1:8080GET /ready{"status":"ready","service":"api"}
Keycloak OIDC (lattice)http://127.0.0.1:8081GET /realms/lattice/.well-known/openid-configurationissuer matches http://localhost:8081/realms/lattice
NocoBase Host (2.2.50)http://127.0.0.1:13000GET /api/app:getLangNon-empty data.lang string
FIWARE Orion-LD (1.12.0)http://127.0.0.1:1026GET /versionContains orionld version field
Stock n8n (2.48.1)http://127.0.0.1:5678GET /healthz{"status":"ok"}
Node-RED (4.0.9)http://127.0.0.1:1880GET /HTTP status < 500
GET/api/dxosAi:listProfiles
Bearer JWT (root | ldx_admin)
Confirms all 7 Agent Profiles (including dxos-architect) are bootstrapped and synced.

Security 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:

sh
# 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-orphans

Apache-2.0 · LatticeDX v0.4.2 · Powered by NocoBase · v2.2.50 · Apache-2.0 (Clause 5.2)