From cold machine to a running app in four minutes.
Install the CLI, scaffold an app, declare an entity, run it. Every command in this guide is real. Paste it into a terminal and it works.
- Prereqs
- Go 1.26+, git
- OS
- macOS, Linux, Windows (WSL)
- Storage
- SQLite by default, Postgres opt-in
- Time
- ~4 minutes
Install
~30sOne binary covers scaffold, migrate, dev, build, test, and the doc browser. Get it from GitHub:
Make sure $GOPATH/bin (or ~/go/bin) is in your PATH. Run echo $PATH and add the missing entry to your shell rc.
Scaffold
~45sScaffold a new project. It writes main.go, a sample posts entity in entities/entities.go, a home screen in screens.go at the root, a versioned migration, DESIGN.md, gofastr.isolation.yml, and the agent onboarding files (AGENTS.md + agents/, CLAUDE.md), then initializes git.
Open the scaffolded main.go. It's short, it's yours, and every registration in it is plain Go. Read it.
The entity
~60sThe scaffold already declared one. Open entities/entities.go. One declaration is the table, REST CRUD, validation, an OpenAPI spec, and a typed query builder:
app.Entity("posts", entity.EntityConfig{ Fields: []schema.Field{ {Name: "title", Type: schema.String, Required: true}, {Name: "body", Type: schema.Text}, {Name: "published", Type: schema.Bool}, }, Exposure: &entity.ExposureConfig{CRUD: boolPtr(true)},})
The matching versioned migration is next to it in the same file. gofastr docs migrations covers how those run.
Run it
~60sResolve dependencies once, then start the dev server. It rebuilds on save, reloads the browser, and hands your coding agent the app over MCP.
Open localhost:8080. The scaffolded home screen renders. Then hit the API from a second terminal:
That 401 is the point: auto-CRUD refuses anonymous requests unless you opt out. Add Public: true to the entity, save, and the dev server rebuilds. The same curl now answers {"data":[]}. Wiring real login instead is the auth battery (gofastr docs auth).
First page
~60sAdd a second server-rendered page. A screen is a Go struct whose Render returns the markup. The scaffolded home screen in screens.go is the pattern:
type AboutScreen struct{}func (s *AboutScreen) ScreenTitle() string { return "About" }func (s *AboutScreen) Render() render.HTML { return ui.PageHeader(ui.PageHeaderConfig{Title: "About"})}
Register it in main.go next to the home screen: site.Register("/about", &AboutScreen{}, nil). Save, and the dev server serves it.
Run `gofastr docs` to browse all embedded docs offline, including entity-declarations, query-dsl, and hooks.
What you have
nowFour minutes in, this is on disk and running:
Running, on disk, yours
- A server-rendered home screen (plus yours from step 5)
- A posts entity: REST CRUD, session-gated by default
- A versioned SQL migration, already applied
- An OpenAPI 3 spec (auth-gated; Swagger UI at /api/docs/)
- MCP under gofastr dev: posts_list/posts_create plus app_routes and framework_docs_search, so your coding agent reads the running app
- AGENTS.md + agents/ + DESIGN.md, generated for the agent you build with