High level PWA creation library

surdeus 1f2386d9c8 feat: WE ARE HERE. 10 달 전
.github 4af7476950 Update build.yml 1 년 전
analytics 1f2386d9c8 feat: WE ARE HERE. 10 달 전
app 1f2386d9c8 feat: WE ARE HERE. 10 달 전
cache 7fe533fd71 Forking. 11 달 전
cli 1f2386d9c8 feat: WE ARE HERE. 10 달 전
cmd 1f2386d9c8 feat: WE ARE HERE. 10 달 전
docs 1f2386d9c8 feat: WE ARE HERE. 10 달 전
errors 7fe533fd71 Forking. 11 달 전
logs 1f2386d9c8 feat: WE ARE HERE. 10 달 전
ui 1f2386d9c8 feat: WE ARE HERE. 10 달 전
.gitattributes 5e9fbce475 Refactor window wip 6 년 전
.gitignore 46d8d64e02 feat: better example. 10 달 전
code-of-conduct.md 7fe533fd71 Forking. 11 달 전
contibuting.md 7fe533fd71 Forking. 11 달 전
go.mod 1f2386d9c8 feat: WE ARE HERE. 10 달 전
go.sum 1f67191740 update doc 1 년 전
html-mount.new.txt 11f7e242ea v9.6.0 (#740) 2 년 전
license.txt 7fe533fd71 Forking. 11 달 전
makefile 7fe533fd71 Forking. 11 달 전
readme.md 7fe533fd71 Forking. 11 달 전

readme.md

go-app

GitHub actions Go Report Card GitHub release pkg.go.dev docs Twitter URL

Go-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)

go-app documentation

Install

go-app requirements:

  • Go 1.18 or newer
  • Go module

    go mod init
    go get -u github.com/maxence-charriere/go-app/v9/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 != "",
				app.Text(h.name),
			).Else(
				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("/", &hello{})
	app.Route("/hello", &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].

Financial Contributors

Become a financial contributor and help us sustain go-app development. [Contribute]

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]