# Developers

> How a GoLocomotive app is made: locosdk, schema.ts, the server, the client, the UI and the golo 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](https://golocomotive.fr/docs/reference.md) 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.

| import | what it owns |
|---|---|
| `locosdk/schema` | field builders, `defineSchema`, the inferred record types, the audit journal collection, the mail templates |
| `locosdk/server` | `createApp`: SQLite in PocketBase's layout, the rule compiler, the records API, auth, files, hooks, crons, mail, backups, the MCP server |
| `locosdk/client` | the typed fetch client and the MobX data layer: lists, records, aggregates, batched writes |
| `locosdk/ui` | the Mantine shell, sign in, grids, record cards, the schema form, the journal screens, the what's new modal |
| `golo` | the 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

| page | read it when you |
|---|---|
| [An app, step by step](https://golocomotive.fr/docs/developers/quickstart.md) | start an app or want the whole picture in one place |
| [Anatomy of an app](https://golocomotive.fr/docs/developers/anatomy.md) | look for a file, or need the contract with the host |
| [Schema as code](https://golocomotive.fr/docs/developers/schema.md) | add a collection, a field, an index or a view |
| [Rules and filters](https://golocomotive.fr/docs/developers/rules.md) | decide who sees and changes what |
| [Server: hooks, routes, crons](https://golocomotive.fr/docs/developers/server.md) | add behavior on the server |
| [Client and data layer](https://golocomotive.fr/docs/developers/client.md) | read or write data from a page |
| [UI: shell, grids, forms](https://golocomotive.fr/docs/developers/ui.md) | build a screen |
| [Auth and mail](https://golocomotive.fr/docs/developers/auth.md) | change sign in, codes, mails |
| [Files, backups and proxies](https://golocomotive.fr/docs/developers/files-backups.md) | store files, back up data, run behind a proxy |
| [The MCP server](https://golocomotive.fr/docs/developers/mcp.md) | let a client's own AI work in the app |
| [Review cards and shots](https://golocomotive.fr/docs/developers/review.md) | show a change to the client |
| [Changelog and releases](https://golocomotive.fr/docs/developers/releases.md) | ship a version |
| [Coming from PocketBase](https://golocomotive.fr/docs/developers/pocketbase.md) | move a PocketBase app |
