This is a demo project for my tutorial talk from at Rust Nation '24.
It is a countdown timer app, to demonstrate how Crux approaches testing side-effects using the real time "wall clock" needed for the countdown.
The slides from the talk are available as PDF in this repo, and provide background to the demo.
The best way to get in touch with questions is via the Crux community Zulip chat.
You will need:
- Rust. There's a
rust-toolchain.toml
, so necessary targets should install for you pnpm
for the web shell - see installation optionswasm-pack
### main branch
The main
branch of this repo is a starting point for the tutorial, where
all the boilerplate setup has been done, and a static UI has been prepared
for the timer.
To run the demo, you need to run the type generation from the shared_types
folder
cd shared_types && cargo build
You can then run the web UI by going into the web folder and runing
pnpm i
pnpm run dev
To step through the demo, check out the commits on the wip
branch, one by one. You can also read the changes on PR #1. Most of the commits are focused on the core of the app in a shared/src/app.rs
,
except for the very last one, which links the UI to the core.
Every step of the way, tests of the shared
crate verify that that the changes made are working.