Chapter 2
Shared Types Everywhere
One source of truth for 4 surfaces.
~14 min total2 lessonsAssignment
By the end of this chapter you'll be able to
- grit sync across surfaces
- Type-safe API client
- Shared Zod schemas
Lessons
Chapter assignment
Add a field and feel the wave
Add an `IsFeatured bool` field to the Product model in the Go API. Run `grit sync`. Confirm the TypeScript type and Zod schema both regenerate, and that web / admin / mobile / desktop all type-check against the new field without any per-surface edits.
See success criteriaLesson 1 takes ~7 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