Build reactive html apps in Go
A Go toolkit to build reactive web interfaces using: Go, html/template and alpinejs.
The Fir toolkit is designed for Go developers with moderate html/css & js skills who want to progressively build reactive web apps without mastering complex web frameworks. It includes a Go library and an Alpine.js plugin. Fir can be used for building passable UIs with low effort and is a good fit for internal tools, interactive forms and real-time feeds.
Fir has a simple and predictable server and client API with only one new (and weird) expression:
<div @fir:create-chirp:ok::chirp="$fir.prependEl()">
...
</div>
Fir’s magic event handling expression fir:event-name:event-state::template-name
piggybacks on alpinejs event binding syntax to declare html/templates to be re-rendered on the server. Once accustomed to this weirdness, Fir unlocks a great deal of productivity while adhering to web standards to enable rich and interactive apps
Fir sits somewhere between Phoenix Liveview and htmx in terms of capabilities. It's event-driven like Liveview but, instead of providing atomic UI diffs, it returns html fragments like htmx. Fir is closer to liveview since it ships with a server library. Similar to Liveview, Fir has the concept of routes: Fir Route, Liveview Router, loading data on page load: Fir OnLoad, Liveview onmount and handling user events: Fir OnEvent, Liveview handle_event.
Feature Highlights:
You don't need this to get started but the the cli can be used to generate a simple quickstart boilerplate:
go run github.com/livefir/cli gen project -n quickstart // generates a folder named quickstart
cd quickstart
go run main.go
open localhost:9867
go run github.com/livefir/cli gen route -n index // generates a new route