Build a task app
This example implements a small task domain with three actions: add a task, complete it and add tags. Runnable tests use the generated TypeScript client against the real local runtime.
Start here to learn the model and client. The download contains domain code and tests, not a finished browser or Flutter UI.
Download and run
Section titled “Download and run”Use Node.js 24 or later and install the Protobuf compiler (protoc). Check protoc --version before continuing. Download the task example, extract it and open the tasks directory in a terminal.
On macOS or Linux:
curl -fLO https://docs.nomos.cafe/examples/nomos-tasks.tar.gztar -xzf nomos-tasks.tar.gzcd tasksnpm cinpm run compilenpm run typechecknpm testThe archive pins the Nomos packages to 0.123.9. The first compile or test run may download the runtime. No hosted account is required.
What the tests check
Section titled “What the tests check”| Test | Expected result |
|---|---|
| Add, read and complete a task | The text is readable, completion updates the record, and the open-task query changes |
| Reject an empty task | The client reports a refusal and no change enters the history |
| Synchronise two devices | Each device makes its own tag addition, then both read both tags after sync |
All three tests must pass. A successful build by itself is not the result of this example.
Find the code
Section titled “Find the code”| File | What it contains |
|---|---|
domains/tasks.ts |
The Task model, actions and query |
nomos.project.ts |
The compiler configuration |
test/tasks.test.mts |
The complete local and offline journeys |
build/tasks.reception.mjs |
The generated client, produced by compilation |
Read Model a domain alongside domains/tasks.ts, then Use the generated client alongside the tests.
Scope of the example
Section titled “Scope of the example”Task records are public within the example workspace. The example does not define owner, editor or viewer permissions. Its actor names identify test participants; they are not a production login flow.
The two-device test uses separate local runtimes and an explicit test-harness sync. It verifies concurrent changes and convergence, not a physical device’s network transport or an application’s reconnect UI. Offline work and sync explains the sequence and the boundary.