SERVICE CONSTELLATION

One core, many shells 一芯,多壳

Behind the front-end sits a fleet of independent Rust microservices — each its own Cargo workspace, its own process, its own port, upgraded on its own cadence. They all reuse one shared library (cmx-container), assemble through one chassis, and speak one metadata contract. This is the platform's back-end, service by service. 前端之后,是一支独立的 Rust 微服务矩阵——每个都是独立 Cargo workspace、独立进程、独立端口、独立升级节奏。它们共享同一套公用库(cmx-container)、经同一套装配核组装、遵循同一份元数据契约。这就是平台后端,逐个服务展开。

6
Independent servers独立服务进程
96
Rust cratesRust crate
5
metaKinds · DCT·DOC·FLX·RPT·RULE元类 · DCT·DOC·FLX·RPT·RULE
1
Shared core · cmx-container共享内核 · cmx-container
THE FLEET服务矩阵

Six servers, one origin六服务,一来源

Each capability center runs as its own process on its own port. The portal at :8080 is the front door; it federates the rest. 每个能力中心以独立进程、独立端口运行。:8080 的门户是前门,聚合其余服务。

🏛️ cmx-portalservice · cmx-portal-server · portal & designer门户与设计器 :8080
🔀 cmx-flowengine · cmx-flow-server · BPMN workflowBPMN 流程 :8091
📊 cmx-report · cmx-rpt-server · report platform报表平台 :8092
🗂️ cmx-model · model-server · model center & DB init模型中心与建库 :8093
⚖️ cmx-rulesengine · rule-server · decision engine决策引擎 :8094
🧬 cmx-mdm · mdm-server · master data主数据管理 :8095
📦 cmx-container · shared library · no server bin公用库 · 无 server bin lib库
CAPABILITY CENTERS能力中心

Every service, in depth逐个服务展开

🏛️
RUST · :8080RUST · :8080
cmx-portalservice

The portal microservice — cmx-portal-server, the front door at :8080. A thin bin plus a business layer that keep-wire the cmx-container shared crates across workspaces. It serves the front-end monorepo (portal + designer) as one same-origin dist/ and federates the rest of the fleet. 门户微服务——cmx-portal-server,位于 :8080 的前门。薄 bin + 业务层,keep-wired 跨 workspace 复用 cmx-container 公用 crate。以单一来源 dist/ 托管前端 monorepo(门户 + 设计器),并聚合其余服务。

:8080 2 crates cmx-portal-server
🔀
RUST · :8091RUST · :8091
cmx-flowengine

The workflow engine — a BPMN 2.0 token-execution kernel where the waiting state is the commit point. Multi-instance (parallel & sequential), boundary timers, call-activity subprocesses, event gateways, an async-job executor with a dead-letter queue, external workers, error boundaries, and live instance migration. Multi-tenant (db-per-tenant), a headless v1 contract (SSE, webhooks, OpenAPI/Swagger), and embeddable Web Components — one core, three shells. 流程引擎——BPMN 2.0 令牌执行内核,「等待态即提交点」。会签/或签多实例、边界定时器、call-activity 子流程、事件网关、带死信队列的异步 Job 执行器、外部 Worker、错误边界、运行实例热迁移。多租户(db-per-tenant)、headless v1 契约(SSE / webhook / OpenAPI-Swagger)、可嵌 Web Components——一芯三壳。

:8091 12 crates BPMN 2.0 multi-tenant
⚖️
RUST · :8094RUST · :8094
cmx-rulesengine

The decision engine, benchmarked against GoRules ZEN, Camunda DMN, Drools and IBM ODM. Stateless, synchronous, microsecond evaluation: DMN's 11 hit policies, a self-built FEEL expression engine, JDM decision graphs, optional Rhai scripting — plus two moves that go beyond ZEN: failure-attribution trace (which rule, which input, what went wrong) and decision-table gap/overlap completeness analysis. flow's businessRuleTask calls it directly. 决策引擎,对标 GoRules ZEN / Camunda DMN / Drools / IBM ODM。无状态、同步、微秒级求值:DMN 11 命中策略、自研 FEEL 表达式引擎、JDM 决策图、可选 Rhai 脚本——并有两处超越 ZEN:失败归因 trace(哪条规则、哪个输入、错在哪)与决策表 gap/overlap 完整性分析。flow 的 businessRuleTask 可直接调它。

:8094 6 crates DMN · FEEL 11 hit policies
📊
RUST · :8092RUST · :8092
cmx-report

The report platform — a visual designer and applier, custom fetch functions (QM/QC), floating rows & columns that expand a template against its data source, and object-level collaborative editing. One core, many shells: it runs embedded in the portal via a keep-wired cmx-rpt-api shell, or standalone as cmx-rpt-server at :8092. The group-consolidation platform is built on top of it. 报表平台——可视化设计器 + 应用器、自定义取数函数(QM/QC)、按数据源展开模板的浮动行列、对象级协同编辑。一芯多壳:既可经 keep-wired cmx-rpt-api 薄壳内嵌门户,也可作为 cmx-rpt-server 独立进程跑在 :8092。集团合并平台即建于其上。

:8092 7 crates designer + applier consolidation
🗂️
RUST · :8093RUST · :8093
cmx-model

The model center — where a definition becomes a database. It owns DCT (dictionaries), DOC (documents), FLC and CODE plus database initialization: table definition → DDL generation → schema init → a module-deployment ledger. A dual DB stack, handlers made generic over app state, served standalone as model-server at :8093. 模型中心——定义在此变成数据库。承载 DCT(字典)、DOC(单据)、FLC、CODE 及数据库初始化:表定义 → DDL 生成 → 建库 → 模块部署台账。双 DB 栈,handler 泛型化脱离 app state,作为 model-server 独立跑在 :8093。

:8093 11 crates DDL gen DCT · DOC
🧬
RUST · :8095RUST · :8095
cmx-mdm

Master data management — the single source of truth for the entities every other service references. Extracted into its own workspace alongside cmx-model, following the same one-core-many-shells pattern, served as mdm-server at :8095. 主数据管理——被其余服务引用的实体的唯一真相源。与 cmx-model 一同抽为独立 workspace,遵循同一套一芯多壳范式,作为 mdm-server 跑在 :8095。

:8095 4 crates master data
SHARED FOUNDATION共享地基

The library under everything众服务之下的公用库

📦
RUST · SHARED LIBRARY · 54 CRATESRUST · 公用库 · 54 CRATE
cmx-container

Not a server — the shared backbone every microservice links against. A 54-crate Cargo workspace with no executable bin of its own, carrying: a WebAssembly plugin platform (Extism runtime, plugin market & cluster sync), declarative visual service orchestration, the DCT/DOC/MDM metadata data services (api + model + store-pg triples), the model center, unified auth (JWT dual-token + Refresh Rotation + OAuth2/PKCE), RBAC/IAM with SoD, a business code/numbering engine, a scheduled-job center, and the infrastructure layer — sqlx and tokio-postgres dual DB links, Redis cache & distributed locks, S3/local object storage, volo gRPC, and Nacos registry/config. The server bins moved downstream; this stayed as the foundation they all share. 它不是服务,而是每个微服务链接的共享骨干。54 crate 的 Cargo workspace,本身无可执行 bin,承载:WebAssembly 插件平台(Extism 运行时、插件市场与集群同步)、声明式可视化服务编排、DCT/DOC/MDM 元数据数据服务(api + model + store-pg 三件套)、模型中心、统一认证(JWT 双令牌 + Refresh Rotation + OAuth2/PKCE)、含 SoD 的 RBAC/IAM、业务编码铸号引擎、定时任务中心,以及基础设施层——sqlx 与 tokio-postgres 双库链路、Redis 缓存与分布式锁、S3/本地对象存储、volo gRPC、Nacos 注册/配置。server bin 已下沉至各下游,这里沉淀为它们共享的地基。

54 crates WASM plugins JWT · OAuth2/PKCE IAM · RBAC · SoD no server bin
🕸️
TYPESCRIPT · WEB COMPONENTTYPESCRIPT · WEB COMPONENT
@cmx/decision-graph

The rules engine's front-end companion — a zero-dependency <cmx-decision-graph> custom element that edits and previews JDM decision graphs in the browser. Auto-layered layout, drag-to-move nodes, rubber-band edges with cycle rejection. Framework-free, shadow-DOM, self-registering — mirroring @cmx/megasheet. 规则引擎的前端搭档——零依赖的 <cmx-decision-graph> 自定义元素,在浏览器里编辑与预览 JDM 决策图。自动分层布局、拖拽移动节点、橡皮筋拉线并主动拦截成环。框架无关、shadow DOM、import 即注册——对标 @cmx/megasheet。

0 deps Web Component v1.0.0
THE TAXONOMY元数据分类学

Five kinds of metadata五元元数据

Everything the platform models falls into one of five metaKinds. Define one, and the matching service loads, saves, and serves it — with zero bespoke code. 平台建模的一切都归入五种 metaKind 之一。定义其一,对应服务即可装载、回存、供数——零专属代码。

DCT

Dictionary数据字典

Managed reference data & classifications.受管参照数据与分类。

DOC

Document业务单据

Master-slave business documents, L1…Ln.主从业务单据,L1…Ln。

FLX

Flow form流程表单

Process forms bound to workflow nodes.绑定流程节点的表单。

RPT

Report报表

Designed reports with live fetch functions.带实时取数函数的报表。

RULE

Decision rule决策规则

Decision tables & graphs, DMN + FEEL.决策表与决策图,DMN + FEEL。

SHARED CHASSIS共享装配核

What every service has in common每个服务的共性

The fleet isn't six unrelated apps — it's one pattern, repeated. These are the invariants that make a new capability center a matter of assembly, not architecture. 这支矩阵不是六个互不相干的应用,而是同一套范式的复用。正是下面这些不变式,让新增一个能力中心成为「装配」而非「架构」。

One core, many shells一芯多壳
A neutral domain core sits behind interchangeable shells — embedded (keep-wired into the portal) or standalone (its own bin and port) — with byte-identical behavior either way. flow, report and rules all follow it. 中立领域内核之外套可替换的壳——内嵌(keep-wired 进门户)或独立(自带 bin 与端口)——两条路径行为一致。flow、report、rules 皆循此。
One assembly chassis同一套装配核
Every server boots through the same chassis run() and the same config regime (CONFIG_FILE → ConfigManager). A service differs only in identity — its banner and its business routes. 每个服务经同一套 chassis run() 与同一套配置制度(CONFIG_FILE → ConfigManager)启动。服务之间只差身份——banner 与业务路由。
Cross-workspace reuse跨 workspace 复用
Each service is its own Cargo workspace yet reuses cmx-container's crates by path — no private registry, no vendoring, no version drift. Infra stays in one place. 每个服务是独立 Cargo workspace,却经 path 复用 cmx-container 的 crate——无私仓、无 vendoring、无版本漂移。基础设施只有一处。
Multi-tenant by design生而多租户
db-per-tenant isolation with lazy per-tenant registration and JWT-carried tenant context — the same request path serves one tenant or many with no code fork. db-per-tenant 隔离 + 按租户懒注册 + JWT 携带租户上下文——同一请求路径,单租户或多租户皆可,无需分叉代码。
Headless contractheadless 契约
Versioned v1 APIs, per-tenant SSE streams, webhooks, API keys, and OpenAPI/Swagger — so a service is drivable and embeddable, not just clickable. 带版本的 v1 API、按租户隔离的 SSE 流、webhook、API Key,以及 OpenAPI/Swagger——服务因此可被驱动、可被嵌入,而不止于可点击。

See how it all fits together看它如何拼成一体

The platform overview shows the metadata-driven philosophy and the front-end ↔ back-end contract that ties this fleet to the browser. 平台总览展示元数据驱动理念,以及把这支矩阵连回浏览器的前端 ↔ 后端契约。