This guide provides all the necessary steps to set up, build, and run the GhostRecon application for development and production.
Before you begin, ensure you have the following installed on your development machine:
- Node.js (LTS version recommended)
- Yarn (the project uses Yarn for package management)
- Git
- Watchman (for macOS users)
- An Android Emulator (via Android Studio) or a physical Android device.
Follow these steps to get the project running on your local machine.
Clone this repository to your local machine: '''sh git clone cd GhostRecon/frontend '''
Install the required Node.js packages using Yarn: '''sh yarn install '''
The project uses Firebase for core features like authentication and notifications. You must configure it correctly to avoid API failures.
- Go to your project's settings in the Firebase Console.
- In the "Your apps" card, select your Android app (package name:
com.sonsofunity.ghostrecon). - Under "SDK setup and configuration", click the
google-services.jsonbutton to download the configuration file.
Copy the downloaded google-services.json file into the following directory:
'''
frontend/android/app/
'''
During development, we discovered that the app quickly exceeds the free "Spark Plan" quota for Firebase services, leading to a RESOURCE_EXHAUSTED error that prevents login.
To fix this, you must upgrade your Firebase project to the "Blaze" (Pay-as-you-go) plan.
- Go to the Usage and billing section in your Firebase console and follow the instructions to upgrade.
- The Blaze plan still includes a generous free tier, but this step is required to prevent the login/initialization process from failing.
This project uses native libraries (like react-native-webrtc) that are not included in the standard Expo Go app. Therefore, you must create a custom development build to run the app.
- Log in to your Expo account using the Expo CLI: '''sh eas login '''
- From the
frontenddirectory, start the build process: '''sh eas build --profile development --platform android ''' - EAS will build your app and provide a link to download the
.apkfile when it's finished.
- Start your Android Emulator or connect your physical device.
- Install the APK: Drag the downloaded
.apkfile onto your running emulator window. - Start the Metro Server: In your terminal (inside the
frontenddirectory), run: '''sh yarn start ''' - Open the App: Launch the "GhostRecon" app on your emulator. It will automatically connect to the Metro server, and you can begin testing.
When you are ready to submit your app to the Google Play Store, you can create a production build.
'''sh eas build --profile production --platform android '''
'''sh eas build --profile production-apk --platform android '''
Following these steps will ensure a smooth setup and help you avoid the common configuration and runtime errors we've diagnosed.