Introduction to irgo

irgo is a hypermedia-driven application framework that uses Go as a runtime kernel with HTMX. Build native iOS, Android, and desktop apps using Go, HTML, and HTMX - no JavaScript frameworks required.

The Hypermedia Approach

Unlike traditional mobile and desktop frameworks that require learning platform-specific languages and UI toolkits, irgo takes a different approach: HTML is your UI layer.

Your Go code renders HTML templates. HTMX handles interactivity by making requests back to your Go handlers, which return HTML fragments. The framework handles the rest - whether that's routing requests through a native bridge on mobile or serving them over HTTP on desktop.

The irgo pattern
User Interaction → HTMX Request → Go Handler → Templ Template → HTML Response → DOM Update

Key Features

Platform Support

irgo supports four deployment modes:

PlatformArchitectureBuild Tag
iOSVirtual HTTP via gomobile bridge!desktop
AndroidVirtual HTTP via gomobile bridge!desktop
DesktopReal HTTP server + native webviewdesktop
WebStandard HTTP server!desktop

Prerequisites

Before getting started, make sure you have:

Platform-specific requirements

Mobile: gomobile, and Xcode (iOS) or Android Studio (Android)
Desktop: CGO enabled with a C compiler (Xcode CLI on macOS, MinGW on Windows, GCC on Linux)

Quick Example

Here's a taste of what irgo code looks like:

handlers/hello.go
package handlersimport (    "myapp/templates"    "github.com/stukennedy/irgo/pkg/render"    "github.com/stukennedy/irgo/pkg/router")func Hello(ctx *router.Context) (string, error) {    name := ctx.Query("name")    if name == "" {        name = "World"    }    return renderer.Render(templates.Greeting(name))}
templates/greeting.templ
package templatestempl Greeting(name string) {    <div class="greeting">        <h1>Hello, { name }!</h1>        <form hx-get="/hello" hx-target="closest .greeting" hx-swap="outerHTML">            <input type="text" name="name" placeholder="Enter a name" />            <button type="submit">Greet</button>        </form>    </div>}

AI Coding Assistants

If you're using an AI coding assistant (like Claude, Cursor, or GitHub Copilot), point it to our llms.txt file. This provides comprehensive instructions for writing irgo applications, including handler patterns, templ syntax, HTMX integration, and WebSocket usage.

Next Steps

Ready to build your first irgo app? Head to the Quick Start guide.