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.
User Interaction → HTMX Request → Go Handler → Templ Template → HTML Response → DOM UpdateKey Features
- Go-Powered Apps: Write your backend logic in Go, compile to native mobile frameworks or desktop apps
- HTMX for Interactivity: Use HTMX's hypermedia approach instead of complex JavaScript
- Cross-Platform: Single codebase for iOS, Android, desktop (macOS, Windows, Linux), and web
- Virtual HTTP (Mobile): No network sockets - requests are intercepted and handled directly by Go
- Native Webview (Desktop): Real HTTP server with native webview window
- Type-Safe Templates: Use templ for compile-time checked HTML templates
- Hot Reload Development: Edit Go/templ code and see changes instantly
Platform Support
irgo supports four deployment modes:
| Platform | Architecture | Build Tag |
|---|---|---|
| iOS | Virtual HTTP via gomobile bridge | !desktop |
| Android | Virtual HTTP via gomobile bridge | !desktop |
| Desktop | Real HTTP server + native webview | desktop |
| Web | Standard HTTP server | !desktop |
Prerequisites
Before getting started, make sure you have:
- Go 1.21 or later
- templ:
go install github.com/a-h/templ/cmd/templ@latest - air (for hot reload):
go install github.com/air-verse/air@latest
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:
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))}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.
