Learn Globetrotter
On this page
For a developer who has been handed the Rally repository and globetrotter-0.3.0.zip, has never heard of Globetrotter, and has an evening. You know JavaScript or TypeScript and some Python. You may work by hand or with Claude Code. Every step in these pages was run by the person who wrote them, on one Mac (Node 22, uv 0.13, Python 3.12 in the project, an empty npm cache, ports other than the defaults); the text says so where a step was not run. Nobody has yet followed them cold.
What it is, in five sentences
- Globetrotter keeps what a person sees in one JSON file,
designs/<app>.design.json(pages made of Material 3 widgets), and what the server does in another,designs/<app>.service.json(entities, operations, who may call what); you edit them in a studio in the browser, or an agent edits them through tools. npx globetrotter syncwrites ordinary files from them: Next.js pages (frontend/src/generated/*.tsx) and a FastAPI backend (backend/packages/<app>_contract,_core,_fastapi); you can read every line, they are committed in your repository, and each carries a hash header.- What is yours, and never overwritten once you edit it: the bindings (
frontend/src/bindings/*.ts: data, calls, handlers), the backend rules (backend/packages/<app>_impl/), your tests, the database migrations (written once, applied by you), and the config files. - When the two sides disagree, nothing wins silently:
sync --checkanddoctorfail and name the file and line; a hand-edited generated file is copied to.hand-edited/and then rewritten; a binding that no longer fits the page's generated types failstsc; a page that calls something the service does not have is acontract-driftfinding. - The way out stays open: delete the
globetrotterlines frompackage.jsonand the generated pages remain plain Next.js code (they still import the widget library, which is vendored in your repository as a tarball, not fetched from anywhere).
The mental model, on one screen
designs/app.design.json ──sync──▶ frontend/src/generated/<page>.tsx GENERATED: the page
(pages, widgets, words) └───▶ frontend/src/generated/<page>.types.ts GENERATED: the shape the page needs
▲ tsc checks the next file against it
frontend/src/bindings/<page>.ts YOURS: data, calls, handlers
│ fetch("/api/...")
designs/app.service.json ──sync──▶ backend/packages/app_contract|core|fastapi GENERATED: routes, models, tables
(entities, operations, │ ▲ your class subclasses the generated one
who may call what) │ backend/packages/app_impl YOURS: the rules
└───▶ backend/migrations/… WRITTEN ONCE per change; you apply it
sync writes the generated files (never applies a migration)
sync --check compares, writes nothing, exits 1 when something is stale or invalid
doctor every rule of "in sync" in one list, one line each, with what to run when one failsStudio and agent write the two JSON files through the same validated operations (a bad edit is refused with a sentence, not saved). The studio listens on 127.0.0.1 only.
The path
| # | Page | You do | Time (measured) |
|---|---|---|---|
| 1 | 01-first-hour.md | install from the zip, build "Things to bring" (list, form, backend, toggle, dialog, second page), check, build | plan 60 to 90 min (an estimate); a script running every command took 4 min: install 45 s, start 30 s, build 7 s |
| 2 | 02-your-code.md | write a binding and a backend rule with a test; then break things on purpose and read what the tool says | 40 min |
| 3 | 03-tour-of-rally.md | run Rally, read ten real files, make three changes | 60 to 90 min |
| 4 | 04-recipes.md | look up the twenty things you will need next | as needed |
| 5 | 05-when-it-goes-wrong.md | look up a message you met | as needed |
| 6 | 06-working-with-an-agent.md | give an agent the project; review what it did | 20 min |
| cheatsheet.md | one page |
An evening is pages 1 to 3. Read 5 before you start page 1 if you like to know what a failure looks like; you will meet three or four of its messages in the first hour.
Two things to know before you start
- Rally does not need the zip. The Rally repository already holds Globetrotter 0.3.0 in
vendor/globetrotter/, sonpm installin it is enough. The zip is for making a new project (page 1) and for upgrading one. - Never run
npx globetrotteroutside a project made this way. A package calledglobetrotterexists on npm and is someone else's. Inside a project,npxfinds the installed copy innode_modules/.bin. In the project's.mcp.jsonand in scripts usenpx --no-install globetrotter ….
What you need
- Node 20 or newer (
node -v) and npm. - uv (
uv --version); it fetches Python itself. Python 3.12 is what the backend ran on here. - A browser. A terminal. About 1.5 GB of disk per installed project (Rally's
node_modulesand.nextalone are about 1.5 GB). - The ports 3100 (studio), 3000 (app) and 8000 (backend) free, or a way to pick others (page 1 says how).
Words used on every page
| Word | Means |
|---|---|
| design | designs/<app>.design.json, the pages |
| service | designs/<app>.service.json, the backend |
| generated | written by sync from a design; do not edit |
| binding | your TypeScript beside a generated page, in frontend/src/bindings/ |
| impl | your Python beside the generated backend, in backend/packages/<app>_impl/ |
| studio | the editor at http://localhost:3100/studio (ports are yours to choose) |
| node id | the #n86owm8n you see in get_page output; tool calls name widgets by it |