wasip3_demo.mp4
This repository contains custom Spin templates for bootstrapping Leptos applications running on WASI. It provides two options for WASI runtimes, plus cloud provider templates:
-
leptos-wasmtime: derived from thecounterexample in theleptos_wasirepository. A pure WASIp3 Guest component that can be served via standard HTTP triggers using either Wasmtime or Spin. -
leptos-spin: derived from thespin-counterexample in theleptos_wasirepository. A WASIp3 component built with the Fermyonspin-sdkusing key-value triggers. -
leptos-cloudflare: derived from thecf-counterexample in theleptos_wasirepository. Streaming SSR inside a Cloudflare Worker with server functions backed by a Durable Object - no Spin, no WASI component: the same Leptos application source compiles towasm32-unknown-unknownfor workerd. -
leptos-aws: derived from theaws-counterexample in theleptos_wasirepository. SSR inside AWS Lambda as a native Rust binary - no wasm at all: server functions persist the counter in DynamoDB with atomic increments, and static assets are embedded in the deployment zip. -
leptos-gcp: derived from thegcp-counterexample in theleptos_wasirepository. SSR on Google Cloud Run - or any container platform - as a single self-contained binary: server functions persist the counter in Firestore transactions, progressive SSR streaming reaches the client, and the Dockerfile is the whole deploy artifact. -
leptos-azure: derived from theazure-counterexample in theleptos_wasirepository. SSR on Azure Container Apps as one self-contained binary: server functions persist the counter in Azure Table Storage with ETag optimistic concurrency, and the example carries its own SharedKey-signed REST client since no maintained first-party Tables crate exists. -
leptos-netlify: derived from thenetlify-counterexample in theleptos_wasirepository. The entire application - SSR, server functions, backend - compiled to one wasm module running in the Netlify Edge isolate, with progressive SSR streaming through standard Fetch API types. Counter in Upstash Redis with server-atomic increments. -
leptos-vercel: derived from thevercel-counterexample in theleptos_wasirepository. The same one-wasm-module shape as leptos-netlify on Vercel Edge - validated inside theedge-runtimenpm package, the same isolate implementation Vercel ships.
To install these templates from the Git repository:
spin templates install --git https://github.com/akamai-developers/leptos-spin --upgradeTo create a new project using one of the templates, run:
spin new <project-name> -t leptos-wasmtimespin new <project-name> -t leptos-spinspin new <project-name> -t leptos-cloudflarespin new is only the scaffolder here - the generated project deploys with
wrangler deploy and never touches Spin. See the template's README for
prerequisites (cargo-leptos, worker-build, wrangler 4.x).
spin new <project-name> -t leptos-awsSame scaffolding-only relationship: the generated project builds with
cargo lambda build and deploys with cargo lambda deploy. See the
template's README for prerequisites (cargo-lambda, cargo-leptos) and
the DynamoDB table setup.