team-builder

command
v0.88.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 15 Imported by: 0

README

team-builder

A Pokémon team builder whose team lives in the visitor's browser. It is the example for core-ui/localdb and framework/localentity.

go run ./examples/team-builder
# open http://localhost:8093
  • team.go declares the database and the members entity: three core/schema fields, ordered by level, at most six records.
  • screens.go renders the page from framework/ui only: a ui.Form wrapped by Members.Form, and a ui.Grid of ui.Cards from Members.List.
  • There is no database, no handler, and no JavaScript in the app. The localentity behaviour saves the form into IndexedDB and renders the team from it.

Open two tabs: a save, an edit or a release in one shows up in the other. Reload: the team is still there. Clear site data: it is gone.

browser_test.go drives all of that in Chromium. Set TEAM_BUILDER_SHOTS=<dir> to also write screenshots (light, dark, desktop, phone).

Documentation

Overview

Package main is the dogfood example for core-ui/localdb and framework/localentity: a Pokémon team builder whose team lives in the visitor's browser. There is no database, no account, and no request per change: the server renders the page once, and the localentity behaviour saves the form into IndexedDB and renders the team from it. Open a second tab and both stay in step.

Jump to

Keyboard shortcuts

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