Now with Desktop Support

Native Apps with
Go + HTMX

Build native iOS, Android, and desktop apps using Go, HTML, and HTMX. The richness of a webapp in a native app. No JavaScript frameworks required.

$go install github.com/stukennedy/irgo/cmd/irgo@latest

One Codebase. Every Platform.

Write your app logic once in Go. Deploy everywhere.

📱

iOS

Native iOS apps via gomobile

🤖

Android

Native Android apps via gomobile

🖥️

Desktop

macOS, Windows, Linux with webview

🌐

Web

Standard HTTP server for browsers

Why irgo?

The hypermedia approach to native app development

Go-Powered Runtime

Write your backend logic in Go. Compile to native mobile frameworks or desktop apps with full access to the Go ecosystem.

🔄

HTMX for Interactivity

Use HTMX's hypermedia approach instead of complex JavaScript frameworks. Return HTML, not JSON. Simple and powerful.

🎨

Type-Safe Templates

Use templ for compile-time checked HTML templates. Catch errors at build time, not runtime. Full Go type safety.

📦

Virtual HTTP (Mobile)

No network sockets on mobile. Requests are intercepted and handled directly by Go in-process. Fast and secure.

🔥

Hot Reload Development

Edit Go and templ code and see changes instantly. Full hot reload support for rapid development.

🛠️

Powerful CLI

Create, develop, and build projects with simple commands. irgo new, irgo dev, irgo build - that's it.

Simple, Expressive Code

Build interactive UIs with Go handlers and templ templates

Handler

handlers/todos.go
string">"keyword">func CreateTodo(ctx *router.Context) (string, error) {
    title := ctx.FormValue(string">"title")
    string">"keyword">if title == string">"" {
        string">"keyword">return string">"", ctx.BadRequest(string">"Title required")
    }

    todo := db.CreateTodo(title)

    // Return HTML fragment - HTMX appends it
    string">"keyword">return renderer.Render(templates.TodoItem(todo))
}

Template

templates/todos.templ
templ TodoItem(todo Todo) {
    <attr">class="tag">div attr">id={ "todo-" + todo.ID } attr">class="todo-item">
        <attr">class="tag">input
            attr">type="checkbox"
            checked?={ todo.Done }
            attr">hx-post={ "/todos/" + todo.ID + "/toggle" }
            attr">hx-target={ "#todo-" + todo.ID }
            attr">hx-swap="outerHTML"
        />
        <attr">class="tag">span attr">class={ templ.KV("done", todo.Done) }>
            { todo.Title }
        </attr">class="tag">span>
        <attr">class="tag">button
            attr">hx-delete={ "/todos/" + todo.ID }
            attr">hx-swap="delete"
            attr">hx-confirm="Delete this todo?"
        >×</attr">class="tag">button>
    </attr">class="tag">div>
}

How It Works

Different architectures optimized for each platform

Mobile Architecture

┌─────────────────────────────────────────┐ │ Mobile App │ │ ┌─────────────────────────────────┐ │ │ │ <span class="highlight">WebView (HTMX)</span> │ │ │ │ HTML rendered by Go templates │ │ │ └──────────────┬──────────────────┘ │ │ │ │ │ ┌──────────────▼──────────────────┐ │ │ │ <span class="highlight">Native Bridge</span> (Swift/Kotlin) │ │ │ │ Intercepts irgo:// requests │ │ │ └──────────────┬──────────────────┘ │ │ │ │ │ ┌──────────────▼──────────────────┐ │ │ │ <span class="highlight">Go Runtime</span> (gomobile) │ │ │ │ Router + Templates + Logic │ │ │ └─────────────────────────────────┘ │ └─────────────────────────────────────────┘

Desktop Architecture

┌─────────────────────────────────────────┐ │ Desktop App │ │ ┌─────────────────────────────────┐ │ │ │ <span class="highlight">Native Webview Window</span> │ │ │ │ (Chromium/WebKit) │ │ │ │ Navigates to localhost:PORT │ │ │ └──────────────┬──────────────────┘ │ │ │ │ │ ┌──────────────▼──────────────────┐ │ │ │ <span class="highlight">Go HTTP Server</span> │ │ │ │ Page Routes (Templ → HTML) │ │ │ │ API Routes (JSON) │ │ │ │ Static Assets (/static/*) │ │ │ └─────────────────────────────────┘ │ └─────────────────────────────────────────┘

Platform Comparison

Choose the right mode for your target platform

AspectMobile (iOS/Android)DesktopWeb
HTTPVirtual (no sockets)Real localhost serverReal HTTP server
Bridgegomobile + native codeNone (direct HTTP)None
Entry Pointmain.gomain_desktop.gomain.go (serve)
Build Tag!desktopdesktop!desktop
CGO RequiredNoYes (webview)No

Ready to Build?

Get started in minutes. Create your first irgo app and deploy to any platform.