Introduction to irgo

irgo is a hypermedia-driven application framework that uses Go as a runtime kernel with Datastar. Build native iOS, Android, and desktop apps using Go, HTML, and Datastar - 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. Datastar handles interactivity using Server-Sent Events (SSE) to stream HTML updates to the browser. 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 → Datastar Request → Go Handler → SSE Response → DOM Morph

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/router")func Hello(ctx *router.Context) error {    var signals struct {        Name string `json:"name"`    }    ctx.ReadSignals(&signals)    if signals.Name == "" {        signals.Name = "World"    }    return ctx.SSE().PatchTempl(templates.Greeting(signals.Name))}
templates/greeting.templ
package templatestempl Greeting(name string) {    <div id="greeting" class="greeting" data-signals="{name: ''}">        <h1>Hello, { name }!</h1>        <input            type="text"            data-bind:name            placeholder="Enter a name"        />        <button data-on:click="@get('/hello')">Greet</button>    </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, Datastar integration, and SSE responses.

Next Steps

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