The apps/
directory of core is the ground truth for writing an app: every example is a
real calimero-sdk crate, built into a wasm32-wasip2 component by
calimero-app-build and tested on TestApp and its scenarios/*.json
(Testing). Each is a standalone crate, so it builds and
tests on its own:
Terminal window
cargotest--manifest-pathapps/kv-store/Cargo.toml
Each follows the same shape (SDK macros): one
#[app::state] struct of tables and collections,
an #[app::logic] impl with an #[app::init], calls and views, and optionally
#[app::error] and #[app::event] enums. Read the state struct first: it says
which reads and writes are cheap.
The basic example: a string key-value store on an UnorderedMap, events, views, a typed error, ordered reads (range, prefix, page, first, last); harness tests, scenarios, and a migration scenario against its shipped releases/0.1.0.mpk.
wiki
A team wiki: an init that seeds the home page, a newtype slug as a map key (ToKeyPart), author-owned pages with revisions, a sorted tag Set, per-person drafts (PerUser) and content-addressed attachments (Frozen).
List views that are index seeks: #[table(index(..), count(..))], find, count.
forum
Boards, posts, comments and votes on tables with indexes and counts; write-once chat messages, moderator-removed announcements and a charter written only in init.
rooms
The reference app: bookings with a unique slot, timers, confirm, public methods.
Access control in layers: members read, admins write and a team writes its own note (guards, env::in_team); then the app’s own rows: an owned config with transfer, writer sets guarding the status line, settings and roles, and their rotation.
name-registry
Usernames: one owner per name, decided by the admins.
wiki (author-owned pages, a person’s own draft) and forum (the author is the caller, moderators) carry rules of their own too.
See Access control for the patterns.
#[app::compute] runs over sealed CSV files: a preview, then one run per part, at most 4 active; the compute component (meroctl app build --compute-out); compute::publish and a grant link. See Compute actions.
The apps/fixture-* apps are the small apps the node’s own tests run (with
team-space and rooms above); they are ordinary calimero-sdk apps, not examples.
Fixture
Used for
fixture-kv
Calls, views, a confirm method, files, blobs, xcalls, actions and timers; also the kv-store-test-fixture.mpk attached to core’s releases, which the clients’ tests install
fixture-compute
Compute methods that stream files, report progress and break each cap (meroctl’s compute_run tests, the job-node tests)
fixture-captcha
A captcha service other apps of the organization verify against in the same request (env::xcall_call), and a Cloudflare Turnstile check with env::fetch
fixture-files
Deterministic files written from calls and kept by BlobRef, and the refusal to stream them back outside a compute run
fixture-notes-v1, fixture-notes-v2
Two releases of one app, for the consent page’s upgrade diff