> For the complete documentation index, see [llms.txt](https://legendbae.gitbook.io/legendbae-connect-to-people/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://legendbae.gitbook.io/legendbae-connect-to-people/installation/untitled.md).

# App Setup

## Firebase Configuration <a href="#admin-web-dashboard" id="admin-web-dashboard"></a>

### 1. Create a Firebase Project <a href="#id-1-create-a-firebase-project" id="id-1-create-a-firebase-project"></a>

Head over to [Firebase.com](https://firebase.google.com/) and create a new account. Once logged in, you’ll be able to create a new project in the [Firebase Console](https://console.firebase.google.com/u/0/).

* Create a new account on [Firebase.com](https://firebase.google.com/)
* Create a new project in [Firebase Console](https://console.firebase.google.com/)
* Enable Phone, Google & Facebook auth method in *Firebase Console* -> *Authentication* -> *Sign-in method*
* Create a new iOS app, with App ID *com.example*

![](/files/-MGr2Vp9VRhMmx-5prnl)

* Create a new Android app with package name *com.example*
* Download the configuration file generated at the next step to your computer (*GoogleService-Info.plist* for iOS, and *google-services.json* for Android)
* Create database from Cloud Firestore

![](/files/-MGr4XxxJQ_DEgJEx88H)

### 2. Create a Cloudinary Account <a href="#id-1-create-a-firebase-project" id="id-1-create-a-firebase-project"></a>

* Create a cloudinary app for media uploading. <https://cloudinary.com/documentation/how_to_integrate_cloudinary>

### 3. Create a Stripe Account <a href="#id-1-create-a-firebase-project" id="id-1-create-a-firebase-project"></a>

* Create a stripe account for the payment gateway. <https://www.paulisystems.net/how-to-create-a-stripe-account-for-online-payment-processing/?cn-reloaded=1>

## Mobile App Configuration <a href="#admin-web-dashboard" id="admin-web-dashboard"></a>

Steps to initiate the app.

* Go to the App folder

* Type on terminal: `npm install`

* Open a code editor of your choice.<br>

* Go to `src/config/config.js`. Update\
  `WEB_CLIENT`  with `YOUR_WEB_CLIENT`  (Get this value from Firebase console > Authenication > Sign in Method > Google > Web SDK Configuration)\
  `CLOUDINARY_PRESENT_NAME,` with `YOUR_CLOUDINARY_PRESENT_NAME` (Get this value from Cloudinary dashboard > Settings > Upload > Upload presents)\
  `CLOUDINARY_CLOUD_NAME` with `YOUR_CLOUDINARY_CLOUD_NAME` (Get this value from Cloudinary dashboard)\
  `STRIPE_PUBLIC_KEY` with `YOUR_STRIPE_PUBLIC_KEY` (Get this value from Stripe dashboard > Developers > API keys)

  `STRIPE_CLOUD_SERVER_URL` with `YOUR_STRIPE_CLOUD_SERVER_URL` (Get this value from  below **How to get stripe cloud URL**)&#x20;

  `IS_STRIPE_LIVE`  set `true` and `false` (Set true if you use live `STRIPE_PUBLIC_KEY` otherwise false)

* Facebook Setup On Android and iOS\
  iOS:\
  1\) Navigate to **`ios`** folder\
  2\) Navigate **`Epicbae/Info.plist`** replace the `value` of `FacebookAppID` and `FacebookDisplayName` with `YourFacebookAppID` & `YourFacebookDisplayName`  \
  Android: \
  1\) Navigate to **`android`** folder\
  2\) Navigate **`app/src/main/res/values/strings.xml`** replace the `value` of `facebook_app_id` and `fb_login_protocol_schema` with `yourfacebook_app_id` & `yourfb_login_protocol_schema`

* Firebase Setup on Android and iOS\
  iOS:\
  1\) Navigate to **`ios/Epicbae`** folder\
  2\) Added **`GoogleService-Info.plist`** file to project \
  Android:\
  1\) Navigate to **`android/app`** folder\
  2\) Added **`google-services.json`** file to project<br>

* If you would like to run the app in Android, you need to connect an Android phone to a system or you can run the app on an Android emulator. Type `react-native run-android` Make sure that you have configured the AVD before running the command. If you would like to run the app on an iPhone simulator(MacOS), run `react-native run-ios`.\
  NOTE: Make sure you run the Epicbae.xcworkspace project<br>

### 2. How to get stripe cloud URL <a href="#id-1-create-a-firebase-project" id="id-1-create-a-firebase-project"></a>

* We then need to install the firebase-tools package globally using NPM.\
  `$ npm install -g firebase-tools`
* Now we have firebase-tools installed, we should log in to our firebase account and initiate a new project in our project directory. You will get a choice of which services you would like to use — you only need to select ‘Functions’ here for now.\
  `$ firebase login` \
  `$ firebase init`
* Let’s move into the functions folder.\
  `$ npm install`
* We can then deploy our function and get our endpoint (Function URL in output in screenshot).\
  `$ firebase deploy --only functions`

![](/files/-MHKJuMWQt9eOkyrjc8L)

* **Additional Information** \
  1\) Here is Facebook Authentication Step for Integration on iOS and Android  <https://firebase.google.com/docs/auth/?authuser=0>\
  2\) Here is Stripe payment with Firebase Cloud function tutorial\
  <https://medium.com/enappd/stripe-payment-integration-in-react-native-apps-using-firebase-926c3b1f1448>

&#x20;
