A full-stack example for the Oxide browser: a Rust HTTP backend exchanges data with a WebAssembly frontend using Protocol Buffers over HTTP.
┌─────────────────────────┐ HTTP + Protobuf ┌──────────────────────┐
│ WASM Frontend │ ◄──────────────────────────────► │ Rust Backend │
│ (oxide-sdk guest) │ GET/POST/DELETE /api/notes │ (axum server) │
│ renders on canvas │ │ in-memory store │
└─────────────────────────┘ └──────────────────────┘
The frontend performs a full CRUD cycle on startup:
- GET
/api/notes— fetch initial notes - POST
/api/notes— create a new note (protobuf body) - POST
/api/notes/2/toggle— toggle a note's done status - DELETE
/api/notes/3— delete a note - GET
/api/notes— fetch final state
All request and response bodies use the Protocol Buffers binary wire format
(the same ProtoEncoder/ProtoDecoder from oxide-sdk).
cargo run -p fullstack-notes-backend
# => notes-server listening on http://0.0.0.0:3333cargo build -p fullstack-notes-frontend --target wasm32-unknown-unknown --releaseThe compiled module is at:
target/wasm32-unknown-unknown/release/fullstack_notes_frontend.wasm
cargo run -p oxideOpen the .wasm file via File → Open (or drag-and-drop).
Both sides agree on the same field numbers (no .proto files needed):
Note {
1: uint32 id
2: string title
3: bool done
4: uint64 created_at
}
NoteList {
1: repeated Note (sub-messages)
2: uint32 total
3: uint32 done_count
}
CreateNoteRequest {
1: string title
}