One Language, Whole App
Part I gave the discipline, and the MVU chapters gave the frontend. This chapter group crosses the network: database, server, contracts, errors, and authentication, all in the same language, all checked by the same compiler.
The claim to keep in view: in a conventional stack, the seams between frontend and backend are where correctness goes to die, because no tool can see both sides at once. Mar’s whole bet is that if one compiler sees the entire application, the seams become checkable, and most of the scaffolding every product rebuilds (auth, migrations, API plumbing, admin) can ship in the box, typed.
The pieces, in reading order:
- Services: a typed contract, declared once, that both halves import. The end of API drift.
- Entities and the Repo: the database as typed declarations; migrations derived, not written.
- Tasks: the backend’s effect type, and how handlers chain reads and writes while staying declarative.
- The Error Model: three kinds of failure, three homes, zero exceptions.
- Auth in the Box: passwordless sign-in as a framework feature, and why auth is the scaffolding most worth standardizing.