examples/

directory
v0.86.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2026 License: MIT

README

GoFastr examples

Two kinds of example live here.

Go examples (runnable)

Self-contained Go programs. Run one under the dev server for rebuild-on-save, livereload, and the dev MCP tools your coding agent reads:

cd examples/<name> && gofastr dev        # or: go run ./examples/<name>

Every server example binds through isolation.ListenAddr, so $PORT (injected by gofastr dev and by PaaS runtimes) wins over the example's default port. TestE2E_DevLoop_Examples in cmd/gofastr boots each one under gofastr dev and checks it answers on the address the banner prints. The process module is the exception: it is a stdio child, not a server, so go run it.

Example What it shows
blog Entities in Go + custom endpoints + full-text search; the canonical starter.
meridian The flagship SaaS app (blueprint-generated, then owned): auth + owner-scoped CRUD, scoped API tokens, and a generated customer CLI under meridian/cmd/meridian. Install it with go install ./examples/meridian/cmd/meridian; docs at gofastr docs app-cli.
api-tour The v2 REST API: includes, cursor pagination, batch, SSE.
backoffice The entity admin (battery/admin) behind a demo login.
spa Client-side navigation over server-rendered islands.
static-site Static page serving with the file server.
semantic-demo Semantic search with battery/semantic.
embed-demo Embeddable surfaces: an app and a customer's site on two origins.
processmodule-demo A process-isolated third-party module speaking the moduleproto protocol over stdio. The canonical process-module example and the child the go/no-go gate suite drives end to end.
webmcp-remote-assist Authenticated WebMCP + WebRTC remote support: support-only tool discovery, one typed command behind the manual button and the AI tools, role-filtered realtime state, peer-to-peer camera with server-side signaling only.
rtc-call WebRTC rooms the packaged way: battery/rtc signaling (zero hand-rolled relay), anonymous cookie identity through Authorize, the rtc runtime module with one peer connection per peer, peer-to-peer camera plus chat on a negotiated data channel.
site The framework's live component gallery and reference docs site: every UI component rendered one per page, the hosted examples, and the gofastr-plugins registry rendered from a vendored plugins.json (scripts/vendor-plugins-json.sh refreshes it). Run with cd examples/site && gofastr dev.
layoutlab Tree-layout outlets prototype a shell layout with outlets, a route area, and per-screen/group fills.

Blueprint examples (declarative)

These are gofastr.yml blueprints, no Go. They describe a whole app (entities, screens, nav, seed) declaratively. Generate a runnable project from one with:

cd examples/ecommerce && gofastr generate --from=gofastr.yml
Blueprint Domain
ecommerce The flagship. A complete storefront: 5 related entities, themed UI, custom endpoints, and seed data, declared once in gofastr.yml and emitted as runnable Go. Ships secure-by-default: auth enabled plus owner-scoped orders / order_items. See ecommerce/README.md; flagship_test.go regenerates and boots it end-to-end.
lms Courses, lessons, enrollments.
portfolio Projects + case studies.
project-manager Projects, tasks, teams.
real-estate Listings, agents, inquiries.

Every blueprint here is validated by TestExampleBlueprintsLoad (cmd/gofastr), so a broken one fails CI.

Directories

Path Synopsis
Package main is Acme Tracker's public face: the product's marketing site and help center, built from the layout primitive exactly the way docs/DESIGN-layout-outlets.md's "Ready-made layouts" section draws the site and docs shapes — real pages, real copy, no lab fixtures.
Package main is Acme Tracker's public face: the product's marketing site and help center, built from the layout primitive exactly the way docs/DESIGN-layout-outlets.md's "Ready-made layouts" section draws the site and docs shapes — real pages, real copy, no lab fixtures.
helpdocs
Package helpdocs is acme-site's help center page: the article nav on the left, the article in the middle, the table of contents on the right, and a previous/next pager under the article.
Package helpdocs is acme-site's help center page: the article nav on the left, the article in the middle, the table of contents on the right, and a previous/next pager under the article.
sitefooter
Package sitefooter is acme-site's colophon, built the way siteheader builds the top bar: plain html elements composed here, the look in sitefooter.style.css (an owned style; `gofastr gen styles` writes the class methods in sitefooter_style.gen.go), and every dimension a theme token.
Package sitefooter is acme-site's colophon, built the way siteheader builds the top bar: plain html elements composed here, the look in sitefooter.style.css (an owned style; `gofastr gen styles` writes the class methods in sitefooter_style.gen.go), and every dimension a theme token.
siteheader
Package siteheader is acme-site's top bar, built the way an app builds any piece of chrome the framework does not ship:
Package siteheader is acme-site's top bar, built the way an app builds any piece of chrome the framework does not ship:
Package main is a tour of the v2 API surface added to the framework:
Package main is a tour of the v2 API surface added to the framework:
Command backoffice is a minimal example of the battery/admin entity CRUD admin rendered through a UI host: a few entities, a (demo-grade) login, and admin.New(...) generating the whole back-office with defaults.
Command backoffice is a minimal example of the battery/admin entity CRUD admin rendered through a UI host: a few entities, a (demo-grade) login, and admin.New(...) generating the whole back-office with defaults.
Package ecommerce is GoFastr's declaration-driven flagship example: a complete storefront: five related entities, screens, navigation, custom endpoints, seed data, and a theme, declared once in gofastr.yml and emitted as runnable Go by the CLI:
Package ecommerce is GoFastr's declaration-driven flagship example: a complete storefront: five related entities, screens, navigation, custom endpoints, seed data, and a theme, declared once in gofastr.yml and emitted as runnable Go by the CLI:
app command
Package main demonstrates embeddable surfaces: a GoFastr app handing out a piece of itself to a website it does not control.
Package main demonstrates embeddable surfaces: a GoFastr app handing out a piece of itself to a website it does not control.
Package main is layoutlab, the demo app for the tree-layout outlets prototype.
Package main is layoutlab, the demo app for the tree-layout outlets prototype.
Package main is Meridian, the GoFastr flagship demo, and the design-system completeness canary (CLAUDE.md hard rule 9).
Package main is Meridian, the GoFastr flagship demo, and the design-system completeness canary (CLAUDE.md hard rule 9).
cmd/meridian command
meridian is a terminal client for your app's HTTP API, generated by `gofastr generate cli --binary=meridian`.
meridian is a terminal client for your app's HTTP API, generated by `gofastr generate cli --binary=meridian`.
sitefooter
Package sitefooter is Meridian's colophon, built the way siteheader builds the top bar: plain html elements composed here, the look in meridian-sitefooter.style.css (an owned style; `gofastr gen styles` writes the class methods in meridian-sitefooter_style.gen.go), and every dimension a theme token.
Package sitefooter is Meridian's colophon, built the way siteheader builds the top bar: plain html elements composed here, the look in meridian-sitefooter.style.css (an owned style; `gofastr gen styles` writes the class methods in meridian-sitefooter_style.gen.go), and every dimension a theme token.
siteheader
Package siteheader is Meridian's top bar, built the way an app builds any piece of chrome the framework does not ship:
Package siteheader is Meridian's top bar, built the way an app builds any piece of chrome the framework does not ship:
Package main is the processmodule-demo: a minimal but real third-party module that speaks the moduleproto protocol over stdio.
Package main is the processmodule-demo: a minimal but real third-party module that speaks the moduleproto protocol over stdio.
Package main is the dogfood example for battery/rtc: anonymous users, rooms by name, camera and microphone peer to peer, chat over a negotiated data channel.
Package main is the dogfood example for battery/rtc: anonymous users, rooms by name, camera and microphone peer to peer, chat over a negotiated data channel.
siteheader
Package siteheader is rtc-call's top bar, built the way an app builds any piece of chrome the framework does not ship:
Package siteheader is rtc-call's top bar, built the way an app builds any piece of chrome the framework does not ship:
Package main is a minimal demonstration of the battery/semantic package.
Package main is a minimal demonstration of the battery/semantic package.
docpage
Package docpage is the GoFastr site's article shell: the section nav on the left, the article in the middle, with breadcrumbs above the body and a previous/next pager under it.
Package docpage is the GoFastr site's article shell: the section nav on the left, the article in the middle, with breadcrumbs above the body and a previous/next pager under it.
sitefooter
Package sitefooter is the GoFastr site's colophon, built the way siteheader builds the top bar: plain html elements composed here, the look in docsite-footer.style.css (an owned style; `gofastr gen styles` writes the class methods in docsite-footer_style.gen.go), and every dimension a theme token — the wider spacing step (64px) this page's rhythm needs is docsite-footer.tokens.css's --spacing-section, and the grid sits at the site's wide cap (--size-wide-width, 1240px), the same measure the header and page sections align to.
Package sitefooter is the GoFastr site's colophon, built the way siteheader builds the top bar: plain html elements composed here, the look in docsite-footer.style.css (an owned style; `gofastr gen styles` writes the class methods in docsite-footer_style.gen.go), and every dimension a theme token — the wider spacing step (64px) this page's rhythm needs is docsite-footer.tokens.css's --spacing-section, and the grid sits at the site's wide cap (--size-wide-width, 1240px), the same measure the header and page sections align to.
siteheader
Package siteheader is the GoFastr site's top bar, built the way an app builds any piece of chrome the framework does not ship:
Package siteheader is the GoFastr site's top bar, built the way an app builds any piece of chrome the framework does not ship:
Package main is Acme Tracker, the layout showcase as a real app: a small issue tracker built only from the framework's components and typed theme, where every tree-layout feature appears as ordinary product behaviour — no outlined boxes, no marker strings.
Package main is Acme Tracker, the layout showcase as a real app: a small issue tracker built only from the framework's components and typed theme, where every tree-layout feature appears as ordinary product behaviour — no outlined boxes, no marker strings.
appbar
Package appbar is the tracker's application bar, built the way an app builds any piece of chrome the framework does not ship:
Package appbar is the tracker's application bar, built the way an app builds any piece of chrome the framework does not ship:
Package main is the reference example for authenticated WebMCP plus WebRTC remote support: one Go binary, one origin, two roles.
Package main is the reference example for authenticated WebMCP plus WebRTC remote support: one Go binary, one origin, two roles.
siteheader
Package siteheader is remote assist's top bar, built the way an app builds any piece of chrome the framework does not ship:
Package siteheader is remote assist's top bar, built the way an app builds any piece of chrome the framework does not ship:

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL