Blue oil painting: two software engineers pair-program in front of two monitors, with a diagram board in the background
  1. Home
  2. NexLog OS
  3. Academy
  4. Architecture

A multi-tenant, event-driven stack.

Fastify, MongoDB and Angular on an event-driven core: businessEvents with correlationId and causationId, event ledger, unified MDM, ABAC and Zero Trust.

Four layers on the same canonical model

Headless interfaces consume the same API; each request goes through ABAC, becomes an event in the ledger and is persisted in MongoDB, isolated by tenant.

InterfacesHeadless by design, all on the same API.
Planning ConsoleAngular
App NexLog DriverPOD · tracking
Kiosk Portariacheck-in
Portal B2B/B2Cself-service
APIFastify with built-in typed validation, rate limiting and observability.
Versioned REST/api/v1/
ValidationJSON Schema
AuthorizationABAC
Observabilitylogs · metrics · traces
Event-driven coreEvery operation becomes a canonical event, with the causal chain preserved.
Business eventsbusinessEvents
Causal chaincorrelationId · causationId
Central ledgereventLedger
Master dataMDM
PersistenceMongoDB with camelCase collections and tenant isolation.
CollectionscamelCase, plural
Multi-tenanttenantId
RetentionTTL
Replicationmulti-region replica set

WMS, TMS, OMS, YMS, Customs, Control Tower, ESG and Finance publish and consume events from the same ledger.

Overview

NexLog OS runs on Fastify (API), MongoDB (canonical persistence) and Angular (operations panel). It is multi-tenant, with tenants and granular roles, and event-driven: every operation generates businessEvents with correlationId and causationId, recorded in the eventLedger.

On top of this core sit the unified MDM, attribute-based authorization (ABAC), Zero Trust architecture, observability and the specialized interfaces, all headless on the same API.

Technical stack

ComponentRoleDescription
FastifyAPIHigh-performance Node.js framework: low per-request overhead, typed plugins and robust hooks.
MongoDBCanonical persistencecamelCase collections, per-tenant indexes and typed aggregations; TTL for businessEvents and a multi-region replica set.
AngularOperations panelUnified Planning Console, with modules for WMS, TMS, OMS, YMS and Control Tower.
Event-drivenCorebusinessEvents with correlationId and causationId; central eventLedger, replay, auditing and asynchronous integration.
Unified MDMMaster dataProduct, Party, Asset, Location and Document Master shared, with no duplication between modules.
ABAC and Zero TrustSecurityAttribute-based authorization, federated identity and no trusted perimeter: every request is validated independently.

Multi-tenancy and roles

Each customer is an isolated tenant (tenants) on the platform. Roles are values of the roles enum, in UPPER_SNAKE_CASE.

RoleScopeTypical use
SUPER_ADMINPlatformCCX engineering, not visible to the customer.
TENANT_OWNERTenantExecutive who owns the account; full control over the tenant.
TENANT_ADMINTenantAdministration of users, plans and integrations.
MANAGERModuleOperations manager: approval of exceptions and playbooks.
OPERATORModuleWMS, TMS or YMS operator: task execution.
VIEWERReadRead-only: analysts and auditors.

Plans

From FREE to ENTERPRISE, plans define how many warehouses and which modules the tenant uses.

PlanAudienceLimits
FREETrial and sandbox1 tenant, 1 warehouse, low volume.
STARTERE-commerce SMBs1 warehouse, essential modules (WMS and OMS).
PROMid-marketMultiple warehouses; WMS, TMS, OMS and YMS.
ENTERPRISELarge operationsInternal multi-tenancy and all modules.

Event-driven core

businessEvents

Every state transition and every relevant operation is a typed canonical event. Names follow the dot.namespace pattern, for example orders.transition.approved.

correlationId and causationId

They track the full causal chain between events: order, wave, movement, shipping and invoice.

eventLedger

Immutable central ledger; the basis for auditing, replay, analytics and AI training.

Unified MDM

Product Master, Party Master, Asset Master, Location Master and Document Master, shared by all modules.

Security and continuity

ABAC

Attribute-based authorization: tenant, role, resource and context, granular enough to evaluate each request.

Zero Trust

No trusted perimeter: every call is authenticated, authorized and logged.

Fraud signals

Fraud signals built into orders, claims and billing, scored in real time.

Disaster recovery

Measurable RPO and RTO objectives, multi-region replication and continuous backup.

Observability

Structured logs, metrics, distributed tracing and per-tenant dashboards.

Specialized interfaces

Headless by design: all interfaces consume the same API.

InterfaceDescription
App NexLog DriverMobile app for drivers: digital POD, tracking, geolocation and OCR.
Kiosk PortariaSelf-service gate check-in, with optional biometrics and a built-in LGPD consent form.
Planning ConsoleUnified Angular app for WMS, TMS, OMS, YMS and Control Tower.
Portal B2B/B2CDedicated customer portals: tracking, self-service and documents.

API conventions

Contract conventions that apply to every module.

ArtifactConventionExample
REST endpointskebab-case/api/v1/trade-declarations
VersioningIn the path/api/v1/
MongoDB collectionscamelCase, pluraltradeDeclarations, carbonEntries
TS classes and interfacesPascalCase, singularTradeDeclaration, CarbonEntry
EnumsUPPER_SNAKE_CASEINBOUND, DRY, SUPER_ADMIN
Eventsdot.namespaceorders.transition.approved

Why Fastify, MongoDB and Angular

Fastify for a high-performance API

Supply chain operations generate a high volume of requests: picking events, movements, tracking checkpoints and telemetry. Fastify delivers low overhead, typed validation through JSON Schema and robust hooks for observability.

CCX has a track record with Node.js in production, and Fastify lets NexLog OS scale horizontally without rewriting layers.

MongoDB as the canonical core

Supply chain is a domain whose schemas evolve fast: new SKU fields, new route attributes, new shipment metadata. With camelCase collections, MongoDB lets schemas evolve without downtime, runs complex aggregations for Control Tower without a separate DW and scales horizontally by tenant.

Compound indexes on tenantId and business keys support multi-tenancy, and automatic TTL handles retention of the event history.

Angular for the operations panel

The Planning Console is an Angular app, chosen for its strong typing, modular architecture, mature tooling for complex forms (WMS, TMS, playbook configuration) and components reusable across modules.

The specialized interfaces (App NexLog Driver, Kiosk Portaria, Portal B2B/B2C) are headless on the same API, following MACH principles.

Frequently asked questions

Why MongoDB and not Postgres?

A flexible schema speeds up evolution in dynamic domains. Where transactional consistency is critical (settlement), we use compensation patterns and specific write concerns.

Can Fastify handle high throughput?

Yes. Fastify has low per-request overhead, and NexLog OS runs with built-in validation, rate limiting and observability plugins.

Does Angular still make sense?

For complex operations panels, yes. Strong typing, modular architecture and a mature ecosystem justify the choice.

Does multi-tenant mean physical isolation?

Isolation is logical by default; on enterprise, the tenant can run on a dedicated database.

ABAC or RBAC?

ABAC is more expressive: it allows rules such as “MANAGER can approve an exception in their own DC, as long as the amount stays below X”.

Does the event ledger replace the data warehouse?

For most operational questions, yes. For long-term analytics, integration with the DW is done through CDC.

How does disaster recovery work?

Through multi-region replication, continuous backups and measurable RPO and RTO objectives.

Want to discuss the architecture with the NexLog OS team?

Thirty minutes with a CCX engineer, at no cost, for a technical conversation about multi-tenancy, events, ABAC and integration with your ERP.