maxence-charriere / go-app
A package to build progressive web apps with Go programming language and WebAssembly.
AI Architecture Analysis
This repository is indexed by RepoMind. By analyzing maxence-charriere/go-app in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.
Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.
Repository Summary (README)
PreviewGo-app is a package for building progressive web apps (PWA) with the Go programming language (Golang) and WebAssembly (Wasm).
Shaping a UI is done by using a declarative syntax that creates and compose HTML elements only by using the Go programing language.
It uses Go HTTP standard model.
An app created with go-app can out of the box runs in its own window, supports offline mode, and is SEO friendly.
Documentation (built with go-app)
Install
go-app requirements:
go mod init
go get -u github.com/maxence-charriere/go-app/v10/pkg/app
Declarative syntax
Go-app uses a declarative syntax so you can write reusable component-based UI elements just by using the Go programming language.
Here is a Hello World component that takes an input and displays its value in its title:
type hello struct {
app.Compo
name string
}
func (h *hello) Render() app.UI {
return app.Div().Body(
app.H1().Body(
app.Text("Hello, "),
app.If(h.name != "", func() app.UI {
return app.Text(h.name)
}).Else(func() app.UI {
return app.Text("World!")
}),
),
app.P().Body(
app.Input().
Type("text").
Value(h.name).
Placeholder("What is your name?").
AutoFocus(true).
OnChange(h.ValueTo(&h.name)),
),
)
}
Standard HTTP
Apps created with go-app complies with Go standard HTTP package interfaces.
func main() {
// Components routing:
app.Route("/", func() app.Composer { return &hello{} })
app.Route("/hello", func() app.Composer { return &hello{} })
app.RunWhenOnBrowser()
// HTTP routing:
http.Handle("/", &app.Handler{
Name: "Hello",
Description: "An Hello World! example",
})
if err := http.ListenAndServe(":8000", nil); err != nil {
log.Fatal(err)
}
}
Getting started
Read the Getting Started document.
Built with go-app
Contributors
Code Contributors
This project exists thanks to all the people who contribute. [Contribute].
<a href="https://github.com/maxence-charriere/go-app/graphs/contributors"><img src="https://opencollective.com/go-app/contributors.svg?width=890&button=false" /></a>
Financial Contributors
Become a financial contributor and help us sustain go-app development. [Contribute]
Individuals
<a href="https://opencollective.com/go-app"><img src="https://opencollective.com/go-app/individuals.svg?width=890"></a>
Organizations
Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]
<a href="https://opencollective.com/go-app/organization/0/website"><img src="https://opencollective.com/go-app/organization/0/avatar.svg"></a> <a href="https://opencollective.com/go-app/organization/1/website"><img src="https://opencollective.com/go-app/organization/1/avatar.svg"></a> <a href="https://opencollective.com/go-app/organization/2/website"><img src="https://opencollective.com/go-app/organization/2/avatar.svg"></a> <a href="https://opencollective.com/go-app/organization/3/website"><img src="https://opencollective.com/go-app/organization/3/avatar.svg"></a> <a href="https://opencollective.com/go-app/organization/4/website"><img src="https://opencollective.com/go-app/organization/4/avatar.svg"></a> <a href="https://opencollective.com/go-app/organization/5/website"><img src="https://opencollective.com/go-app/organization/5/avatar.svg"></a> <a href="https://opencollective.com/go-app/organization/6/website"><img src="https://opencollective.com/go-app/organization/6/avatar.svg"></a> <a href="https://opencollective.com/go-app/organization/7/website"><img src="https://opencollective.com/go-app/organization/7/avatar.svg"></a> <a href="https://opencollective.com/go-app/organization/8/website"><img src="https://opencollective.com/go-app/organization/8/avatar.svg"></a> <a href="https://opencollective.com/go-app/organization/9/website"><img src="https://opencollective.com/go-app/organization/9/avatar.svg"></a>
