Skip to main content
This guide walks you through setting up your development environment to run and build the DPM Delivery Mobile app.

Prerequisites

Before you begin, ensure you have the following installed:

Required Software

  • Node.js (LTS recommended, version 18 or higher)
  • bun - Fast JavaScript package manager and runtime
  • Expo CLI (optional; npx expo works without global installation)
  • Git - For version control

Platform-Specific Requirements

Requirements:
  • macOS (required for iOS development)
  • Xcode (latest stable version)
  • Xcode Command Line Tools
  • CocoaPods
Installation:
  1. Install Xcode from the Mac App Store
  2. Install Command Line Tools:
    xcode-select --install
    
  3. Install CocoaPods:
    sudo gem install cocoapods
    
  4. Open Xcode and accept the license agreement
  5. Configure iOS Simulator from Xcode preferences
Testing:
# Verify Xcode installation
xcodebuild -version

# Verify CocoaPods
pod --version

Installing Dependencies

1. Clone the Repository

git clone <your-repo-url>
cd dpm-parcel-delivery-app

2. Install Node.js

Download and install Node.js from nodejs.org. Verify installation:
node --version  # Should show v18.x.x or higher
npm --version

3. Install bun

curl -fsSL https://bun.sh/install | bash
Verify installation:
bun --version

4. Install Project Dependencies

bun install
This will install all dependencies from package.json, including:
  • expo (~54.0.32) - Core Expo framework
  • react-native (0.81.5) - React Native framework
  • heroui-native - UI component library
  • uniwind - Tailwind CSS for React Native
  • @tanstack/react-query - Data fetching and caching
  • expo-router - File-based navigation

Environment Configuration

Create a .env.local file in the project root with required environment variables:
# Required: Backend API endpoint
EXPO_PUBLIC_API_BASE_URL=https://your-api.example.com

# Required: Encryption key for MMKV storage
EXPO_PUBLIC_ENCRYPTION_KEY=your-encryption-key

# Required: Web crypto key for browser storage
EXPO_PUBLIC_WEB_CRYPTO_KEY=your-web-crypto-key
Missing environment variables will cause runtime errors. All three variables are validated in src/utils/env.ts.
See Configuration for more details on environment variables.

Starting the Development Server

Start the Expo development server:
bun start
# or
bunx expo start

Running on Different Platforms

Once the dev server is running, press:
  • i - Open iOS simulator
  • a - Open Android emulator
  • w - Open in web browser
  • r - Reload app
  • m - Toggle menu
Or use platform-specific commands:
# iOS
bun run ios

# Android
bun run android

# Web
bun run web

Using Expo Go

For quick testing without building native projects:
  1. Install Expo Go on your device:
  2. Start the dev server:
    bun start
    
  3. Scan the QR code with:
    • iOS: Camera app
    • Android: Expo Go app
Some features requiring native modules may not work in Expo Go. For full functionality, use development builds or run directly on emulators.

Troubleshooting

iOS Issues

Pods not installing:
cd ios
pod deintegrate
pod install
cd ..
Xcode build errors:
cd ios
xcodebuild clean
cd ..
bun run ios

Android Issues

Gradle build errors:
cd android
./gradlew clean
cd ..
bun run android
Emulator not starting:
# Check available AVDs
emulator -list-avds

# Start specific AVD
emulator -avd <avd-name>
Port conflicts:
# Kill process on port 8081
npx kill-port 8081

General Issues

Clear cache and restart:
bunx expo start --clear
Reinstall dependencies:
rm -rf node_modules
rm bun.lock
bun install

Next Steps

Build docs developers (and LLMs) love