Architecture
The authoritative statement is ARCHITECTURE.md
in the repository, which follows a request from the composition to the
verification of a change; the eleven decisions behind it are the
ADRs. This page is the map.
The maps
The maps are nested: one for the workspace, three for the system, and nine for its flows. Each is embedded below and opens full screen from the link under it; its JSON source is kept beside it in the programme record. Every map was authored from the code on 2026-09-06 and checked for containment at four desktop sizes from 1440×900 to 2048×1320. Inside a map, drag to pan, scroll to zoom, and use the guided views where a map offers them.
Level 0 — the repositories
The repositories and where each thing lives
The public foundation, the native shell and this site; the private catalog and clients; GitHub Actions, the image registry, the clusters, Postgres and JetStream.
platformkit-workspace in the recordLevel 1 — the system
How the pieces compose
client.yaml names modules, main constructs them, the kernel serves them under a tenant transaction; one UI with three shells; the schema seam; the design export to an editor.
platformkit-composability in the recordThe layers inside the public repository
kit/, modules/, ui/ and design/, apps/ and tools/, and which layer composes which.
platformkit-foundation in the recordThe composed modules and who depends on whom
The flagship’s fourteen modules across three repositories and their Deps edges, in the order the registry constructs them.
platformkit-modules in the recordLevel 2 — the flows
Boot
config.Load, compose, app.New, the migrations, the boot gates and the split into web, worker and all.
flow-boot in the recordOne request
From the request host to the commit: headers, request id, tenant, the lazy transaction, the session, the declared authorization, the handler, row-level security, the outbox row and the buffered response.
flow-request in the recordEvents and jobs
From a committed outbox row through the relay and JetStream to a handler in the event’s tenant transaction; the scheduler and the module jobs.
flow-events in the recordThe schema seam
One entity struct to five routes, seven generated pages, the resources JSON, the native shell’s screens and the OpenAPI document.
flow-seam in the recordDesign
Tokens and class lists to one stylesheet; the gallery’s typed examples to a snapshot, the export tool and the OpenPencil foundation file.
flow-design in the recordA client
client.yaml and assets through the flagship’s loader and registry to a bootstrapped tenant with an admin and a storefront.
flow-client in the recordThe native shell
Sign in, keep the cookie, read the seam, derive the screens, call the same five routes.
flow-mobile in the recordThe start command
From nothing to a running application: an embedded Postgres, the role, the first tenant, the combined role, Ctrl+C.
flow-start in the recordDelivery
From a pull request through the gates to a tagged image with its SBOM and a cluster that pulls it.
flow-delivery in the recordLayout
| Directory | Holds |
|---|---|
|
the kernel: |
|
business modules, each |
|
typed components with their gallery of typed examples, the class builder,
the stylesheet IR and the CSS emitter, the icon set, the browser controllers,
|
|
design tokens and the two themes, as struct literals |
|
|
|
|
|
the foundation schema; each module carries its own SQL |
|
the Dockerfile |
|
the decisions, one number each |
Budgets
Every bucket of source has a ceiling in
loc-budget.json, and the number of first-party
packages linked into the binary has one in
packages-budget.json. A pull request that
exceeds a ceiling fails; raising one is an owner commit with a written reason.
The numbers are not copied into prose anywhere, this page included: run
make check-loc and make check-packages for today’s.
The browser half
There is no CSS build, no node in the build and no framework. ui/components
is forty-one functions of the form Button(ButtonProps) g.Node, each declaring
the classes it can emit; ui/style resolves exactly those classes to rules
against the custom properties design renders; ui.Compose folds the two, plus
a consumer’s own lists and rules, into one Sheet served from memory. htmx is
the only third-party byte the browser runs, beside four controllers of a few
dozen lines. Every response carries a content security policy with a
per-request nonce. The detail is in Components, pages and
screens.
Verification
make check runs the build, vet and format checks, the test suite against real
Postgres and NATS — which includes the boot validation of authorization
declarations, the tenant isolation cases and the empty-database boot — the
source and package budgets, the import boundary and tenant-setting ownership.
make e2e separately drives the admin shell and a generated CRUD journey in a
browser. CI runs both, plus govulncheck and the native design conformance
suite under tools/designexport/openpencil; the release workflow checks the
tagged tree before publishing an image and its SBOM. The
delivery flow draws the gates in
order. A type
check proves types, a test proves its exercised cases and a journey proves its
observed outcome; none alone proves production readiness.