๐ฑ 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โ
- Install Xcode from the Mac App Store
- Install iOS Simulator through Xcode
- Install CocoaPods:
sudo gem install cocoapods - Install iOS dependencies:
cd ios && pod install && cd ..
Android Setupโ
- Install Android Studio
- Install Android SDK (API level 24+)
- Set up Android Emulator
- 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โ
- Download configuration files:
GoogleService-Info.plist(iOS)google-services.json(Android)
- Place files in project root
- Configure Firebase project in Firebase Console
Apple Sign-In Setupโ
- Enable Apple Sign-In in Apple Developer Console
- Configure Sign-In capability in Xcode
- Add Apple Sign-In to app configuration
Google Sign-In Setupโ
- Enable Google Sign-In in Google Cloud Console
- Configure OAuth client for mobile app
- 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โ
- Install React Native Debugger
- Configure Metro bundler
- Enable debugging in app
Flipper Integrationโ
- Install Flipper
- Configure Flipper for React Native
- Enable Flipper in development
Network Debuggingโ
- Enable network inspection
- Configure proxy for API calls
- 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โ
- Configure App Store Connect
- Set up app metadata
- Configure app icons and screenshots
- Submit for review
Play Store Setupโ
- Configure Google Play Console
- Set up app listing
- Configure app signing
- 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โ
- Enable Developer Mode on device
- Install development build
- Configure device for debugging
- Test on real device
Simulator Testingโ
- Launch iOS Simulator
- Launch Android Emulator
- Test app functionality
- Debug performance issues
๐ Security Setupโ
Code Signingโ
- Configure iOS code signing
- Set up Android app signing
- Manage certificates
- Configure provisioning profiles
Environment Securityโ
- Secure environment variables
- Use secure storage for sensitive data
- Implement certificate pinning
- Configure app transport security
๐ Analytics Setupโ
Firebase Analyticsโ
- Enable Firebase Analytics
- Configure analytics events
- Set up conversion tracking
- Monitor app performance
Crash Reportingโ
- Enable Firebase Crashlytics
- Configure crash reporting
- Set up error tracking
- Monitor app stability