How wailsapp/wails works
Wails is a Go framework and toolchain for building desktop applications that combine Go backends with web frontends in a native webview. The primary workflow is to create a project from a frontend template, bind Go methods for JavaScript, and run the application through the native frontend. The repository contains stable v2 and beta v3 lines; the graph emphasizes v2 runtime components and includes v3’s CLI entry point. Some connections reflect README-level capabilities rather than inspected call sites.
Main entry points: application.go Application API · main.go v2 CLI · app.go Application core · frontend.go Frontend host
Components 18
Project creation
- Frontend templates
v2/pkg/templates/templates.go
Application runtime
- Application API
v2/pkg/application/application.go - Application core
v2/internal/app/app.go - Go method bindings
v2/internal/binding/binding.go - Go runtime API
v2/pkg/runtime/runtime.go - Menus and callbacks
v2/internal/menumanager/menumanager.go
Web and native frontend
- JavaScript runtime
v2/internal/frontend/runtime/desktop/main.js - JavaScript calls
v2/internal/frontend/runtime/desktop/calls.js - JavaScript events
v2/internal/frontend/runtime/desktop/events.js - Frontend asset server
v2/pkg/assetserver/assetserver.go - Frontend host
v2/internal/frontend/frontend.go - Native platform frontends
v2/internal/frontend/desktop/desktop_darwin.go
Developer tooling
- v2 CLI
v2/cmd/wails/main.go - v3 CLI
v3/cmd/wails3/main.go - Project initialization
v2/cmd/wails/init.go - Build and bundle
v2/cmd/wails/build.go - CLI commands
v2/cmd/wails/main.go
Other components
- Go developer
Connections 19
- Go developer → v2 CLI: runs commands
v2/cmd/wails/main.go - Go developer → v3 CLI: runs commands
v3/cmd/wails3/main.go - v2 CLI → Project initialization: dispatches init
v2/cmd/wails/main.go - v2 CLI → CLI commands: dispatches commands
v2/cmd/wails/main.go - Project initialization → Frontend templates: creates project
- Go developer → Frontend templates: chooses frontend
README.md - v2 CLI → Build and bundle: dispatches build
v2/cmd/wails/main.go - Go developer → Application API: configures app
README.md - Application API → Application core: creates app
v2/pkg/application/application.go - Application core → Frontend host: uses frontend
v2/internal/app/app.go - Application core → Menus and callbacks: manages menus
v2/internal/app/app.go - Application API → Go method bindings: registers Go values
README.md - JavaScript runtime → JavaScript calls: exposes calls
v2/internal/frontend/runtime/desktop/main.js - JavaScript runtime → JavaScript events: exposes events
v2/internal/frontend/runtime/desktop/main.js - Go developer → JavaScript calls: calls Go methods
README.md - Application API → Go runtime API: provides Go APIs
README.md - Frontend host → Frontend asset server: serves frontend
- Frontend host → Native platform frontends: selects platform host
- Native platform frontends → JavaScript runtime: hosts runtime