Build an app with architect
A chapter-by-chapter walk through building a real app on architect: the contract, the backend, the server, the clients, the tests and the release.
This guide is the long form of the walkthrough. The walkthrough shows the whole flow on one page; these chapters go through it again in the order you build an app, with the decisions each step asks you to make and the code that answers them. Every code block is taken from, or matches, code in this repo, and each chapter ends with the architecture pages that cover its subject in full.
The running example is examples/greeter: an entity (Note), a
service (Greeter) with its error and a stream, an in-memory backend,
a server, and tests that run one scenario over every wire. It is small
enough to read in one sitting, and every chapter adds to it or points
at the larger code that does the same thing for real
(apps/auth-server, and Task and studio in their own repos).
Part 1: the backend half#
- The shape of an architect app: the workspace
layout, the layers and
boundaries.toml, cargo features, the dev shell, the toolchain, the build cache andcargo xtask feature new. - The contract: entities, errors and services, what each attribute generates, and choosing wire types.
- The backend: implementing a service, storage and migrations, layers and the per-call context, and telemetry as wide events.
- The server:
EngineHost, the transports (vox over WebSocket, iroh and in-process; the HTTP face), protocol mounts and health. - Clients: the generated vox and HTTP clients, connecting and the connection lifecycle, offline and optimistic state, forms.
- Testing: one scenario on every wire, in-process vox, fakes, property tests, and what CI runs.
- Shipping: versions and tags, consumers pinning a tag, and tagging only a green main commit.
Part 2: the app half#
- The app shell and the workspace: mount
architect-shell, give it tabs, sides and a status line, and handarchitect-workspaceyour views for tab groups, splits, docks, pop-out windows and screensets. - The UI primitives:
architect-ui’s components and theme tokens, the shell’s page parts, every kind of tab and pane, the command overlays, the settings page, andarchitect-storyto browse them. - Commands, keys and menus: the Action List,
the ⌘K palette, ⌘O, the action list window and its binding editor,
keys through
architect-input, menus, and MCP. CLI and MCP puts every action on the command line too: the control socket, theactionscommand, headless mode, and the parity test. - Settings: settings declared once as a typed struct, stored by scope under an org’s defaults and locks, and the settings page.
- Documents, sync and files: CRDT documents, kinds and named undo, the document file, org sync, peer to peer, presence and collaborative text, blobs, and Files.
- Sign-in, permissions and organizations: the
identity server, the session and the device,
PermissionsGate, and the organization as the scope of everything. - Scripts, extensions and canvases: Luau over the Action List, extensions with manifests and hot reload, process extensions with remote views, and canvases over a view.
- Your own Architect: a distribution
as code, the extensions you choose compiled in, built for desktop,
the web and the node with
cargo xtask dist.
On your machine#
The whole stack on your machine: devenv up
starts the auth server, a headless node and the app, wired to each other
and to nothing else, filled from a sanitised mirror of production on a
credentialed machine and from the demo seed everywhere else.
In this section
- The shape of an architect appWorkspace layout, layers and boundaries, cargo features, the dev shell, the toolchain, the build cache and the feature scaffold.
- The contractEntities, errors and services: what you write, what each attribute generates, and how to choose wire types.
- The backendImplement a service and its repo, add storage and migrations, compose layers, read the caller, and record each call as one wide event.
- The serverEngineHost and its transports: vox over WebSocket, iroh and in-process; the HTTP face with verbs, parameters, streamed bodies, ranges and SSE; protocol mounts; health.
- ClientsThe generated vox and HTTP clients, connecting and the connection lifecycle, the offline queue and optimistic state, forms.
- TestingOne scenario on every wire, in-process vox, mocks and fakes, sandboxed boots, property tests, and what CI runs.
- ShippingVersions are tags: cutting one on a green main commit, the tag-order check, the release workflow, and consumers pinning one tag.
- The whole stack on your machinedevenv up: the auth server, a headless node and the app, wired to each other and to nothing else; filled from a sanitised mirror of production on a credentialed machine and from the demo seed everywhere else.
- Deploy: Architect, headlessarchitect-desktop serve: the Architect app run with no window as an always-on node, a sync peer for the org's vaults that serves Sites, share links, MCP and the HTTP face, released as a pure-Nix OCI image.
- The web front endarchitect.fasttrackstudio.app: the landing page, the docs and the web app as one static site, its own image (architect-web), signed in with the issuer's redirect flow and PKCE.
- Your own ArchitectA distribution of Architect as code: its name, bundle id, icon and folder, and the extensions you choose compiled in, built for desktop, the web and the node with cargo xtask dist.
- The app shell and the workspaceMount architect-shell at the root, give it tabs, sides and a status line, then hand architect-workspace your views and get tab groups, splits, docks, floats, pop-out windows and screensets.
- The UI primitivesWhat architect ships to draw an app with: architect-ui's components and theme tokens, the shell's page parts, every kind of tab and pane in the workspace, the commands overlays, the settings page, and architect-story to browse them.
- Commands, keys and menusPut everything the app does on the Action List once, and get the ⌘K palette, ⌘O, the action list window and its binding editor, keys through architect-input, native and in-window menus, and MCP from it.
- CLI and MCPEvery action on the command line, the same as over MCP: the app's control socket, the embeddable actions CLI, headless mode, the same caller and permissions, exit codes, and the parity test that keeps the two faces identical.
- A live check on a Macscripts/mac-live-check.sh: launch the app you built with its control socket and a config folder of its own, drive it through its Action List, shoot it, give its window real input with cua-driver, run an iOS build on a Simulator of its own, and quit all of it.
- SettingsDeclare settings once as a typed struct; architect stores each in its scope (this device, the person's, the project's) under an org's defaults and locks, and draws the settings page with search to the row.
- Documents, sync and filesAn app's work as CRDT documents: kinds and named undo, the document file, sync to the org through the org driver, peer to peer by link and on the LAN, presence and collaborative text, blobs by hash, and Files.
- Sign-in, permissions and organizationsSign a person in against the one identity server, keep the session and register the device; gate every service call with PermissionsGate; and make the organization the scope of everything, on the client and confined on the server.
- Scripts, extensions and canvasesLet people and models add to the app without rebuilding it: Luau scripts over the Action List as one undo step, extensions with manifests, registries and hot reload, process extensions with remote views, and ImGui-shaped canvases over a view.
Linked from
- architectA Rust framework for local-first, multiplayer, collaborative apps: declare each service and document once, and architect gives you every wire, offline and peer-to-peer sync, and one Action List that keys, menus, scripts, extensions and MCP all run.
- Getting startedGet a dev shell up, build the workspace and run the reference feature's tests.