App Setup

here come the steps to create your backends, deploy the API, and get your endpoints

Firebase Configuration

1. Create a Firebase Project

Head over to Firebase.com and create a new account. Once logged in, you’ll be able to create a new project in the Firebase Console.

  • Create a new account on Firebase.com

  • Create a new project in Firebase Console

  • Enable Phone, Google & Facebook auth method in Firebase Console -> Authentication -> Sign-in method

  • Create a new iOS app, with App ID com.example

  • 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

2. Create a Cloudinary Account

3. Create a Stripe Account

Mobile App Configuration

Steps to initiate the app.

  • Go to the App folder

  • Type on terminal: npm install

  • Open a code editor of your choice.

  • 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)

    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

  • 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

2. How to get stripe cloud URL

  • 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

Last updated