The project was developed on MacBook air M1 and all the instructions in this guide are based on macOS Big Sur. Before proceeding it is needed that you have installed on your machine the following tools:
- brew install node
- brew install watchman
- brew tap wix/brew
- brew install --HEAD applesimutils
- npm install -g detox-cli
- Follow the installation process on react-native-setup
- Create a .env file with the following structure and add the accordinly values:
FIREBASE_API_KEY=''
FIREBASE_AUTH_DOMAIN=''
FIREBASE_PROJECT_ID=''
FIREBASE_STORAGE_BUCKET=''
FIREBASE_MESSAGING_SENDER_ID=''
FIREBASE_APP_ID=''
FIREBASE_MEASUREMENT_ID=''
FIREBASE_DATABASE_URL=''
In order to run the project in development mode please execute the following steps:
- npm install // on root directory of the project
- npm run android
- cd ios && pod install && cd ..
- npm run ios
PS: In order to execute the projects the android emulator must be running or for ios it starts automatically. For more information about how to configure android emulator on your machine check react-native-android
In order to execute unit test you need to execute npm run test on root directory of the project
For e2e i chose the wix framework which is very used on the marked and has a high support on community and in order to execute e2e you need to execute the following command on root directory of the project:
- npm run e2e:buid:android
- npm run e2e:test:android
- npm run e2e:buid:ios
- npm run e2e:test:ios
On this app Its being followed the flux architecture using duck pattern in order to make code cleaner and easy to maintain. Besides that redux is being used as a state management and redux-thunk acting as middleware for async data fetch before passing the data to the reducers.
On redux-thunk-architecture you can see how it works.
- In case you have any trouble executing the app on Android please make sure ANDROID_HOME are properly exported on your ~/.bashrc
export ANDROID_HOME=$HOME/Library/Android/sdk export PATH=$PATH:$ANDROID_HOME/emulator export PATH=$PATH:$ANDROID_HOME/tools export PATH=$PATH:$ANDROID_HOME/tools/bin export PATH=$PATH:$ANDROID_HOME/platform-tools
-
If there is any problem when building android project It is highly recommended to increase the memory heap on gradle properties.
-
Open the file android/gradle.properties with your prefered editing text tool then add the lines below in the file
-
org.gradle.daemon=true
-
org.gradle.jvmargs=-Xmx4096m
- On iOS has a problem to load the remote config, so there is a fallback to dont let app stop working
- I wasnt able to execute e2e for iOS