boardwalk
A hypermedia server framework for federated services. Boardwalk models things as state machines, exposes them as discoverable Siren resources over HTTP, multiplexes telemetry over WebSockets, and tunnels HTTP requests back through outbound peer connections so services behind a NAT stay reachable from anywhere else on your fleet.
Boardwalk started as a Rust port of Zetta and is evolving independently from there.
Install
[]
= "0.2"
= { = "1", = ["full"] }
Quick start
use ;
use BoxFuture;
async
DEV=
What's in the box
- Devices as state machines — typed
Devicetrait with allowed transitions per state, input fields, monitored properties. - Siren hypermedia API — root, server, device, type metadata, and search-result resources, with cross-server peer links.
- Multiplex WebSocket events at
/events— subscribe to topics with*/**/ regex patterns, optional CaQL filters. - CaQL — small query DSL for selecting and projecting devices.
- Peer tunnel — hub dials cloud via an outbound WebSocket; both sides upgrade to HTTP/2 with reversed roles. The cloud then proxies HTTP and forwards event subscriptions back through the same socket.
- TLS — peer dials use rustls + the OS trust store via
rustls-platform-verifier. - Persistence — opt-in via
Boardwalk::persist(path). Stable device IDs across restarts, peer record persistence.
Run the example
cargo run --bin hello-led
There's also a tunnel proof-of-concept that drives role-reversed HTTP/2 over an arbitrary duplex stream:
cargo run --bin tunnel-poc
Module layout
The whole library lives in the single boardwalk crate. The most
commonly used types — Boardwalk, Device, DeviceConfig,
DeviceError, TransitionInput, App, Scout, ServerHandle,
device/transition macros — are re-exported at the crate root.
Submodules expose lower-level surface for embedders:
| Module | What's in it |
|---|---|
boardwalk::core |
Device, Scout, App traits, transitions, streams |
boardwalk::siren |
Siren entity / action / link / field types + serde |
boardwalk::caql |
Calypso Query Language — parser + evaluator |
boardwalk::events |
Event bus, topic matching, multiplex WebSocket protocol |
boardwalk::registry |
redb-backed persistent device + peer registries |
boardwalk::http |
axum router emitting Siren; WS endpoint; peer upgrade route |
boardwalk::tunnel |
WebSocket-upgrade + HTTP/2-prior-knowledge tunnel primitives |
boardwalk::peer |
Outbound peer client and inbound peer acceptor |
boardwalk::server |
Boardwalk::new()…listen() builder |
The #[device] and #[transition] proc macros ship in the separate
boardwalk-macros crate (a Rust requirement — proc-macro crates can't
live alongside non-macro code) and are re-exported by boardwalk.
Docs
- Getting started — install, write a driver, run the server, talk to it.
- Devices —
Devicetrait, properties, streams, scouts, persistence. - Peers — reverse-tunnel hub ↔ cloud setup.
- CaQL — query DSL reference.
License
Apache-2.0. See LICENSE.