The Web Framework designed for small applications and embedded/IoT systems where simplicity and efficiency matter:
- Single Binary Deployment - Everything compiles into one executable with embedded resources. Copy and run.
- Efficient Resource Usage - Go's performance and small memory footprint make it perfect for resource-constrained environments.
- Simple Architecture - No external dependencies, databases, or complex build pipelines required.
- Rapid Development - Build complete applications in hours, not days.
Perfect for control panels, monitoring tools, device interfaces, and internal utilities.
go-webglue bridges backend and frontend code. Expose Go struct methods as HTTP APIs, stream real-time events via SSE, and serve optimized static resources with zero configuration.
// Backend: Define your API
type MyApi struct{}
func (api *MyApi) GetUser(id int) (User, error) {
return findUser(id), nil
}// Frontend: Just call it
let user = await api.mymodule.getUser(42);No route definitions. No API contracts. No build steps.
- Getting Started Guide - Build your first app step-by-step
- Architecture Overview - How go-webglue works under the hood
- API Reference - Complete API documentation
- Frontend Guide - Building UIs with webglue.js
- Real-time Events - Server-to-client event streaming
- Authentication - Implementing auth with CallChecker
- Deployment - Production best practices
- Examples - Code samples and patterns
- Automatic API Bridging - Go methods instantly become JavaScript functions
- Real-time Events - Built-in SSE support for live updates
- Zero Build Required - ES modules with automatic import maps
- Smart Resource Handling - Auto-minification, caching, and hot-reload
- Type-Safe Parameters - Automatic JSON marshaling with reflection
- Context Injection - Pass context.Context, custom types, or request data
- Modular Architecture - Organize code into reusable modules
go get github.com/burgrp/go-webglue/pkgCreate your API (main.go)
package main
import (
"embed"
"net/http"
webglue "github.com/burgrp/go-webglue/pkg"
)
//go:embed client/*
var clientResources embed.FS
type HelloApi struct{}
func (api *HelloApi) Greet(name string) string {
return "Hello, " + name + "!"
}
func main() {
handler, _ := webglue.NewHandler(webglue.Options{
Modules: []*webglue.Module{{
Name: "hello",
Resources: &clientResources,
Api: &HelloApi{},
}},
})
http.ListenAndServe(":8080", handler)
}Create your UI (client/home.page.js)
import { api, tags } from "webglue";
let { DIV, BUTTON, TEXT } = tags;
export default {
title: "Hello World",
async render() {
let input, output;
return [
DIV("container", [
TEXT(el => input = el).val("World"),
BUTTON().text("Greet").click(async () => {
let greeting = await api.hello.greet(input.val());
output.text(greeting);
}),
DIV(el => output = el)
])
];
}
}Run it
go run main.go
# Visit http://localhost:8080Go methods are automatically discovered and exposed:
func (api *MyApi) CalculateSum(a, b int) int {
return a + b // Becomes: api.myApi.calculateSum(a, b)
}
func (api *MyApi) GetUserData(userId string) (User, error) {
// JavaScript receives: promise that resolves to User
}Stream data from server to clients:
// Server
updateEvent := webglue.NewEvent("dataChanged")
updateEvent.Emit(newData)// Client
DIV().onMymoduleDataChanged((el, newData) => {
el.text(JSON.stringify(newData));
})Hot-reload without rebuilding:
MYMODULE_DEV=/path/to/client go run main.go
# Edit JS/CSS files and refresh browser - changes appear instantlymyproject/
├── main.go # Backend entry point
├── go.mod
├── client/ # Frontend code (embedded)
│ ├── home.page.js # Main page
│ ├── login.page.js # Additional pages
│ └── styles.css
└── api.go # API implementation
- Internal dashboards and admin interfaces
- IoT control panels with real-time monitoring
- Data visualization with live updates
- API prototyping with quick UI feedback
- Single-binary deployable applications
This project is open source. Check the repository for license details.
- GitHub: github.com/burgrp/go-webglue
- Issues: Report bugs or request features