Docs

Developers

How a GoLocomotive app is made: locosdk, schema.ts, the server, the client, the UI and the loco cli.

Every GoLocomotive app is one TypeScript repo on one dependency, locosdk. The app holds its schema, its pages and its hooks. Everything generic lives in the sdk: the database, the API, sign in, the data layer, the UI shell, the review cards and the release tools.

This section is for a developer, or an agent, who reads or changes an app. The Reference holds the full tables.

One process per app#

An app runs as one Bun process. That process serves the API, the pages, a small admin and one SQLite file. There is no shared database and no tenant column: each app has its own data folder.

The storage, the REST wire and the filter language copy PocketBase. A PocketBase database opens as is, and a model that knows PocketBase already knows the API.

The tiers#

locosdk exports four tiers and a cli. A lower tier never imports a higher one.

importwhat it owns
locosdk/schemafield builders, defineSchema, the inferred record types, the audit journal collection, the mail templates
locosdk/servercreateApp: SQLite in PocketBase's layout, the rule compiler, the records API, auth, files, hooks, crons, mail, backups, the MCP server
locosdk/clientthe typed fetch client and the MobX data layer: lists, records, aggregates, batched writes
locosdk/uithe Mantine shell, sign in, grids, record cards, the schema form, the journal screens, the what's new modal
locothe cli in the app repo: gate, review cards, shots, releases, backups, schema import, superusers

Two rules hold everything#

  1. The server does the work. Filtering, sorting, paging, relations and sums run on the server. A screen never downloads a collection to filter, count or sum it. The data layer classes make this the easy path.
  2. Server rules are the law. Each collection declares who can list, view, create, update and delete, in the filter language. The records API applies them on every request. A check in the UI only helps the user.

In this section#

pageread it when you
An app, step by stepstart an app or want the whole picture in one place
Anatomy of an applook for a file, or need the contract with the host
Schema as codeadd a collection, a field, an index or a view
Rules and filtersdecide who sees and changes what
Server: hooks, routes, cronsadd behavior on the server
Client and data layerread or write data from a page
UI: shell, grids, formsbuild a screen
Auth and mailchange sign in, codes, mails
Files, backups and proxiesstore files, back up data, run behind a proxy
The MCP serverlet a client's own AI work in the app
Review cards and shotsshow a change to the client
Changelog and releasesship a version
Coming from PocketBasemove a PocketBase app

This page as markdown