Deploy Api-Server in Local machine
Requirement
Api server
Installation Steps
Step 1: Download the vChat app and extract it
Step 2: Open terminal and Go to Full-apps folder where you have extracted, there you would find 2 modules api-server, mobile-app
Step 3: Go to ApiServer folder and install npm or yarn npm install
or yarn
Step 4: Open another terminal and enter mongod
this would start mongo server
Step 5: Start the api server npm start
now api-server is up and running
The common issue of the mongo server
unable to lock file: /data/db/mongod.lock resource temporarily unavailable. Is a mongod instance already running? , terminating,
You need to enter,
sudo killall -15 mongod
Cloudinary Config
- Go to ApiServer/config/cloudinaryConfig.js/
- Enter
cloud_name: ' '
api_key: ' '
api_secret: ' '
- Enter
Twilio Config
- Go to ApiServer/config/twilioConfig.js/
- Enter
accountSid: ' '
authToken: ' '
- Enter
Mobile App
Installation steps
Steps: Initiate app for Mobile App folder
- Type
npm i
- Navigate to ios folder in mobile App and do
pod install
- Open sublime or any editor
- Go to mobileApp/config.js .serverSideUrl: "paste the IP address or the URL and the port "
Configuring Google Map
Update YOUR_GOOGLE_API_KEY
in AppName/ios/AppName/AppDelegate.m file for ios in line 57
Update YOUR_GOOGLE_API_KEY
in AppName/android/app/src/main/AndroidManifest.xml file for Android in line 39
Get Google Map API key from here
If you have trouble setting up follow here
Configuring Phone Auth By Firebase
Add Project on Firebase Console
Android
You need to generate SHA-1 fingerprint certificate for both debug and release mode as well and place the key in firebase Project
FirebaseProjectName/settings/project settings/
You need to add file
google-services.json
in AppName/android/app folder .
iOS
You need to generate APNS certificate and upload it at
firebase project/settings/project settings/cloud Messaging/
You need to add file
GoogleService-Info.plist
in AppName/ios/.
Configuring Sentry
Create App on sentry.io You need to update sentry.properties file inside ios folder and in an android folder, along with it update the DNS for your app in App.js in the root folder of Mobile App
Follow documentation here and link your Mobile App.
Configuring Push Notification
Go to Firebase Console -> Settings -> Project Settings -> Cloud Messaging -> iOS app configuration
You will get Google Server API Key on the same page of iOS app configuration
Create Firebase Project and go to
settings/Cloud Messaging
and copy the Server KeyNow Update the ServerKey in
apiserver/server/service/ pushNotification.js
Connect the android phone to a system or via android emulator
Whenever npm i
is performed, you need to run the command:
npx jetify
npx react-native run-android
Note
: If you are running the app in Ubuntu O.S. :
Start JS Server by running command
npm start
under Mobile App Directory in another terminalAdd local.properties file in the android folder for both Rider and Driver and write
sdk.dir="sdk path"
Make sure you have configured the AVD before running the command, If you would like to run the app in iPhone simulator (MacOS) run
react-native run-ios
Set Simulator Location- Go to Debug-> Location-> Custom Location->Enter
Latitude and Longitude
of your Current LocationNote: Make sure you have the same network in the mobile If you are running app on ios make sure you have open
AppName.xcworkspace
.