Skip to content

๐Ÿงช Local Development โ€‹

Before building for the app stores, test the app on your own phone or simulator to make sure everything works.

1๏ธโƒฃ Step 1: Install Expo CLI โ€‹

bash
npm install -g expo-cli eas-cli

2๏ธโƒฃ Step 2: Start the Development Server โ€‹

bash
cd packages/mobile
npx expo start

This starts the Expo development server and shows a QR code in your terminal.

3๏ธโƒฃ Step 3: Run on Your Phone โ€‹

๐Ÿ“ฑ Using Expo Go (Quickest) โ€‹

  1. Install the Expo Go app on your phone:

  2. ๐Ÿ“ธ Scan the QR code:

    • iPhone: Open the Camera app and point it at the QR code
    • Android: Open Expo Go and tap "Scan QR code"
  3. โœ… The app will load on your phone.

โš ๏ธ Expo Go Limitations

Expo Go is great for quick testing, but some features (push notifications, Stripe payments) won't work in Expo Go because they require native modules. For full testing, use a development build.

๐Ÿ–ฅ๏ธ Using a Simulator/Emulator โ€‹

๐ŸŽ iOS Simulator (Mac only) โ€‹

  1. Install Xcode from the Mac App Store
  2. Open Xcode โ†’ Settings โ†’ Platforms โ†’ Install iOS Simulator
  3. Run: npx expo start --ios

๐Ÿค– Android Emulator โ€‹

  1. Install Android Studio
  2. Open Android Studio โ†’ More Actions โ†’ Virtual Device Manager โ†’ Create Device
  3. Choose a device (e.g., Pixel 7) and download a system image
  4. Run: npx expo start --android

4๏ธโƒฃ Step 4: Connect to Your API Server โ€‹

The app needs to reach your KitchenAsty API server. During development, you have several options:

๐Ÿ  Option A: Local Server on Same Machine โ€‹

If the API server is running on the same computer (e.g., via docker compose up):

Edit packages/mobile/app.json and set apiBaseUrl to your computer's local IP:

json
{
  "expo": {
    "extra": {
      "apiBaseUrl": "http://192.168.1.100:3000"
    }
  }
}

Find your local IP with:

  • ๐ŸŽ Mac: ipconfig getifaddr en0
  • ๐Ÿง Linux: hostname -I | awk '{print $1}'
  • ๐ŸชŸ Windows: ipconfig (look for IPv4 Address)

โš ๏ธ

Don't use localhost or 127.0.0.1 โ€” that refers to the phone itself, not your computer. Use your computer's actual IP address on the local network.

๐ŸŒ Option B: Production Server โ€‹

Point the app directly at your production server:

json
{
  "expo": {
    "extra": {
      "apiBaseUrl": "https://api.yourdomain.com"
    }
  }
}

This is the simplest option and tests the real connection.

5๏ธโƒฃ Step 5: Test Core Flows โ€‹

Walk through these flows to verify everything works:

โœ… Basic Testing Checklist โ€‹

Here's what each screen should look like when working correctly:

Home ScreenMenu ScreenItem Detail
Mobile HomeMobile MenuMobile Menu Item
  • [ ] ๐Ÿ  App loads and shows the home screen
  • [ ] ๐Ÿ” Menu screen displays categories and items
  • [ ] ๐Ÿ‘† Tapping a menu item opens the detail modal
  • [ ] ๐Ÿ›’ Adding an item to the cart works
  • [ ] ๐Ÿ’ฐ Cart shows correct items and subtotal
  • [ ] ๐Ÿ“ Register a new account
  • [ ] ๐Ÿ”‘ Log in with the account
  • [ ] ๐Ÿ“ฆ Place a test order (cash payment)
  • [ ] โœ… Order confirmation screen shows
  • [ ] ๐Ÿ“œ Order history displays the order
  • [ ] ๐Ÿ“ Locations page shows your restaurant(s)
  • [ ] ๐ŸŒ Language switcher changes the UI language

๐Ÿ’ณ Testing Stripe Payments โ€‹

Stripe payments require a development build (not Expo Go). Use Stripe's test card numbers:

Card NumberResult
โœ… 4242 4242 4242 4242Successful payment
โŒ 4000 0000 0000 9995Declined payment

Use any future expiry date and any 3-digit CVC.

๐Ÿ”จ Development Build โ€‹

For testing features that don't work in Expo Go (push notifications, Stripe), create a development build:

bash
# Install the dev client
npx expo install expo-dev-client

# Build for your device
eas build --profile development --platform android
# or for iOS:
eas build --profile development --platform ios

This creates a custom version of the app with all native modules included. Install it on your device and connect it to the Expo development server.

๐Ÿ”ง Common Issues โ€‹

โŒ "Network request failed" โ€‹

The app can't reach the API server. Check:

  • โœ… The apiBaseUrl in app.json is correct
  • ๐Ÿ“ถ Your phone and computer are on the same WiFi network (for local servers)
  • ๐Ÿ–ฅ๏ธ The API server is running (curl http://your-ip:3000/api/health)

๐Ÿ”ด Metro bundler errors โ€‹

bash
# Clear the cache and restart
npx expo start --clear

๐Ÿ“ฆ "Unable to resolve module" โ€‹

bash
# Reinstall dependencies
rm -rf node_modules
npm install

โžก๏ธ Next Step โ€‹

Once you've verified the app works, continue to EAS Build Setup to configure cloud builds.