A fresh take on Go web development

Cook up web pages with Go

Combine Go frontmatter with html/template markup in a single .gastro file. The compiler generates type-safe code with automatic file-based routing.

Why Gastro?

Everything you need for productive server-rendered Go web development. No magic, no surprises.

Type-Safe Components

Define Props as Go structs. The compiler checks every prop at build time. No runtime surprises.

Go Frontmatter

Server-side Go code and HTML templates live in one file. Uppercase variables are automatically exported.

LSP & Editor Support

Full language server with completions, diagnostics, and go-to-definition. Extensions for VS Code, Neovim, and Zed.

Single Binary Deploy

Templates and static assets are embedded at build time. Zero runtime dependencies. Ship one file anywhere.

SSE & Real-time

Built-in Server-Sent Events with Datastar integration. Type-safe component rendering for SSE handlers.

Idiomatic Go

Standard Go syntax you already know. html/template, net/http, go:embed — no new language to learn, full type-safety throughout.

Quick Start

Get a Gastro project running in under a minute.

Write a component

---
type Props struct {
    Title  string
    Author string
}

p := gastro.Props()
Title := p.Title
Author := p.Author
---
<article>
    <h2>{{ .Title }}</h2>
    <p>By {{ .Author }}</p>
</article>

Develop

# Start the dev server
gastro dev

# Watches for changes, rebuilds,
# and restarts automatically.
# Template changes are hot-reloaded.

Deploy

# Build a single binary
gastro build

# Templates and static assets are
# embedded. Ship one file anywhere.
./app