Skip to main content

๐Ÿ“ฑ Mobile App Development Setup

This comprehensive guide will help you set up and run the Com DEALL mobile app using React Native with Expo Developer Build.

โœ… Prerequisitesโ€‹

System Requirementsโ€‹

  • Node.js: v18.0.0 or higher
  • npm: v8.0.0 or higher
  • Yarn: v1.22.0 or higher
  • Git: Latest version

Platform-Specific Requirementsโ€‹

iOS Developmentโ€‹

  • macOS: macOS 10.15 (Catalina) or higher
  • Xcode: v14.0 or higher
  • iOS Simulator: Latest version
  • CocoaPods: v1.11.0 or higher

Android Developmentโ€‹

  • Android Studio: Latest version
  • Android SDK: API level 24 or higher
  • Java: JDK 11 or higher
  • Android Emulator: Latest version

Development Toolsโ€‹

  • Expo CLI: Latest version
  • EAS CLI: Latest version
  • React Native CLI: Latest version
  • Metro Bundler: Included with Expo

๐Ÿš€ Environment Setupโ€‹

1. Install Expo CLIโ€‹

npm install -g @expo/cli
npm install -g eas-cli

2. Install Dependenciesโ€‹

# Navigate to mobile app directory
cd apps/comdeall-mobile

# Install dependencies
yarn install

# Install platform-specific dependencies
yarn android:install
yarn ios:install

3. Environment Configurationโ€‹

Create a .env file in the mobile app root directory:

# API Configuration
GRAPHQL_SERVER_URI=https://api.communicaids.com/v1/graphql
GRAPHQL_SERVER_SUBSCRIPTION_URI=wss://api.communicaids.com/v1/graphql
GRAPHQL_ADMIN_SECRET_KEY=your-secret-key

# Firebase Configuration
FIREBASE_PROJECT_ID=your-project-id
FIREBASE_API_KEY=your-api-key
FIREBASE_MESSAGING_SENDER_ID=your-sender-id

# Deep Linking
DEEP_LINK_SCHEME=com.comdeall.communicaids
UNIVERSAL_LINK_DOMAIN=mobileapp.communicaids.com

# App Configuration
APP_VERSION=1.3.0
BUILD_NUMBER=65

๐Ÿ”ง Development Commandsโ€‹

Start Development Serverโ€‹

# Start with dev client
npx expo start --dev-client --clear

# Start with specific platform
npx expo start --android
npx expo start --ios
npx expo start --web

Build Commandsโ€‹

# Build for development
yarn android:install
yarn ios:install

# Build for production
yarn android-build
yarn ios-build

# Build for web
yarn web-build

Code Generationโ€‹

# Generate GraphQL types
yarn gen

# Generate before starting
yarn start

๐Ÿ“ฑ Platform Setupโ€‹

iOS Setupโ€‹

  1. Install Xcode from the Mac App Store
  2. Install iOS Simulator through Xcode
  3. Install CocoaPods:
    sudo gem install cocoapods
  4. Install iOS dependencies:
    cd ios && pod install && cd ..

Android Setupโ€‹

  1. Install Android Studio
  2. Install Android SDK (API level 24+)
  3. Set up Android Emulator
  4. Configure environment variables:
    export ANDROID_HOME=$HOME/Library/Android/sdk
    export PATH=$PATH:$ANDROID_HOME/emulator
    export PATH=$PATH:$ANDROID_HOME/tools
    export PATH=$PATH:$ANDROID_HOME/tools/bin
    export PATH=$PATH:$ANDROID_HOME/platform-tools

๐Ÿ” Authentication Setupโ€‹

Firebase Configurationโ€‹

  1. Download configuration files:
    • GoogleService-Info.plist (iOS)
    • google-services.json (Android)
  2. Place files in project root
  3. Configure Firebase project in Firebase Console

Apple Sign-In Setupโ€‹

  1. Enable Apple Sign-In in Apple Developer Console
  2. Configure Sign-In capability in Xcode
  3. Add Apple Sign-In to app configuration

Google Sign-In Setupโ€‹

  1. Enable Google Sign-In in Google Cloud Console
  2. Configure OAuth client for mobile app
  3. Add Google Sign-In to app configuration

๐Ÿงช Testing Setupโ€‹

Unit Testingโ€‹

# Run unit tests
yarn test

# Run tests with coverage
yarn test --coverage

E2E Testingโ€‹

# Install Detox
yarn add -D detox

# Build for testing
detox build --configuration ios.sim.debug
detox test --configuration ios.sim.debug

Lintingโ€‹

# Run ESLint
yarn lint

# Fix linting issues
yarn lint --fix

๐Ÿ“Š Debugging Setupโ€‹

React Native Debuggerโ€‹

  1. Install React Native Debugger
  2. Configure Metro bundler
  3. Enable debugging in app

Flipper Integrationโ€‹

  1. Install Flipper
  2. Configure Flipper for React Native
  3. Enable Flipper in development

Network Debuggingโ€‹

  1. Enable network inspection
  2. Configure proxy for API calls
  3. Monitor network requests

๐Ÿš€ Deployment Setupโ€‹

EAS Build Configurationโ€‹

# Configure EAS
eas build:configure

# Build for preview
eas build --platform android --profile preview
eas build --platform ios --profile preview

# Build for production
eas build --platform android --profile production
eas build --platform ios --profile production

App Store Setupโ€‹

  1. Configure App Store Connect
  2. Set up app metadata
  3. Configure app icons and screenshots
  4. Submit for review

Play Store Setupโ€‹

  1. Configure Google Play Console
  2. Set up app listing
  3. Configure app signing
  4. Submit for review

๐Ÿ”ง Troubleshootingโ€‹

Common Issuesโ€‹

Metro Bundler Issuesโ€‹

# Clear Metro cache
npx expo start --clear

# Reset Metro cache
npx expo start --reset-cache

iOS Build Issuesโ€‹

# Clean iOS build
cd ios && xcodebuild clean && cd ..

# Reinstall pods
cd ios && pod deintegrate && pod install && cd ..

Android Build Issuesโ€‹

# Clean Android build
cd android && ./gradlew clean && cd ..

# Clear Gradle cache
rm -rf ~/.gradle/caches

Dependency Issuesโ€‹

# Clear node modules
rm -rf node_modules
yarn install

# Clear yarn cache
yarn cache clean

Performance Issuesโ€‹

  • Enable Hermes for better performance
  • Optimize bundle size with code splitting
  • Use Fast Image for image optimization
  • Implement lazy loading for screens

๐Ÿ“ฑ Device Testingโ€‹

Physical Device Testingโ€‹

  1. Enable Developer Mode on device
  2. Install development build
  3. Configure device for debugging
  4. Test on real device

Simulator Testingโ€‹

  1. Launch iOS Simulator
  2. Launch Android Emulator
  3. Test app functionality
  4. Debug performance issues

๐Ÿ” Security Setupโ€‹

Code Signingโ€‹

  1. Configure iOS code signing
  2. Set up Android app signing
  3. Manage certificates
  4. Configure provisioning profiles

Environment Securityโ€‹

  1. Secure environment variables
  2. Use secure storage for sensitive data
  3. Implement certificate pinning
  4. Configure app transport security

๐Ÿ“Š Analytics Setupโ€‹

Firebase Analyticsโ€‹

  1. Enable Firebase Analytics
  2. Configure analytics events
  3. Set up conversion tracking
  4. Monitor app performance

Crash Reportingโ€‹

  1. Enable Firebase Crashlytics
  2. Configure crash reporting
  3. Set up error tracking
  4. Monitor app stability

๐ŸŽฏ Next Stepsโ€‹