Part 3 — Architecture
3.1 System map#
The full picture, layer by layer. Everything a builder designs is stored as events in the Kernel; generators turn the stored design into running software, and the platform services underneath provide identity, secrets, data, messaging and run history.
The runtime services the stack depends on are defined in platform-dev/docker-compose.6.0.yml, except the BPM engine, which runs from the 5.0 reference stack (platform-dev/docker-compose.yml, container oneweb-pr-tomcat, 127.0.0.1:8889):
| Service | Address | Used for |
|---|---|---|
| Keycloak | :8095 |
Identity: sign-in for the Workbench and generated apps |
| OpenBao | 127.0.0.1:8200 |
The Hub's vault (secret values) |
| Jaeger | UI :16686, OTLP :4318 |
Flow run history |
| RabbitMQ | AMQP :5673, management :15673 |
Queue triggers and the publish step |
| Kafka | 127.0.0.1:9094 |
The event trigger and the publish step |
| Mailpit | SMTP :1025, web UI :8025 |
Mail for notify steps (development) |
| MinIO and SFTP | MinIO :9100 (console :9101), SFTP 127.0.0.1:2222 |
File triggers |
| BPM engine | 127.0.0.1:8889 (5.0 stack) |
Process execution |
Repository layout:
| Path | Role |
|---|---|
kernel-schemas/ |
The IR. JSON Schema per artifact kind. Authoritative. |
kernel-poc/src/ |
Kernel, typed tools, every generator, deployers, tests. |
kernel-poc/sql/ |
Postgres schema: event store, graph, deploy runs, events. |
workbench/ |
Module Federation designers and consoles; the shell. |
generated/ |
Output. Never hand-edited. (.env.local is not generated.) |
platform-dev/ |
5.0 reference stack, the 6.0 compose stack, vendored libs, the Hub worker. |
3.2 Runtime stack#
Two Postgres servers belong to different projects:
| Server | Owner | Holds |
|---|---|---|
:5432 oneweb-db |
5.0 reference stack | No Kernel state and no generated app's data. But the BPM engine's bpm schema is here too (platform-dev/tomcat/BPMREST.xml points the engine at oneweb-db), so process instances live in this database |
:5437 oneweb-appdb |
6.0 stack (pgvector) | The Kernel event store and generated apps' data |
The split is deliberate: wiping the 5.0 stack cannot touch the Kernel store or generated apps' data. It would delete the BPM engine's process state, because that sits in the 5.0 database (see the table). The Kernel's connection is built
in one place, db-config.js. Rebuild all 6.0 state with cd kernel-poc && npm run restore.
To rebuild the 6.0 state after a wipe:
| Service | Purpose |
|---|---|
| Keycloak (:8095) | Identity: one realm per organisation; login for Workbench and generated apps |
| OpenBao (127.0.0.1:8200) | Vault for secret values (npm run vault:up inits/unseals) |
| Jaeger (:16686, OTLP :4318) | Flow run history, read through run-trace.js |
| RabbitMQ (AMQP :5673, mgmt :15673) | Hub queues and dead letters |
| Kafka (127.0.0.1:9094) | Hub event trigger and publish step |
| BPM engine | Runs deployed processes (built from 5.0's engine) |
| Mailpit | Dev SMTP for notify steps |
| MinIO / SFTP | Object stores for file triggers |
3.3 The Workbench shell#
The shell hosts each designer as a Module Federation remote; react and react-dom are the only
shared singletons.
Consequences developers must know:
- Run designer packages via
pnpm --filter <pkg> buildthenserve.rsbuild devbreaks the singleton inside the shell;serveonly serves a prebuiltdist/, so edit → rebuild. - The SDK (
sdk/src/ui/) is bundled into every remote: after an SDK change rebuild every designer. - Every designer implements
reload()so the shell's Undo/Redo refresh it. - Layout is checked in a real browser (
pnpm test:layout); the Flow designer and the full builder journey have their own end-to-end suites. - The three Operations consoles are read-only apart from three explicitly confirmed writes (flow replay; failed-item replay and delete).
3.4 Generation pipeline#
Each artifact kind in the Kernel has a generator that turns it into runnable output. The table lists every pair; the diagram shows the main paths.
| Input | Generator | Output |
|---|---|---|
| Entity | gen-ddl.js, gen-migration.js, gen-api.js |
CREATE TABLE (7 dialects), ALTER with severity, read/write endpoints with row policies |
| Page / Form | gen-nextjs.js, gen-form.js, gen-work-portal.js |
Next.js pages, forms, case portal |
| Design system | compile-ds.js |
CSS, scoping, class lint |
| App shell, auth | gen-shell.js, gen-auth.js, gen-admin-portal.js |
Layout/nav, OIDC session, admin portal |
| Flow | gen-flow.js |
In-app route/trampoline |
| Flow (Hub) | gen-camel.js |
Camel YAML + worker config |
| Process | gen-process-deploy.js |
Engine definition deployed at release |
| App env | app-env.js |
Marked block in .env.local |
generate-app.js writes everything atomically (temp + rename) and refuses to write under a live
next dev. See workbench/GENERATOR.md.
A generated app's environment is derived from the Workspace Environment and the vault:
3.5 The two runtimes for Flows#
The same Flow artifact compiles twice:
In-app (gen-flow.js) |
Hub (gen-camel.js) |
|
|---|---|---|
| Form | TypeScript trampoline inside the generated app | Camel YAML in a standalone Quarkus worker |
| Strengths | No extra infrastructure; subFlow |
Queues, Kafka events, file triggers, SOAP, schedules; runs independently of the app |
| Deploy | With the app | hub_deploy → npm run hub:apply (pinned, gated, reversible) |
Parity is proved by running the same input on both and comparing (verify-camel-parity.js); every
divergence found so far was a real semantic difference. Connections are runtime-neutral; each
runtime's resolved values are derived in one place (connection-env.js, hub-config.js). Flows the
Hub alone can run never block an app from generating.
3.6 Multi-tenancy and workspaces#
Every Kernel table is keyed by tenant_id. Real multi-tenant operation is a later phase; the design is
in kernel-poc/MULTI-TENANCY.md and is a proposal, not built.
What is built is the workspace
control plane: members, roles, verbs (view, edit, promote, manageConnections,
manageMembers, approveProd…), bindings, Environments, residency policy and separation-of-duties
rules. The workspace an authorization decision resolves against comes from the target artifact's own
containment chain; a call spanning two workspaces is refused, not resolved.
3.7 Deploying a release#
The Deployment Center plans a release and a deployer executes it. deploy_plan (read-only) gives the units, changes, steps, gates, every blocker and a digest. deploy_start re-plans, refuses if the digest moved, then queues a run in kernel.deploy_run (Postgres only; the file backend refuses it by name). A deployer claims the run and executes it through the target's driver.
The deploy plan lists these steps in this order (a step appears only when the release has something for it; the Local and cluster drivers share the list and word the titles differently). Identity runs before the process deploy because the engine fixes a task's candidates at deploy, so the first members must already be granted.
deploy_rollback puts back what served each app before a succeeded run (the other Local slot or the previous Helm revision), never a rebuild.