Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maxence-charriere/go-app
A package to build progressive web apps with Go programming language and WebAssembly.
https://github.com/maxence-charriere/go-app
awesome-go go golang gui pwa ui wasm
Last synced: 2 days ago
JSON representation
A package to build progressive web apps with Go programming language and WebAssembly.
- Host: GitHub
- URL: https://github.com/maxence-charriere/go-app
- Owner: maxence-charriere
- License: mit
- Created: 2016-10-12T00:31:33.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-10-10T06:58:39.000Z (4 months ago)
- Last Synced: 2024-10-29T14:18:37.546Z (4 months ago)
- Topics: awesome-go, go, golang, gui, pwa, ui, wasm
- Language: Go
- Homepage: https://go-app.dev
- Size: 221 MB
- Stars: 7,942
- Watchers: 148
- Forks: 365
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
- awesome-go - maxence-charriere/go-app
- go-awesome - go-app - A WebAssembly framework for building GUI apps using Go, HTML and CSS (Open source library / Desktop Development)
- awesome-list - go-app - charriere | 5029 | (Go)
- awesome-golang-repositories - go-app
- my-awesome - maxence-charriere/go-app - go,go,golang,gui,pwa,ui,wasm pushed_at:2024-12 star:8.1k fork:0.4k A package to build progressive web apps with Go programming language and WebAssembly. (Go)
- StarryDivineSky - maxence-charriere/go-app - app 创建的应用程序可以开箱即用地在自己的窗口中运行,支持离线模式,并且对 SEO 友好。 (前端开发框架及项目 / 其他_文本生成、文本对话)
README
![]()
Go-app is a package for **building progressive web apps (PWA)** with the [Go programming language (Golang)](https://golang.org) and [WebAssembly (Wasm)](https://webassembly.org).
Shaping a UI is done by using a **[declarative syntax](https://go-app.dev/declarative-syntax) that creates and compose HTML elements only by using the Go programing language**.
It **uses [Go HTTP standard](https://golang.org/pkg/net/http) 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)
[![go-app documentation](docs/web/images/go-app.png)](https://go-app.dev)
## Install
**go-app** requirements:
- [Go 1.18](https://golang.org/doc/go1.17) or newer
- [Go module](https://github.com/golang/go/wiki/Modules)```sh
go mod init
go get -u github.com/maxence-charriere/go-app/v10/pkg/app
```## Declarative syntax
Go-app uses a [declarative syntax](https://go-app.dev/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:
```go
type hello struct {
app.Componame 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](https://golang.org/pkg/net/http) package interfaces.
```go
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](https://go-app.dev/getting-started) document**.
## Built with go-app
- [Lofimusic.app](https://lofimusic.app/collegemusic-lonely)
- [Murlok.io](https://murlok.io/)
- [liwasc](https://pojntfx.github.io/liwasc/)
- [go-app Docs](https://go-app.dev/)## Contributors
### Code Contributors
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
### Financial Contributors
Become a financial contributor and help us sustain [go-app](https://github.com/maxence-charriere/go-app) development. [[Contribute](https://opencollective.com/go-app/contribute)]
#### Individuals
#### Organizations
Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/go-app/contribute)]