This application is a React Native app with a Node.JS backend.
This application depends on the following third party services:
- Firebase
- Stripe
-
Make sure you're in the remote-working/ directory:
$ cd remote-working/
-
Run the following command to install all the required node nodules:
$ npm install
-
(Optional) To connect to a local middle tier services, change the following:
axios.defaults.baseURL = "http://xx.xxx.xxx.xx:4000";
To your local IP address, or the address of the Firebase hosting url (if running)
-
Run the following command to start the app:
$ npm start
- Follow the instructions in the terminal to run the app on a physical or virtual device.
The app's Node JS based middle tier should be running via Firebase hosting on the URL https://remoteruralworking.firebaseapp.com. These are the steps to run this locally or deploy to this domain.
-
Install firebase-tools globally.
$ npm i -g firebase-tools
-
Make sure you're in the server directory:
$ cd remote-working/server
-
Run the following command to install all the required node nodules for the functions:
$ cd functions $ npm install $ cd ..
-
Run the following command to build locally NOTE: Lock API functions will not work locally unless you build a publicly accessible proxy using ngrok.
$ firebase serve --only functions,hosting
OR
To deploy to the server:
$ firebase deploy --only functions,hosting
-
Provide authorisation for the middle tier to connect to the lock API by copying line 5 of server/functions/index.js into a web browser and following the instructions to log in.
The app could be packaged and published with the concole command expo build:ios or expo build:android and following the instructions (although this is untested). More explaination on this is at https://docs.expo.io/versions/latest/distribution/building-standalone-apps/#3-start-the-build
'Thanks to James for this'
Please refer to CONTRIBUTING.MD
Used the following tutorials:
CRUD Operations: https://www.djamware.com/post/5bbcd38080aca7466989441b/react-native-firebase-tutorial-build-crud-firestore-app
Auth: https://medium.com/react-native-training/react-native-firebase-authentication-7652e1d2c8a2
Firebase Hosting: https://www.youtube.com/watch?v=LOeioOKUKI8