Globetrotter docsversion 0.3.0 · 2026-12-04

Concepts

On this page
  1. The service design file
  2. Stores
  3. Entities and fields
  4. Relations
  5. Indexes
  6. Services
  7. Queries
  8. Commands
  9. Params
  10. Refusals
  11. Shapes
  12. State machines
  13. What a request passes
  14. Versions
  15. Idempotency keys
  16. Rate limits
  17. API keys
  18. Clients and webhooks
  19. Sign-in and roles
  20. Row rules
  21. Organisations
  22. Audit
  23. Events, flows and steps
  24. Jobs and schedules
  25. Cache, files, search and notices
  26. Observability
  27. The service's words
  28. Environments
  29. Targets
  30. The contract
  31. A project is a frontend, a backend, or both
  32. How changes are written
One service file generates the contract and the code; the pages, the contract tests and the studio all read the same file
One service file generates the contract and the code; the pages, the contract tests and the studio all read the same file

A backend in Globetrotter is a service design: one JSON file that says what the server stores, what it offers and who may use it. Everything else is written from it. This page walks the model from the data outward. Each section has one snippet: from the examples where they use the part, else the reference's own. The reference lists every prop.

The service design file

designs/<name>.service.json sits beside the page design of the same name (mail.design.json, mail.service.json). A backend alone has only the service file. Every node has the same shape the pages use: { id, type, props, slots }. The file's sections are stores, entities, services, flows, jobs, caches, files, searches, notifications, llm, clients, webhooks and shapes, plus auth, observability, tenancy and words.

The file is validated before it is written: an unknown prop, a name a language cannot spell, a reference to nothing or a secret written into it is refused with the path of the problem. Lint then says what a valid file can still get wrong.

Stores

A Store is where rows live: a database or a key-value store. A design may have several. Each entity names its own.

{ "id": "db", "type": "Store", "props": { "name": "db", "kind": "sqlite" } }

kind is an engine family. The connection comes from the environment's components file, so a laptop can run sqlite where production runs postgres. A command writes one store; two stores cannot share one transaction.

Entities and fields

An Entity is a thing the backend stores: its fields, its relations, its indexes. One field is the key. A Field has a type, optional rules (longest, shortest, a format, a list of values) and the words a person is told when a rule breaks.

{ "id": "thread", "type": "Entity",
  "props": { "name": "thread", "store": "db", "audit": "changes", "softDelete": true },
  "slots": { "fields": [
    { "id": "f1", "type": "Field", "props": { "name": "id", "type": "uuid", "key": true } },
    { "id": "f2", "type": "Field", "props": { "name": "subject", "type": "string", "max": 200 } },
    { "id": "f3", "type": "Field", "props": { "name": "archived", "type": "boolean", "default": "false" } }
  ] } }

Each target generates the table, the model, the repository and the rules from it, and the contract names the same rules, so a page and the server refuse the same values.

A page that shows a field in words (a date in a Text, a price, a count) gets it as text: the page's model takes what the page binds, so the generated list hands a day over as 2031-05-01, a time as 2031-05-01T09:00:00Z, a decimal exactly, an id, a flag (true) and json as the text they read as; a choice is text already. Rename a field and what names it by name follows (owner, audited fields, indexes, searches, where, sets, sort, a create's or update's param of that name; a query's param keeps its name and its field follows), and the answer says what it carried and what it could not. A page row or form field that still carries the old name is contract-drift (an error, with its Fix); a create's param that fills no field is param-fills-nothing. A body property a command does not take is refused with a 400 naming it, never dropped.

Relations

A Relation links one entity to another. many on a thread's messages means a thread holds a list. many off means a row points at one. onDelete says what happens to the link when the other row goes.

{ "id": "r1", "type": "Relation", "props": { "name": "messages", "to": "message", "many": true } }

A single relation marked Always is NOT NULL and a create needs its <name>Id; a room that is not there is a 404. A relation that holds many is one to many unless it says joined (many to many, through a join table of its own) or through an entity (a join with fields); see reference and limits.

Indexes

An Index makes a lookup fast, keeps values unique together, or keeps spans of time from overlapping (a room booked twice). No example uses one; this is the shape of a booking's:

{ "id": "no-double-booking", "type": "Index",
  "props": { "name": "noDoubleBooking", "fields": "room", "noOverlap": "startsAt, endsAt",
             "message": "That room is taken then." } }

Overlap is kept by postgres as an EXCLUDE constraint and by sqlite as triggers, and answered 409 in the index's words. One span may end where the next starts. mysql does not keep it.

Services

A Service is a group of operations under one route. It has one generated router and one file of yours.

{ "id": "threads", "type": "Service", "props": { "name": "Threads", "route": "/threads" },
  "slots": { "operations": [ /* queries and commands */ ] } }

The route is the path the pages already call. A service nests only queries and commands.

Queries

A Query reads and never changes anything. The query named list answers GET {route}; get answers GET {route}/{id}; any other answers GET {route}/{name}.

A list says how it reads its rows. where keeps the rows that pass a comparison (status=Open, price>=10, archivedAt=null). sort fixes the order and sortable names the fields a caller may sort by. paging is page (page and size, the total in X-Total-Count) or cursor (cursor and size, the next one in X-Next-Cursor). A param's filter says how it keeps rows (contains, in, gte, …). A query's returns is an entity or a shape. The exact props are in the reference.

A param may keep rows by a link, and a list may be ordered by when a row was made or changed (createdAt, updatedAt), which every table keeps:

{ "id": "o1", "type": "Query",
  "props": { "name": "list", "returns": "job", "many": true, "sortable": "dueAt, updatedAt", "paging": "cursor" },
  "slots": { "params": [ { "id": "p2", "type": "Param", "props": { "name": "assignee", "type": "uuid", "in": "query", "required": false, "field": "assignee" } } ] } }

GET {route}?assignee=<id>&sort=-updatedAt answers that technician's jobs, the latest changed first. fieldops' /work does this, with unassigned=true for the jobs no one has (one run).

A list's own where takes the same two: assignee=null is the jobs no one has, updatedAt>=2026-06-01T00:00:00Z the ones changed since. An update's param that says clears empties its field, or its link, when sent null. fieldops' Work.assign gives a job back to nobody that way:

$ curl -i -X POST -H 'X-Api-Key: dev-dispatcher-key' -H 'content-type: application/json' -d '{"assigneeId":null}' http://localhost:8983/work/actions/assign/j3
HTTP/1.1 200 OK
{"job":{"id":"j3","title":"Leak inspection","site":"Sintra","technician":"Unassigned","status":"Open", …

The link is emptied by the generated code; the shown technician is written by fieldops' own body (the run).

{ "id": "o2", "type": "Query",
  "props": { "name": "get", "returns": "thread", "allow": "reader", "description": "One thread with its messages." },
  "slots": { "params": [ { "id": "p1", "type": "Param", "props": { "name": "id", "type": "uuid", "in": "path" } } ] } }

Commands

A Command changes something. Its does is create, update, delete, restore, transition or custom. The first four are generated whole from the entity; a transition runs one move of a state machine, also generated; custom is generated around a handler you write. A command may emit an event.

{ "id": "o4", "type": "Command",
  "props": { "name": "archive", "entity": "thread", "does": "update", "sets": "archived=true",
             "emits": "thread.archived", "allow": "member", "description": "Moves the thread out of the inbox" },
  "slots": { "params": [ { "id": "p4", "type": "Param", "props": { "name": "id", "type": "uuid" } } ] } }

A command answers POST {route}/actions/{name}. A says prop makes it answer a sentence for the person (confirmation) beside, or instead of, a row.

An update that changes nothing writes nothing, on both targets: the row's updated_at stays, a versioned row keeps its version and ETag, and no audit row is written. Its event is still emitted.

A generated create and update hold each value to its field's rules, and the contract says the same rules. From fieldops, on both targets:

POST /technicians/actions/create  {"name":"Sam"}
409  {"error":"A technician with that name is already there."}
POST /technicians/actions/update/{id}  {"email":"noor at example"}
400  {"error":"The email is not an email address.","field":"email", …}
POST /technicians/actions/update/{id}  {"email":""}
200  the email stays as it was: blank is not given

An update changes only what is sent. The rules, one per row: Reference.

Params

A Param is one value an operation takes, sent in the body, the query string or the path (a client's call may also send one in a header). finds names the entity whose key it is, so an unknown id is answered 404 in words.

{ "id": "p2", "type": "Param", "props": { "name": "id", "type": "uuid", "finds": "thread" } }

Refusals

Missing values (400), unknown rows (404) and sign-in (401, 403) come from the params, the key and the roles. A Refusal is any other way to say no, with its status and the words the caller sees.

{ "id": "checkout-empty", "type": "Refusal",
  "props": { "name": "emptyCart", "status": "409", "message": "Your cart is empty." } }

The error body is always { "error": "…", "field": "…", "fields": { … } }: field names the one wrong input and fields all of them at once.

Shapes

A Shape is a typed answer that is not a row: counts, totals, a report. With a from the backend works it out in one SQL statement (group, count, sum, a join across single relations); without one it is the type of an answer your code writes. A Query or a Command names it in returns.

{ "id": "revenue", "type": "Shape", "props": { "name": "Revenue", "from": "line", "where": "qty>0" },
  "slots": { "parts": [
    { "id": "rv-total", "type": "Part", "props": { "name": "total", "type": "decimal", "agg": "sum", "of": "qty * product.price" } },
    { "id": "rv-lines", "type": "Part", "props": { "name": "lines", "agg": "count" } } ] } }

State machines

A Machine on an entity says which moves an enum field may make; its values are the states. Each Transition is one move: the states it may be made from, the state it goes to, a guard on the row's own fields (when), a role (allow) and an event (emits). A command with does: transition runs one.

{ "id": "order-flow", "type": "Machine", "props": { "name": "fulfilment", "field": "status", "final": "Delivered, Cancelled" },
  "slots": { "transitions": [
    { "id": "ship", "type": "Transition", "props": { "name": "ship", "from": "Paid, Packed", "to": "Shipped", "when": "address != null" } } ] } }
{ "id": "orders-ship", "type": "Command",
  "props": { "name": "ship", "entity": "order", "does": "transition", "transition": "ship",
             "allow": "admin", "description": "Sends the order on its way." } }

A move from the wrong state is a 409 in words, a failed guard says its message, and of several requests moving one row at once exactly one is made. Nothing else may write the field: a create starts at the initial state and the repository's update refuses it.

What a request passes

The order a request passes: sign-in, role, organisation, rate limit, headers and input, idempotency key, your handler, the write, the commit, with the status each stage answers
The order a request passes: sign-in, role, organisation, rate limit, headers and input, idempotency key, your handler, the write, the commit, with the status each stage answers

Every operation is checked in this order on both targets, and the first stage that refuses answers. Your handler runs only after everything above it has passed. The four sections below are stages of it: versions, idempotency keys, rate limits and API keys. The exact props, statuses and messages are in the reference; what has been run on which target and engine is in one table.

Versions

A lost update stopped: Ana and Ben both read version 1, Ben's write makes it 2, Ana's write with If-Match "1" is answered 412 and nothing is written
A lost update stopped: Ana and Ben both read version 1, Ben's write makes it 2, Ana's write with If-Match "1" is answered 412 and nothing is written

Two people editing one row cannot silently overwrite each other. A versioned entity counts its writes. A read answers the count as an ETag; a write sends it back as If-Match and is made only if nobody wrote in between.

Where How
Studio The entity's inspector: Versioned, then A write must send the version it read
Agent add_entity(design, "doc", versioned: true, ifMatch: "required"), or on an entity that exists set_service_props(design, "doc", { versioned: true, ifMatch: "required" })
JSON "versioned": true, "ifMatch": "required" in the Entity's props
Try it press_operation(design, "Documents.rename", body, ifMatch: '"1"'), or the If-Match field in the studio's Try it

What the contract promises:

GET  /documents/42                                     200  ETag: "1"
POST /documents/actions/rename   If-Match: "1"         200  ETag: "2"
POST /documents/actions/rename   If-Match: "1" again   412  This doc was changed since you read it: read it again.
POST /documents/actions/rename   no If-Match           428  Send If-Match with the ETag you read.
Try it on Threads.archive: a stale If-Match answered 412, with the message the server sent
Try it on Threads.archive: a stale If-Match answered 412, with the message the server sent

If-Match: * writes whatever the version. Reference: Versions.

Idempotency keys

A retry answered from its key: the first answer is lost, the same request with the same Idempotency-Key gets the first answer again and nothing runs; another body is a 422, a repeat while the first is running a 409
A retry answered from its key: the first answer is lost, the same request with the same Idempotency-Key gets the first answer again and nothing runs; another body is a 422, a repeat while the first is running a 409

A client that lost an answer can send the request again safely. A command marked idempotent takes an Idempotency-Key header: the first request with a key runs and its answer is kept, and a repeat gets that answer without running anything.

Where How
Studio The command's inspector: Idempotent, then Keys kept for
Agent set_service_props(design, "Jobs.create", { idempotent: true, keepFor: 3600 }), or the same props in add_operation
JSON "idempotent": true, "keepFor": 3600 in the Command's props (seconds; a day when left out)
Try it press_operation(design, "Jobs.create", body, idempotencyKey: "order-7"), or New key and Send again in the studio's Try it

From a run of the Python target on SQLite (the whole transcript):

$ curl -i -X POST localhost:8961/jobs/actions/create -H 'Idempotency-Key: order-7' -d '{"title":"Paint the hall"}'
HTTP/1.1 200 OK
etag: "1"
{"job":{"id":"01a1d35a-0660-…","title":"Paint the hall","status":"Open",…}}

$ # the same request again
HTTP/1.1 200 OK
etag: "1"
idempotent-replayed: true
{"job":{"id":"01a1d35a-0660-…","title":"Paint the hall","status":"Open",…}}

$ # the same key with another body
HTTP/1.1 422 Unprocessable Content
{"error":"This Idempotency-Key was used for a different request."}
Try it on Threads.reply: the key made, the reply sent, then sent again and answered Replayed
Try it on Threads.reply: the key made, the reply sent, then sent again and answered Replayed

Without the header a request runs every time. A request that is refused or fails keeps no key. A key belongs to one operation and one caller, and with organisations to one organisation. A key first used on one target replays on the other (transcript).

A repeat that arrives while the first is still running is told to try again, and of ten sent at once one runs. From the Rust run (transcript):

$ # the first request with key slow-1 is still running
HTTP/1.1 409 Conflict
retry-after: 1
{"error":"The first request with this Idempotency-Key is still running: try again."}

$ # the same key again, now that the first has answered
HTTP/1.1 200 OK
idempotent-replayed: true

On SQLite, a request whose key cannot be taken because another write holds the database is answered 503 on both targets, and nothing runs. From the Rust run (transcript; Python's):

$ # another writer holds the file for 8 s
$ curl -i -X POST localhost:8942/jobs/actions/complete -H 'Idempotency-Key: busy-1' -d '{"jobId":"j2"}'
HTTP/1.1 503 Service Unavailable
retry-after: 1
{"error":"The service was busy with another write and could not take this request: send it again with the same Idempotency-Key."}

$ # the writer let go: the same key again runs
HTTP/1.1 200 OK

Reference: Idempotency keys; what your handler must not do outside the transaction is in Your code.

Rate limits

Permissions with limits on: the default, where the counts are kept, the 429 message, one operation's own limit, and the Limit column
Permissions with limits on: the default, where the counts are kept, the 429 message, one operation's own limit, and the Limit column

One caller cannot flood an operation. A limit is a number of requests in a window (10/minute, 30/hour), counted per person or key, per organisation, or per address. The design sets a default for every operation, and an operation can set its own or opt out with none.

Where How
Studio Permissions, Turn limits on…; an operation's inspector has Limit and Counted
Agent set_limits(design, default: "600/minute", by: "principal", store: "counts", signIn: "5/minute"); one operation: set_service_props(design, "Jobs.list", { limit: "5/minute", limitBy: "ip" })
JSON "limits": { "default": "600/minute", "store": "counts" } in the design; "limit": "5/minute", "limitBy": "ip" in the operation's props

From a run of the Python target on SQLite, Jobs.list at five a minute (the whole transcript):

$ curl -i localhost:8961/jobs -H 'X-Api-Key: dp_a62158c2f8cbe41f_<secret>'     # five times
HTTP/1.1 200 OK

$ # the sixth
HTTP/1.1 429 Too Many Requests
retry-after: 38
{"error":"Too many requests: try again in 38 seconds."}

The window is fixed, not sliding: across the edge of one, a caller can make twice the number. A request refused 401 or 403 is not counted. Without a redis store each process counts its own, and lint says so. Reference: Rate limits.

API keys

Permissions with managed keys: who makes them, the scopes, how long they live, and the Scope column
Permissions with managed keys: who makes them, the scopes, how long they live, and the Scope column

Programs call the service with keys that people make, narrow and take away. A key acts as the person who made it. Scopes narrow it: an operation names the scope it needs, and a key with scopes calls only the operations whose scope it holds.

Where How
Studio Permissions, Manage keys…; the matrix's Scope column sets an operation's scope
Agent set_auth(design, keys: { prefix: "fo", make: "dispatcher", scopes: ["jobs:read", "jobs:write"], expiresIn: "90 days", graceFor: "1 day" }); one operation: set_service_props(design, "Jobs.list", { scope: "jobs:read" })
JSON { "kind": "apikey", "keys": "managed", "prefix": "fo", "make": "dispatcher", "scopes": ["jobs:read", "jobs:write"] } in auth.types; "scope": "jobs:read" in the operation's props
Try it press_operation(design, "Jobs.list", as: "key", keyScopes: ["jobs:read"]), or An API key in the studio's Try it (Studio: Keys)

From a run of the Rust target on SQLite (the whole transcript, which goes on to organisations; Python's is here):

$ # signed in as a dispatcher
$ curl -i -X POST localhost:8946/apikeys/actions/create -d '{"name":"ci","scopes":["jobs:write"]}'
HTTP/1.1 201 Created
{"id":"5a960eb456e679ea","name":"ci","role":"dispatcher","scopes":["jobs:write"],"hint":"Awm4",…,"key":"fo_5a960eb456e679ea_<secret>"}

$ curl -i -X POST localhost:8946/jobs/actions/complete -H 'X-Api-Key: fo_5a960eb456e679ea_<secret>' -d '{"jobId":"j1"}'
HTTP/1.1 200 OK

$ curl -i localhost:8946/jobs -H 'X-Api-Key: fo_5a960eb456e679ea_<secret>'
HTTP/1.1 403 Forbidden
{"error":"This key does not have jobs:read."}

The whole key is answered once, when it is made or rotated; the service stores only its hash and its last four characters. A key expires (90 days unless the design says otherwise), a rotated key keeps working for a day, and a key cannot make keys. In a design with organisations a key works only in the one it was made in, at its maker's role there now (the answers and the role). A key made on one target works on the other, with organisations (transcript) and without (transcript). Reference: API keys.

Clients and webhooks

A Client is an outside service the backend calls over HTTP, and each Call one request to it. The generated client has a typed method per call, a timeout on every try, retries only where repeating is safe, a circuit breaker and a fake for tests. Its address is the environment's (clients.<name>.baseUrl in the components file); its key is a secret's name.

{ "id": "payments", "type": "Client", "props": { "name": "Payments", "auth": "bearer", "key": "{secret:PAYMENTS_KEY}" },
  "slots": { "calls": [ { "id": "pay-charge", "type": "Call", "props": { "name": "charge", "method": "POST", "path": "/v1/charges", "idempotent": true } } ] } }

A Webhook is a path an outside service posts events to. It is not behind sign-in: the signature is the credential, checked over the raw body before anything is read. An event id seen before runs nothing. Each Handler matches an event type and runs a command with values read from the body, emits an event for a flow, or both.

{ "id": "stripe", "type": "Webhook", "props": { "name": "Stripe", "scheme": "stripe", "secret": "{secret:STRIPE_WEBHOOK_SECRET}" },
  "slots": { "handlers": [ { "id": "stripe-paid", "type": "Handler", "props": { "name": "paid", "match": "payment_intent.succeeded",
    "calls": "orders-mark-paid", "args": "orderId=/data/object/metadata/order_id", "emits": "payment.succeeded" } } ] } }

How each reaches your code is in Your code.

Sign-in and roles

The auth section lists the sign-in methods and the roles, lowest first. An operation's allow names the lowest role that may run it; every role above it may too. anyone opens it to strangers. There is no deny.

"auth": {
  "types": [ { "kind": "session" }, { "kind": "apikey", "header": "X-Api-Key" } ],
  "roles": [ "member", "admin" ]
}

With sign-in on, an operation that names no allow is refused to everyone, and lint says so. Fieldops signs in by API key alone, with three roles, and leaves its pages' operations open on purpose. See Auth and security.

Row rules

An entity's owner field names the person a row belongs to. Each person then reads and changes only their own rows, and the highest role sees every row. Another person's row is a 404. Storefront's order is its customer's (a member reads their own orders, an admin every one):

{ "id": "order", "type": "Entity", "props": { "name": "order", "store": "db", "audit": "full", "owner": "customer" } }

An entity without an owner is every signed-in person's: a member who may run an update may run it on any row.

Organisations

A design that says tenancy has people in organisations, with a role in each. One entity is the organisation (scope: tenant), one the membership (scope: membership), and every other entity is the organisation's (scope: rows, with one required link to it) or shared on purpose (scope: global):

"tenancy": { "roles": ["viewer", "dispatcher", "owner"], "from": "cookie", "name": "gt_org" }
{ "id": "job", "type": "Entity", "props": { "name": "job", "store": "db", "scope": "rows" },
  "slots": { "relations": [ { "id": "job-org", "type": "Relation", "props": { "name": "org", "to": "org", "required": true } } ] } }
{ "id": "jobs-complete", "type": "Command",
  "props": { "name": "complete", "entity": "job", "does": "update", "allow": "member", "allowIn": "dispatcher",
             "description": "Marks the job done." } }

A request says which organisation it is for (X-Org, or the cookie POST /tenancy/actions/select sets). A member sees that organisation's rows and no others; another's row is a 404; a role below allowIn is a 403. The repositories do this, so your code does it too, unless it asks for every row. See Auth and security.

Audit

Each write to an entity is a row in the same transaction: who, when, the request's id, and the fields before and after. audit is changes (the default), full, fields (only those named) or none.

{ "id": "order-line", "type": "Entity", "props": { "name": "orderLine", "store": "db", "audit": "none" } }

Auth and security says what the audit proves.

Events, flows and steps

A command that emits writes an event in the same transaction as its change. A Flow listens for an event and runs its Steps in order after the commit. Each step is a plain function of yours, retried as the design says.

{ "id": "fl1", "type": "Flow", "props": { "name": "archiveCleanup", "on": "thread.archived", "durability": "worker" },
  "slots": { "steps": [
    { "id": "s1", "type": "Step", "props": { "name": "detachLabels" } },
    { "id": "s2", "type": "Step", "props": { "name": "notifyOwner", "retry": 3 } } ] } }

See Flows and jobs.

Jobs and schedules

A Job is work started by a Schedule (a cron expression, in UTC) or by hand, on the same worker as flows.

{ "id": "daily-sales", "type": "Job", "props": { "name": "sendDailySales", "retry": 2 } },
{ "id": "nightly", "type": "Schedule", "props": { "name": "nightly", "cron": "0 3 * * *", "job": "daily-sales" } }

Cache, files, search and notices

Four small primitives sit beside the services.

{ "id": "inbox-cache", "type": "Cache", "props": { "name": "inboxCounts", "store": "cache", "query": "inbox-list", "ttl": 30 } }
{ "id": "thread-search", "type": "Search", "props": { "name": "threadSearch", "entity": "thread", "fields": "subject" } }
{ "id": "job-photos", "type": "File", "props": { "name": "jobPhotos", "maxSize": 5, "types": "image/png, image/jpeg", "signed": true } }
{ "id": "order-receipt", "type": "Notify", "props": { "name": "orderReceipt", "channel": "email", "subject": "Your order {id}", "template": "Hello {name}, …" } }
  • A Cache keeps a query's answers per person for its ttl and forgets them when a command writes the same database.
  • A Search is GET /search/<name>?q=: every word is a prefix match over its fields, ranked by the engine.
  • A File is an upload and a download through a signed link that expires. The bytes are on the backend's disk (backend: local) or in a bucket (backend: s3: AWS, MinIO, R2), which each environment names. Uploads go through the service either way; a bucket's download is a 302 to a link that works for 60 seconds.
  • A Notify is a template filled and sent: by SMTP or webhook when the environment names one, else to the console.

Observability

One switch in the design turns on traces, metrics and logs, and names the fields kept out of all three.

"observability": { "traces": true, "metrics": true, "logs": true, "exporter": "console", "redact": ["email", "address"] }

The service's words

Every refusal the service says on its own ("A job needs a title.", "No job has that id.", "The body is larger than 2 MB…") is one line of words in the design. They are edited in the same Words sheet as the pages' (npx globetrotter words, get_words and set_words) and emitted by both targets as words.py and words.rs, the same words for the same refusal. The studio's Words panel lists them under Backend. A field's own message wins for that field.

Environments

An environment is a name in GLOBETROTTER_ENV and a file designs/components.<env>.json. It says where each store is and which engine it uses there, and sets some auth settings, flows durability and the observability exporter. A secret is a name, never a value.

{ "stores": { "db": { "kind": "sqlite", "url": "sqlite:///./db.sqlite" } },
  "observability": { "exporter": "console" } }

A password written into a URL is refused. The studio's Environments view edits these files as forms.

Targets

A target is a language that turns the service file into code. Python (FastAPI) and Rust (axum) ship. Turn them on in globetrotter.config.json under backend.targets. They can run side by side on one database and answer the same bytes. See Targets.

The contract

sync merges the service's operations into the OpenAPI file the pages were generated against (<name>.openapi.json): request bodies, query parameters, refusals and what each command answers. Every target serves that same file and builds its models from it. A page and its service that disagree are reported as contract drift on both files, and the side that owns the path is asked to move.

The studio's Code tab, OpenAPI view, on mail: the contract written from mail.design.json and mail.service.json
The studio's Code tab, OpenAPI view, on mail: the contract written from mail.design.json and mail.service.json

A project is a frontend, a backend, or both

init --as picks frontend, backend, both or static. With both, the app sits in frontend/ as its own codebase beside the service, and they share only designs/ and the contract. add backend drafts a service from existing pages; add frontend adds pages to a backend. See History and plan.

How changes are written

Every write, from the studio, an agent or the CLI, takes the file's lock, is refused if the file moved since it was read, and leaves a line in designs/.memory/journal.jsonl. A design and its service change together or not at all. Code generation runs one at a time per project.

Next: Reference for every prop, Generated code for what is written where, Quickstart if you have not run one.