Execution and Testing Playbook
🛠️ Execution & Testing Playbook
We have provided a unifiedMakefile inside examples/counter-app to compile, package, reset, and launch our Leptos WASM application using simple target flags. This shields you from compiling custom target configurations manually.
Run these commands from examples/counter-app:
| Backend | Public variable | Runtime env passed to component |
|---|---|---|
postgres | POSTGRES_URL | DATABASE_URL |
neon | NEON_DB_URL | DATABASE_URL |
supabase | SUPABASE_URL, SUPABASE_SECRET_KEY | DATABASE_URL, DATABASE_AUTH_TOKEN |
turso | TURSO_URL, TURSO_AUTH_TOKEN | DATABASE_URL, DATABASE_AUTH_TOKEN |
mysql | MYSQL_URL | DATABASE_URL |
redis | REDIS_URL | REDIS_URL |
DATABASE_URL and DATABASE_AUTH_TOKEN are internal runtime env values. Set
the public backend-specific variables in .env; pass the internal values
yourself only when bypassing the Makefile.
Spin manifests must allow outbound hosts for every backend family you plan to
demonstrate:
spin.redis.toml when realtime=redis; it adds the Redis trigger sidecar
and exposes redis_url / redis_channel Spin variables. Wasmtime does not use
that sidecar; it needs Preview 3, HTTP, TCP, inherited networking, DNS lookup,
./target/site/pkg mounted at /, and ./data mounted at /data.
1. Build and Run under Wasmtime (Bare Component Runtime)
Running under Wasmtime is incredibly useful for standard system deployment, local orchestration, and target compatibility checks.2. Build and Run under Fermyon Spin (Microservices Runtime)
Running under Fermyon Spin leverages Spin-specific host integrations for SQLite, Postgres, MySQL, and Redis.realtime=redis is a Redis wake transport, not a request to use Redis as the
event store. It is supported with every supported db backend, including
db=mysql. Use db=redis only when Redis should also be the durable event,
checkpoint, and read-model store.
Spin gRPC support is controlled by transport=<mode>:
http://localhost:3000/:
3. Reset a Backend without Serving
Thefresh target resets the selected backend schema, tables, or files and
then exits. It does not build or start the application.
http://127.0.0.1:3000 to interact with your secure, full-stack, optimistic-updating, Event-Sourced Leptos application!