MCPcopy Index your code
hub / github.com/maxence-charriere/go-app

github.com/maxence-charriere/go-app @v11.0.4 sqlite

repository ↗ · DeepWiki ↗ · release v11.0.4 ↗
16,995 symbols 48,396 edges 144 files 7,737 documented · 46%
README

go-app

<a href="https://github.com/maxence-charriere/go-app/actions"><img src="https://github.com/maxence-charriere/go-app/actions/workflows/build.yml/badge.svg?branch=master" alt="GitHub actions"></a>
<a href="https://goreportcard.com/report/github.com/maxence-charriere/go-app"><img src="https://goreportcard.com/badge/github.com/maxence-charriere/go-app" alt="Go Report Card"></a>
<a href="https://GitHub.com/maxence-charriere/go-app/releases/"><img src="https://img.shields.io/github/release/maxence-charriere/go-app.svg" alt="GitHub release"></a>
<a href="https://pkg.go.dev/github.com/maxence-charriere/go-app/v11/pkg/app"><img src="https://img.shields.io/badge/dev-reference-007d9c?logo=go&logoColor=white&style=flat" alt="pkg.go.dev docs"></a>
<a href="https://twitter.com/jonhymaxoo"><img alt="Twitter URL" src="https://img.shields.io/badge/twitter-@jonhymaxoo-35A9F8?logo=twitter&style=flat"></a>
<a href="https://opencollective.com/go-app" alt="Financial Contributors on Open Collective"><img src="https://opencollective.com/go-app/all/badge.svg?label=open+collective&color=4FB9F6" /></a>

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 mod init
go get -u github.com/maxence-charriere/go-app/v11/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].

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]

Extension points exported contracts — how you extend this code

Item (Interface)
Item is the interface that describes a cacheable item. [9 implementers]
pkg/cache/cache.go
Wrapper (Interface)
Wrapper is implemented by types that are backed by a JavaScript value. [7 implementers]
pkg/app/js.go
IBase (Interface)
IBase is the interface that describes a component that serves as a base for a content. [7 implementers]
pkg/ui/base.go
Command (Interface)
Command is the interface that describes a command. [1 implementers]
pkg/cli/cli.go
Backend (Interface)
Backend is the interface that describes an analytics backend that sends analytics for a defined provider. [1 implementers]
pkg/analytics/analytics.go
Cache (Interface)
Cache is the interface that describes a cache. [2 implementers]
pkg/cache/cache.go
Mounter (Interface)
Mounter represents components that require initialization or setup actions when they are integrated into the DOM. By imp [14 …
pkg/app/component.go
IIcon (Interface)
IIcon is the interface that describes an icon. [2 implementers]
pkg/ui/icon.go

Core symbols most depended-on inside this repo

setAttr
called by 2890
pkg/app/js.go
Equal
called by 338
pkg/app/js.go
Title
called by 297
pkg/app/page.go
WithTag
called by 188
pkg/logs/logs.go
Class
called by 164
pkg/ui/flow.go
New
called by 162
pkg/errors/errors.go
newIndexLink
called by 161
docs/src/index-link.go
Contains
called by 133
pkg/app/storage.go

Shape

Method 15,833
Function 744
Struct 245
Interface 154
TypeAlias 13
FuncType 4
Class 2

Languages

Go99%
TypeScript1%

Modules by API surface

pkg/app/html_gen.go15,192 symbols
pkg/app/html_gen_test.go110 symbols
pkg/app/page.go86 symbols
pkg/app/js_wasm.go73 symbols
pkg/app/js.go60 symbols
pkg/app/js_nowasm.go57 symbols
docs/wasm_exec.js51 symbols
pkg/app/node.go48 symbols
pkg/app/component.go40 symbols
pkg/app/context.go34 symbols
pkg/ui/shell.go32 symbols
pkg/ui/adsense.go31 symbols

Dependencies from manifests, versioned

github.com/SherClockHolmes/webpush-gov1.4.0 · 1×
github.com/gomarkdown/markdownv0.0.0-2026041712420 · 1×
github.com/pmezard/go-difflibv1.0.0 · 1×
golang.org/x/cryptov0.50.0 · 1×
golang.org/x/netv0.53.0 · 1×
gopkg.in/yaml.v3v3.0.0-2020031310205 · 1×

For agents

$ claude mcp add go-app \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact