Scaffolding the full stack
Triple + mobile + desktop.
This course is the kitchen sink: one Go API powering four frontends β a public website, an admin panel, a mobile app, and a desktop app. The first job is scaffolding all of them so they can talk to the same database from day one.
What we're building
Four surfaces, one API
Same API, same data, four different surfaces. Each surface owns presentation; nothing owns business logic except the API.
Step 1 β Scaffold the triple kit
Triple kit means: API + web + admin in one monorepo. This is the foundation; mobile and desktop bolt on next.
grit new my-saas --kit=triplecd my-saaspnpm install
That gives you:
apps/api/β Go APIapps/web/β Next.js public + dashboardapps/admin/β Next.js admin panelpackages/shared/β Zod schemas + TS types
Step 2 β Add the mobile app
Mobile lives at apps/mobile/. The Grit CLI knows how to add it on top of an existing project.
grit add mobile# scaffolds apps/mobile/ as an Expo app# wires it into pnpm-workspace.yaml# points API_URL at http://localhost:8080
Now the workspace has 4 frontends. Mobile reads from packages/shared just like the web apps do.
Step 3 β Add the desktop app
grit add desktop# scaffolds apps/desktop/ as a Wails project# wires it into the workspace# points API_URL at http://localhost:8080
Wails is Go + React shipped as a single native binary. Same shared types, same API client patterns β different runtime.
What the final tree looks like
my-saas/βββ apps/β βββ api/ Go API (Gin + GORM)β βββ web/ Next.js public site + dashboardβ βββ admin/ Next.js admin panelβ βββ mobile/ Expo + React Nativeβ βββ desktop/ Wails (Go + React)βββ packages/β βββ shared/ Zod schemas + TS types (shared by web/admin/mobile/desktop)βββ grit.config.ts Project config (kits enabled, etc.)βββ pnpm-workspace.yamlβββ turbo.json
Boot the whole thing
# Terminal 1 β infradocker compose up -d# Terminal 2 β APIcd apps/api && go run cmd/server/main.go# Terminal 3 β web + admin (turbo handles both)pnpm dev# Terminal 4 β mobilecd apps/mobile && pnpm start# Terminal 5 β desktopcd apps/desktop && wails dev
Five terminals feels like a lot β and it is. Most days you won't run all five. You boot the ones for the surface you're editing. The point is they ALL CAN run against the same dev DB.
Quick check
Try it
For chapter 1's assignment, get all four surfaces up:
- Run
grit new my-saas --kit=triple. - Run
grit add mobileandgrit add desktop. - Boot the API, web, admin, mobile, and desktop.
- Screenshot each β even just the default scaffold pages.
- Confirm all 4 frontends list the same seeded user from
/api/users.
The point: prove the loop closes. One API, four frontends, one DB.
What's next
Next lesson β Monorepo wiring. The boring plumbing that makes four frontends behave like one project: pnpm workspaces, turbo pipelines, the Go module layout.
Spot a typo? Have an idea?
Help us improve this lesson. One click opens a GitHub issue with the lesson URL pre-filled β suggest clearer wording, report a bug, or request more depth. The course keeps improving thanks to learners like you.
Suggest an improvement on GitHub