Chapter 5
Grit
The framework, now that you can read what it generates.
By the end of this chapter you'll be able to
- Two lists, and they belong to different people
- The developer's twelve
- The client's fourteen
- Why these survive a decade of excellent libraries
- The question a framework has to answer
Lessons
Module: Grit
The twenty six problems, and what a framework is for
You can now write Go.
grit new: what lands, and the shape of a project
One command, and the answers to most of chapter twenty six are already in your directory.
The architecture: a modular monolith, layer by layer
You have the project.
The resource, and why it is the unit of generation
This is the idea the framework rests on.
Field types: what each one decides
Thirty one field types ship.
Models, migrations and seeding at scale
D10 from chapter twenty six was "changing the schema is the scary part: the migration that half ran, with no way back".
Services: where the rules live, and why not the handler
The thin-handler rule has come up three times now.
Handlers and the HTTP contract
A handler's job is small and the contract it serves is not.
The generated admin panel
D4 was "the same UI for every table, twenty tables, twenty slightly different list pages".
Authentication, roles and per-record ownership
B1 was "can different people see different things", and it is the question clients ask first.
The shared package: one definition, four outputs
D3 was "the same type exists four times".
Chapter assignment
Finish every assignment in Grit
Each lesson in this part ends with its own assignment, named for the leaderboard. Finish them in order.
See success criteriaLesson 1 takes ~10 min.
Start chapterSpot a typo? Have an idea?
Help us improve this chapter. One click opens a GitHub issue with this chapter's URL pre-filled — suggest a clearer wording, report a bug, or request a new lesson. The course keeps improving thanks to learners like you.
Suggest an improvement on GitHub