Scaffolding mobile
The command + flags.
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
$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/āāā 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
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 startspins up both
What didn't get scaffolded
- No
apps/webā if you want a web companion, usegrit new app --triple --mobile(covered in the Multi-Platform course) - No
apps/adminā same as above
Quick check
Try it
Scaffold the mobile project on your machine and inspect what you got:
grit new field-app --mobilecd field-app && ls apps- Open
apps/mobile/app.jsonand find thename+slugfields
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