Warning: Baradir is experimental and not ready for production yet.
Baradir is an application platform for WebAssembly Components.
It lets you host multiple wasm components as apps, organize them into isolated
environments, and serve each app over HTTP under its own subdomain — with the
apps themselves implemented as plain wasi:http/proxy components.
Baradir is a Rust host built on Wasmtime and
Hyper. It serves WASI 0.2 (wasi:http/proxy) components
behind subdomain routing.
- Requests to
{app}.{slug}.{base-domain}:{port}are served by the component namedappfor the environment identified byslug. - Visiting the bare domain creates a new environment with a random slug,
seeds it with the
managerandhelloapps, and redirects tomanager.{slug}.{base-domain}:{port}. - Components call back into the host through a WIT interface to list apps, get their domain, and install new apps from a wasm binary.
- State lives in SQLite (
./data/db.sqlite) and installed components in./workspaces/{slug}/{app}/.
-
Stable Rust
-
The
wasm32-wasip2target:rustup target add wasm32-wasip2
cargo build -p manager -p hello --release --target wasm32-wasip2
cargo run
CLI flags:
| flag | default | description |
|---|---|---|
--port |
8080 |
TCP port to listen on |
--base-domain |
baradir.localhost |
base domain used for routing |
--env-folder |
./workspaces |
root folder of environments |
curl -i http://baradir.localhost:8080/
The server responds with a 302 to http://manager.{slug}.baradir.localhost:8080,
the dashboard for the newly created environment. From there you can:
- open each installed app from the card list
- upload a new
.wasmcomponent, which is compiled and served immediately athttp://{app}.{slug}.baradir.localhost:8080
*.localhost resolves to loopback instantly (RFC 6761), so no /etc/hosts
edits are needed.