Prerequisites
Before installing TableOrder, ensure you have the following installed on your system:Node.js 18+
Download from nodejs.org
Expo CLI
Install globally:
npm install -g expo-cliiOS Simulator
Part of Xcode (macOS only)
Android Emulator
Part of Android Studio
Installation steps
Install dependencies
Install all required npm packages:This will install all dependencies listed in
package.json, including:- React Native 0.83 and Expo SDK 55
- Mapbox Maps SDK (@rnmapbox/maps)
- Stripe React Native SDK
- Zustand for state management
- All Expo modules (camera, location, notifications, etc.)
Configure environment variables
Copy the example environment file and add your API keys:Open
.env in your text editor and configure the following variables:- Mapbox (Required)
- Stripe (Optional)
- Telegram (Optional)
Get your Mapbox tokens from account.mapbox.com. The secret token needs
DOWNLOADS:READ scope.Prebuild native projects
Generate native iOS and Android projects with all required native modules:This command:
- Generates
ios/andandroid/directories - Links all native modules (camera, Stripe, Mapbox, notifications)
- Applies configuration from
app.json - Sets up permissions for camera, location, and notifications
You only need to run this once, or when you add new native dependencies.
Configuration reference
TableOrder uses centralized configuration insrc/lib/core/config.ts:
src/lib/core/config.ts
Mapbox configuration
Mapbox configuration
token: Public access token for map rendering and Directions API- Required for both map display and delivery route calculations
- Free tier includes 50,000 requests/month
Telegram configuration
Telegram configuration
botToken: Authentication token for your botchatId: Destination for PDF receipt delivery- Optional: App works without Telegram integration
Restaurant configuration
Restaurant configuration
name: Display name for receipts and notificationscostPerKm: Shipping cost multiplier (default: $1/km)geofenceRadiusMeters: Distance threshold for mode switching (default: 50m)
Environment variables
Complete reference for all supported environment variables:| Variable | Required | Description |
|---|---|---|
EXPO_PUBLIC_MAPBOX_TOKEN | Yes | Mapbox public token for map rendering (starts with pk.) |
RNMAPBOX_MAPS_DOWNLOAD_TOKEN | Yes | Mapbox secret token for native SDK download (starts with sk.) |
EXPO_PUBLIC_STRIPE_KEY | Optional | Stripe publishable key for payment processing |
EXPO_PUBLIC_TELEGRAM_BOT_TOKEN | Optional | Telegram bot token from @BotFather |
EXPO_PUBLIC_TELEGRAM_CHAT_ID | Optional | Telegram chat ID for receipt delivery |
All variables prefixed with
EXPO_PUBLIC_ are exposed to the client bundle. Never use this prefix for secret keys.Permissions
TableOrder requires the following device permissions, configured inapp.json:
- Android
- iOS
app.json
- Camera: QR code scanning for table identification
- Location: GPS geofencing for mode detection
- Audio recording permission is requested but not used
Troubleshooting
Map not displaying
Map not displaying
Symptoms: Black screen where map should appearSolutions:
- Verify
EXPO_PUBLIC_MAPBOX_TOKENis set correctly in.env - Check your Mapbox token is valid at account.mapbox.com
- Ensure token has required scopes enabled
- Run
npx expo prebuild --cleanto regenerate native projects
Build fails with Mapbox error
Build fails with Mapbox error
Symptoms: Build error mentioning Mapbox downloads or authenticationSolutions:
- Verify
RNMAPBOX_MAPS_DOWNLOAD_TOKENis set in.env - Ensure the secret token has
DOWNLOADS:READscope - Restart Metro bundler:
npm start -- --clear - Clean build:
npx expo prebuild --clean
Camera permission denied
Camera permission denied
Symptoms: QR scanner shows blank screen or permission errorSolutions:
- Uninstall the app completely
- Reinstall with
npx expo run:androidornpx expo run:ios - Grant camera permission when prompted
- On iOS: Check Settings > Privacy > Camera > TableOrderApp
- On Android: Check Settings > Apps > TableOrderApp > Permissions
Location not working
Location not working
Symptoms: App stuck on loading screen or shows permission deniedSolutions:
- Ensure location services are enabled on your device
- Grant location permission when prompted
- On iOS Simulator: Features > Location > Custom Location
- On Android Emulator: Use Extended Controls (⋮) > Location
Metro bundler errors
Metro bundler errors
Symptoms: Build errors, module resolution failures, or cache issuesSolutions:
Next steps
Quick start guide
Test the app with example QR codes and explore both modes
Architecture overview
Learn about the codebase structure and design patterns