Deploy API-Server & Mobile App in Local machine
Api Server
Installation Steps
Step 1: Download the Native Starter Pro app and extract it
Step 2: Open terminal and go to NativeStarterPro folder where you have extracted, there you would find modules: Api-Server, Mobx-Starter-App, Redux-Starter-App. Choose either one of Mobx or Redux starter app at a time.
Step 3: Goto Api-Server folder and install node_modules by npm install or yarn
Step 4: Start the Api Server by npm start. Now Api-Server is up and running.
Step 5: On another terminal run mongod, this would start mongo server.
Common issue of 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
Mobx-Starter-App
Installation steps
Step 1: Goto NativeStarterPro/Mobx-Starter-App
Step 2: Now change the url and port number. Goto js/config.js and change the root to
root: 'YOUR_IP:PORT/api',
port: 3000 // incase of running api-server (node app) in development
port: 3030 //incase of running api-server (node app) in production
port: 443 //incase of running api-server (node app) on heroku
Step 3: npm i
Step 4: npm start
Step 5: If you would like to run app in android you need to connect the android phone to a system or via android emulator, and type npm run android. Make sure you have configured the AVD before running the command. If you would like to run app in iPhone simulator (MacOS) run npm run iOS
Note:
- Make sure you have same network in the mobile.
- Follow Mobx-Starter-App procedure, in case if you want to deploy for Redux-Starter-App.