Scaffolding mobile

The command + flags.

5 mineasy

Welcome to Building Mobile with Go API. By the end of this chapter you'll have an Expo app running on a simulator AND on your physical phone, talking to your own Grit API.

The command

Terminal
$grit new field-app --mobile

Produces a monorepo with two apps: apps/api (your Go backend) and apps/mobile (Expo React Native), plus the shared packages/shared for Zod schemas + TS types.

What gets scaffolded

field-app/
field-app/
ā”œā”€ā”€ apps/
│ ā”œā”€ā”€ api/ The Grit Go API
│ └── mobile/ The Expo app
│ ā”œā”€ā”€ app/ file-based routes
│ │ ā”œā”€ā”€ (auth)/login.tsx
│ │ ā”œā”€ā”€ (tabs)/index.tsx
│ │ └── _layout.tsx
│ ā”œā”€ā”€ components/
│ ā”œā”€ā”€ hooks/
│ ā”œā”€ā”€ lib/ api client, auth helpers
│ ā”œā”€ā”€ app.json Expo config
│ ā”œā”€ā”€ eas.json EAS Build config
│ └── package.json
ā”œā”€ā”€ packages/shared/ Zod + TS types
└── docker-compose.yml

Prerequisites your machine needs

  • Node 18+ and pnpm
  • Expo Go app on your physical phone (App Store / Play Store)
  • For iOS simulator on macOS: xcode-select --install + Xcode
  • For Android emulator: Android Studio with an AVD created
You don't need Xcode to ship! EAS Build (lesson 5.1) builds your iOS app in Expo's cloud. You can develop and ship an iOS app from a Windows or Linux machine if you use a physical iPhone for testing.

Mobile is monorepo-shaped — the API ships with it

--mobile includes apps/api by default. You get both surfaces. Reasons:

  • Mobile and API share types through packages/shared
  • You can iterate API + mobile in lock-step on one branch
  • One grit start spins up both

What didn't get scaffolded

  • No apps/web — if you want a web companion, use grit new app --triple --mobile (covered in the Multi-Platform course)
  • No apps/admin — same as above

Quick check

You want to build a mobile-only product, no web companion at all, but you do want a server-side admin to manage users. What's the right command?

Try it

Scaffold the mobile project on your machine and inspect what you got:

  1. grit new field-app --mobile
  2. cd field-app && ls apps
  3. Open apps/mobile/app.json and find the name + slug fields

Paste both the directory listing and the app.json snippet in notes.md.

What's next

Tour the Expo project next — what each folder is for and how Expo Router handles navigation.

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