Skip to content

Platform Architecture Overview (v0.4.2) ​

LatticeDX v0.4.2 organizes enterprise operations into a 4-tier platform architecture (Tier 3 Pluggable Business Applications -> Tier 2 User & Configuration Experience -> Tier 1 Headless Runtime & Shared Services -> Service-owned Data) paired with five canonical interaction patterns and five isolated container network zones. This separation isolates pluggable domain apps, role-scoped workspaces, the external nocobase/nocobase:2.2.50 host with 7 Apache-2.0 plugins, IT/OT digital-twin pipelines, governed AI agents, and PostgreSQL 16 storage protected by FORCE ROW LEVEL SECURITY.

LatticeDX v0.4.2 Platform Architecture — 4 tiers, 5 interaction patterns, and cross-cutting operations

LatticeDX v0.4.2 Platform Architecture: four architectural tiers (Tier 3 Pluggable Business Applications, Tier 2 User & Configuration Experience, Tier 1 Headless Runtime & Shared Services across 5 horizontal bands, Service-owned Data), 5 Platform Interaction Patterns, and Cross-cutting Operations.
LatticeDX v0.4.2 Platform Architecture & 5 Interaction Patterns
TIER 3 · PLUGGABLE BUSINESS APPLICATIONSTIER 2 · USER & CONFIGURATION EXPERIENCETIER 1 · HEADLESS RUNTIME & SHARED SERVICESSERVICE-OWNED DATA STORES · PG16 FORCE RLS · RUSTFS · ORION-LD · MERKLE LEDGERPortalsModulesAI AppsHTTPSStudio APIAgents / MCPOIDC / ProxyPlugins / Eventsnocobase_appS3 / ValkeyOrion-LDEd25519Cold-Chain WMS & IIoT TwinFEFO · Arrhenius MKT · WebGIS · ePODCMMS, Claims & AI-Built AppsProcurement · ITSM · latticeCustom*Role Workspaces & PWA/p/* Portals · /v/mobile · /v/formControl Studio & WebGIS12 Native BlockModels · DMN · Flow v2AI Studio & HITL Queues7 Agent Profiles · App Builder 2.0Zero-Trust Edge & IdPCaddy 2.10 · APISIX 3.19Keycloak 26.8NocoBase 2.2.50 + 7 PluginsFastify 5 /v1/*AsyncLocalStorage RLSOrchestration, IIoT & AILatticeFlow · DMN · Orion-LD20 Audited AI ToolsPostgreSQL 16 (nocobase_app)56 Static + latticeCustom*FORCE RLS · pgvectorRustFS S3 · Orion-LD · Valkey 8.1Scanned Objects · NGSI-LDValkey DB 0 / 1 / 2Ed25519 Merkle & PITR WALlatticeCryptoLedgerGzip WAL Archive
InspectorNocoBase 2.2.50 + 7 PluginsClick any component to inspect bindings & boundaries
Role
Tier 1 — NocoBase 2.2.50 (:ro 7 Plugins) & Single RLS Write Gate
Package / Port
nocobase/nocobase:2.2.50 · 7 @latticedx/* · Fastify 5
Protocol
HTTP · pg-rls.js (AsyncLocalStorage) · OpenAPI 3.1
Payload / Schema
nocobase_app (NOBYPASSRLS) -> app.current_org
Responsibilities
Routes all business APIs and database writes through the AsyncLocalStorage transaction bridge under nocobase_app with FORCE RLS.
Select any tier component or interaction pattern (1–5) to inspect Tier 3 -> Tier 2 -> Tier 1 -> Service-owned Data boundaries and the PG16 FORCE RLS write gate.

The 4-Tier Stack & Shared Services ​

Each tier owns a distinct operational boundary. Every domain mutation enters through governed Tier 1 API contracts and FORCE RLS policies rather than bypassing directly into internal database tables.

Tier / BandArchitectural ScopeCore Services & ModulesPrimary Routes & Endpoints
Tier 3 · Pluggable Business ApplicationsDomain & AI-built solutionsCold-Chain Logistics & WMS (dxosWms: orders, FEFO lots, Arrhenius MKT & ePOD), IIoT Incidents & Digital Twin (telemetry, WebGIS & 2-way control), CMMS & Partner Claims (maintenance, SLA & claims), Procurement, ITSM & AI-Built Apps (latticeCustom*)/p/logistics, /p/incidents, /p/cmms, /p/partner-claims, /p/procurement, /p/services, /v/track/:code
Tier 2 · User & Configuration ExperienceViews sharing one frontendRole Workspaces (/p/*, Mobile Field PWA /v/mobile with IndexedDB outbox + quarantined, zero-PII Public /v/form/:slug), NocoBase & Control Studio, Data, BI & WebGIS Views (12 Native v2 BlockModels including maplibre-gl, BI, WMS Ops), AI Studio & HITL Views/p/<slug>, /v/mobile, /v/form/:slug, /admin/settings/dxos-studio, /admin/settings/dxos-ai
Tier 1 · Access & IdentitySecure access & Zero-Trust edgeKeycloak 26.8.2 (OIDC + PKCE S256), Caddy 2.10 & Apache APISIX 3.19.0 Gateway (TLS 1.3, HSTS, -Server, X-Request-Id, Valkey limit-count), @latticedx/plugin-enterprise-auth/enterprise-login, /api/enterpriseAuth:*
Tier 1 · Application RuntimeApplication backend & domain logicExternal nocobase/nocobase:2.2.50 Host loading 7 Apache-2.0 plugins (sdkProvidedByHost: true, mounted :ro), Fastify 5 Domain Services (/v1/* & specialized business logic)/api/dxos:health, /api/dxos:openapi, /api/dxos:asyncapi, /v1/*
Tier 1 · Team-owned Platform CoreCore services owned by the teamApp Registry & Bundle v3 (dxosBuilder for latticeCustom*), Adapters & API Contracts (OpenAPI 3.1.0, AsyncAPI 3.0.0, AES-256-GCM Vault dxosVault), Shared Policies (56 static FORCE RLS tables under nocobase_app + ldx_pat_* scopes), Outbox & Event Coordination (dxosEvents: CloudEvents 1.0, Standard Webhooks whsec_, FOR UPDATE SKIP LOCKED, 5-failure/120s circuit breaker, DLQ)/api/dxosApiKeys:*, /api/dxosVault:*, /api/dxosEvents:*, /api/dxosBuilder:*, /api/dxosDataGov:*
Tier 1 · Automation & ContextWorkflows, integrations & IIoT contextLatticeFlow v2 & Approvals (dxosAutomations: 24 nodes across 6 groups, loopCursor, dxosApprovals M-of-N + dxosDelegations, dxosNotify), Visual DMN Rules (dxosDmn FEEL), Stock n8n 2.48.1 (external integrations via REST v1 & OAuth2 PKCE), NGSI-LD Broker & MQTT (FIWARE Orion-LD 1.12.0, Eclipse Mosquitto 2.0.21 DynSec, Node-RED 4.0.9, 2.0°C HITL guard)/admin/settings/workflow/automation, /api/dxosAutomations:*, /api/dxosApprovals:*, /api/dxosDmn:*, /api/dxosN8n:*, /api/dxosBroker:*
Tier 1 · Agent ServicesAI workforce & app buildingBusiness Agents & P.A.R.A. RAG (7 Profiles dxos-coordinator..dxos-analyst, 20 Unified Tools + 4 IT/OT MCP Tools, /api/dxos-mcp, /api/dxos-a2a, /.well-known/agent-card.json, Vietnamese PII redaction, PostgreSQL quotas, Hybrid RAG HNSW + RRF), Application Builder 2.0 (Isolated Schema/ER Plan-Diff, Preview & Safe Rollback)/api/dxos-mcp, /api/dxos-mcp/it-ot, /api/dxos-a2a, /api/dxosAi:*, /api/latticePara:*
Service-owned DataGoverned persistence & ledgerPostgreSQL 16 + pgvector 0.8.1 (56 FORCE RLS tables & HNSW vectors), RustFS 1.0.6 Object Storage, Orion-LD + MongoDB 8.0 & Valkey 8.1, Ed25519 + Merkle Ledger (dxosLedger)/api/dxosLedger:*, /api/dxosBlocks:*
Cross-cutting OperationsObservability, secrets, scanning & DROTel Collector 0.123.0 + Prometheus v3.3.0 + Grafana 11.5.8 (W3C traceparent + OTel GenAI), Vault & RBAC, File Quarantine & Scanning (file-scanner + ClamAV 1.5.5), Gotenberg 8.20.1 (pdf), PITR WAL .gz Backups, Bundle v3 & CycloneDX SBOM/api/dxos:metrics

Five Platform Interaction Patterns (1–5) ​

Every operational workflow follows one of five end-to-end technical patterns, ensuring every state transition passes through authorized service boundaries and audit logging:

PatternEnd-to-End Execution Path
1Application request: User / Workspace -> Caddy 2.10 + APISIX 3.19.0 Gateway (TLS termination, X-Request-Id, Valkey limit-count) -> NocoBase / Domain API (Keycloak OIDC PKCE S256 or ldx_pat_*) -> PostgreSQL 16 FORCE RLS (latticeNativeScope binding app.current_org under nocobase_app).
2External integration: External System -> Protected Webhook (HMAC Standard Webhooks whsec_) -> Event Bus (latticeEventBus, FOR UPDATE SKIP LOCKED, 5-failure/120s circuit breaker) / n8n 2.48.1 Adapter -> Authorized Service API (ldx_pat_*).
3Context-driven automation: Mosquitto 2.0.21 (DynSec/LWT) -> Node-RED 4.0.9 -> NocoBase MKT & Outbox -> NGSI-LD Broker (FIWARE Orion-LD 1.12.0) --(Change notification / dashed)--> Visual DMN & MKT Rules -> LatticeFlow v2 / Task (enforcing the 2.0°C HITL guard on bidirectional downlink commands).
4Business agent: User / Workflow / MCP / A2A -> Business Agent + P.A.R.A. Hybrid RAG (pgvector HNSW + RRF) -> 20 Scoped Tools (createAuditedTool: Vietnamese PII redaction, PostgreSQL quotas, OTel GenAI spans) -> Authorized Service APIs (HITL on sensitive mutations).
5Application builder: Builder · App Builder 2.0 -> Isolated Plan & ER Diff (dry-run latticeCustom* schema diff) -> Validate & Preview -> Human Approval -> Publish Bundle v3 / Safe Rollback (never writes directly to production DB).

Five Isolated Production Network Zones (prod.yml) ​

In infra/compose/prod.yml, every container image is pinned to an immutable @sha256 digest and placed across five isolated Docker networks. Four networks set internal: true so databases, message brokers, and antivirus daemons have zero direct ingress or egress to the public internet.

Docker Network Segmentation (infra/compose/prod.yml)
ParameterTypeDefaultDescription
edgerequired
bridge (public)80, 443Public TLS ingress network hosting caddy (TLS + HSTS), keycloak, gateway (APISIX 3.19.0), and nocobase.
apprequired
bridge (internal: true)internalInternal HTTP/gRPC service mesh connecting gateway, nocobase, file-scanner, orion-ld, nodered, n8n, gotenberg, otel-collector, prometheus, and grafana.
datarequired
bridge (internal: true)internalIsolated persistence network for postgres (16.16), nocobase-db (pgvector 0.8.1-pg16), redis (Valkey 8.1), rustfs (1.0.6), orion-mongo (8.0), and telemetry collection.
scannerrequired
bridge (internal: true)internalQuarantined malware inspection zone shared solely by file-scanner (:4010) and clamd (ClamAV 1.5.5 at :3310) under read_only: true.
iiot-netrequired
bridge (internal: true)internalDedicated IT/OT edge network isolating Eclipse Mosquitto (:1883), Node-RED (:1880), and the NocoBase Digital Twin broker.

Valkey 8.1 Logical Database Partitioning ​

LatticeDX partitions Valkey 8.1 (valkey/valkey:8.1-alpine, BSD-3-Clause) by logical database index and responsibility:

PartitionBinding / PluginStored State & Limits
DB 0CACHE_REDIS_URLNocoBase host application cache (CACHE_DEFAULT_STORE=redis).
DB 1PUBSUB_ADAPTER_REDIS_URLPubSub channel latticedx:surface-updates forwarding record and workflow state changes to the GET /api/dxosAi:surfaceEvents SSE stream (capped at 1000 concurrent listeners with 25s keepalive comments).
DB 2DX_NATIVE_AUTH_SESSION_REDIS_URLEnterprise OIDC PKCE state: (300s TTL), single-use ticket: (60s TTL), and revoked: / revoked_sid: revocation keys (24h TTL).
APISIX counterslimit-count (policy: redis)Per-IP rate limit counters enforcing 120 / 240 / 300 requests per 60s.

PostgreSQL Outbox vs. Valkey PubSub

LatticeDX does not run Valkey Streams for durable delivery. Both transactional outboxes (latticeContextOutbox for NGSI-LD projection and latticeEventBus for webhook dispatch) reside in FORCE RLS-protected PostgreSQL 16 tables drained with FOR UPDATE SKIP LOCKED, keeping event enqueueing atomic with business transactions.

Compose Stack Topology & Deployment Profiles (infra/compose/*) ​

Local Compose stacks bind host ports strictly to 127.0.0.1 (leaving postgres, nocobase-db, redis, clamav, orion-mongo, and mosquitto unexposed). Production (prod.yml) ships default Zero-Trust services plus five opt-in profiles (iam-sync, n8n, observability, pdf, iiot).

Compose FileProject NameServices & Local Host Bindings (127.0.0.1)
infra/compose/core.ymllattice-dxCore API stack: postgres, keycloak (:8081), api (internal :4000), gateway (:8080), clamav
infra/compose/nocobase.ymllattice-dxNocoBase host (:13000), nocobase-db (pgvector), redis (Valkey 8.1)
infra/compose/iiot.ymllattice-dxIsolated iiot-net stack: mosquitto (internal 1883) and nodered (:1880)
infra/compose/integration.ymllattice-dxExternal integration stack: orion-mongo, orion-ld (:1026), n8n (:5678)
infra/compose/native-files.yml(overlay)Wires file-scanner (:4010) and clamav scanning for native attachments
infra/compose/native-rehearsal.ymllattice-native-rehearsalIsolated upgrade rehearsal (nocobase-db + nocobase on :13001)
infra/compose/uc1-sample.yml(overlay)Sample integration service uc1-sample (:4100) and uc1-broker-worker
infra/compose/prod.ymllattice-dx-prodHardened Zero-Trust production stack (80/443 via Caddy) with 5 opt-in profiles

Five Opt-In Production Profiles (prod.yml) ​

ProfileActivated ServicesAdded Capability
iam-synckeycloak-config-cli (6.5.1-26)One-shot import of lattice-realm.prod.json into Keycloak
n8nn8n (2.48.1)External workflow engine backed by the n8n_app PostgreSQL database
observabilityotel-collector (0.123.0), prometheus (v3.3.0), grafana (11.5.8)OTLP trace ingestion, 5 Prometheus alert rules, and latticedx-360.json dashboard
pdfgotenberg (8.20.1)Sandboxed HTML-to-PDF voucher rendering with --chromium-disable-javascript=true
iiotmosquitto (2.0.21), nodered (4.0.9)DynSec MQTT broker and Node-RED downlink bridge inside iiot-net

CTU-OpenPaw 4-Repository Ecosystem ​

The platform is maintained across four independent Pure-OSI repositories (Apache-2.0) separating runtime core code, bilingual documentation, curated GitOps templates, and organization governance.

RepositoryLicenseTechnical RoleLink
CTU-OpenPaw/lattice-dxApache-2.0Core platform v0.4.2: 7 @latticedx/* NocoBase plugins, Fastify /v1/* API, AI worker, file-scanner sidecar, Compose stacks, and PITR recovery scriptsGitHub lattice-dx
CTU-OpenPaw/lattice-docsApache-2.0 / MITBilingual VitePress documentation portal (Vietnamese / and English /en/) with interactive architecture diagrams and API referenceDocs Home
CTU-OpenPaw/lattice-templatesApache-2.0Curated catalog of 43 validated JSON artifacts: LatticeFlow v2 blueprints, n8n workflows, DMN tables, Business Packs, Public Forms, and Solution Bundle v3GitHub lattice-templates
CTU-OpenPaw/.githubApache-2.0Organization profile, community health governance, Code of Conduct, and vulnerability disclosure guidelinesGitHub .github

Live Specifications & Runtime Health ​

The Application Runtime & Cross-cutting Operations layer exposes unauthenticated health checks (or token-guarded metrics) and dynamically generated API specifications that include runtime latticeCustom* collections alongside core platform resources.

GET/api/dxos:openapi
Public | Bearer JWT | ldx_pat_*
Returns the live OpenAPI 3.1.0 specification dynamically introspecting runtime latticeCustom* collections.
GET/api/dxos:asyncapi
Public | Bearer JWT | ldx_pat_*
Returns the live AsyncAPI 3.0.0 specification covering 3 servers (mqttBroker, httpGateway, redisPubSub) and 5 channels.
GET/api/dxos:metrics
Bearer DX_METRICS_TOKEN | root | ldx_admin
Exports 16 Prometheus metric families covering HTTP latency, RLS errors, outbox backlog/DLQ, AI tokens, and SSE listeners.
bash
# Check NocoBase + 7-plugin runtime health
curl -fsS http://127.0.0.1:8080/api/dxos:health

# Fetch live OpenAPI 3.1.0 spec (includes dynamic latticeCustom* collections)
curl -fsS http://127.0.0.1:8080/api/dxos:openapi | jq ".openapi, .info.version"

# Fetch live AsyncAPI 3.0.0 spec (MQTT, SSE, Valkey PubSub, Webhooks)
curl -fsS http://127.0.0.1:8080/api/dxos:asyncapi | jq ".asyncapi, (.channels | keys)"

Operational Boundaries & Fail-Closed Defaults ​

BoundaryEnforcement Rule
External OCI host boundaryCTU-OpenPaw/lattice-dx never embeds upstream/nocobase submodules or .gitmodules. The nocobase/nocobase:2.2.50 host container mounts the 7 plugin directories read-only (:ro) at /app/nocobase/node_modules/@latticedx/*.
Fail-closed defaults across layersMissing app.current_org returns 0 rows in PostgreSQL; setting DX_ALLOW_PUBLIC_SIGNUP off disables self-registration; outbound connectors block private, loopback, and cloud metadata IPs (169.254.*) unless explicitly allowlisted.
Clause 5.2 attribution preservedPowered by NocoBase, v2.2.50, and License settings remain visible across the admin console and native workspaces.

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