A frond in another language

A frond does not have to be TypeScript. A process in Rust, Python or anything else joins the app if it honours three things:

  1. the wire — POST /_fougere/call, JSON-RPC 2.0, method = "address.op" — see the wire format;
  2. the card — rpc.discover answers its card, x-fougere-version: 1;
  3. the errors — a whole FougereError in error.data, its code one of the error codes; the integer -32000 stays JSON-RPC's.

Your app then runs fougere sync against it, rebuilds its entities from the card, and checks data locally with the same rules as for any frond.

demos/rust-frond/ is one, in Rust — one entity, three operations, no entity({...}) anywhere.

demos/rust-frond7 files
Cargo.toml
[package]
name = "telemetry-frond"
version = "0.1.0"
edition = "2021"
publish = false

[dependencies]
axum = "0.8"
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
uuid = { version = "1", features = ["v4"] }
chrono = { version = "0.4", default-features = false, features = ["clock", "std"] }
Built with Fougere and Nuxt, hosted on GitHub Pages.