Skip to content

Designer → Sandbox

This page connects Design your first system and Try the Sandbox into a single walkthrough. By the end you’ll have components you designed running in the Sandbox, answering commands.

Open designer.evidentsource.com, and create a model. Sketch:

  • events: what your system records;
  • commands: what users send in;
  • State Views: what the application reads back.

Full walkthrough: Design your first system.

Click Generate Code, and unzip the Rust project Designer downloads.

It has a decide stub for each command and an evolve stub for each State View. Fill in the business logic; the types, commands and view shapes are already in place. Fill in every evolve arm, too: an unfilled evolve still compiles, and returns empty state. See Generating code.

Terminal window
rustup target add wasm32-wasip2
./build_all.sh

Name a database of your own, and publish. install.sh creates the database if it doesn’t exist:

Terminal window
export EVIDENTSOURCE_URL=https://sandbox.evidentsource.com
export EVIDENTSOURCE_DATABASE=my-model-yourname
./install.sh --all

See Deploying to Sandbox for the details.

Run one of the commands you modeled. Each command is a State Change named after it in kebab-case, such as create-todo for CreateTodo, at version 1:

Terminal window
curl -X POST "$EVIDENTSOURCE_URL/api/v1/db/$EVIDENTSOURCE_DATABASE/latest/state-changes/<command>/v1" \
-H 'Content-Type: application/json' \
-d '{ … }'

The body is the command’s schema, as JSON. See Issuing commands, or connect an SDK instead.

Terminal window
curl -L "$EVIDENTSOURCE_URL/api/v1/db/$EVIDENTSOURCE_DATABASE/latest/state-views/<view>/v1"

Your evolve function folds the events your command appended. See Reading state views.

Open https://sandbox.evidentsource.com/db/<your database>/log in a browser. Each transaction shows how it arrived, and for a command, which State Change produced it.

That’s the start of an EvidentSource decision trace. Read Decision Traces & AI-Readiness for why it matters.