Get started – Go
fuaran-go is the headless backend / orchestrator host: a stdlib-only Go
implementation of the canonical wire format. A Go service or AI orchestrator
authors a UI tree as typed data, encodes it byte-identically to every other host,
and emits complete server-side HTML. It is a library, not a runtime:
render(tree, data) → bytes is a pure function – no frontend codebase, no UI
session state. Live interactivity is a conformant client's job.
Install
go get github.com/fuaran-ui/fuaran-go
The module path is the repo – nothing to configure once the repo is public.
Author a tree
Go has no sum types, so a node's kind is a $type-tagged wire.Obj and the
closed vocabularies are modelled structurally. wire.Str / wire.Int are the
scalar wire values; a bare string in a text slot is a Literal.
import "github.com/fuaran-ui/fuaran-go/wire"
tree := wire.Node{
ID: "root",
Kind: wire.Obj{Tag: "Box", Fields: map[string]wire.Value{
"children": wire.Arr{
wire.Node{ID: "title", Kind: wire.Obj{Tag: "Heading", Fields: map[string]wire.Value{
"level": wire.Int(2),
"text": wire.Str("Channel performance"),
"variant": wire.Str("Standard"),
}}},
wire.Node{ID: "note", Kind: wire.Obj{Tag: "Markdown", Fields: map[string]wire.Value{
"text": wire.Str("**Hello** from a Fuaran tree."),
}}},
},
"layout": wire.Obj{Tag: "Auto"},
"role": wire.Str("Dashboard"),
}},
Extras: map[string]wire.Value{
"accessibility": wire.Obj{Fields: map[string]wire.Value{"role": wire.Str("main")}},
},
}
Encode to canonical wire JSON
wireJSON, err := wire.EncodeNode(tree)
// canonical JSON – byte-identical to the F#, TypeScript, and Python hosts
Render server-side HTML
Go emits complete static output – the renderer resolves compute at render time, so a page's values are correct before any JS runs:
import "github.com/fuaran-ui/fuaran-go/renderer"
html := renderer.RenderHTML(tree, nil)
// a body-fragment HTML string; renderer.RenderWithIslands adds partial hydration
The tree you just built
Rendered by this very site from the exact JSON EncodeNode produces – with a
one-click link into the playground:
Channel performance
Hello from a Fuaran tree.
{"accessibility":{"role":"main"},"id":"root","kind":{"$type":"Box","children":[{"id":"title","kind":{"$type":"Heading","level":2,"text":"Channel performance","variant":"Standard"}},{"id":"note","kind":{"$type":"Markdown","text":"**Hello** from a Fuaran tree."}}],"layout":{"$type":"Auto"},"role":"Dashboard"}}
Next
- Serve it – write
RenderHTML's output into a page, or useRenderWithIslandsfor partial hydration; a conformant client makes the interactive regions live. - Drive it live – the
serverdrivenpackage holds the tree and streams canonicalTreeOpframes over SSE or a stdlib WebSocket to a thin generic client; the Go host authors no client code. - On another stack? The same tree authors in F#, TypeScript, Python, or Rust – byte-identical on the wire.
- See the component reference and the guide.