Sample Code for ReactNative
- Sample folder structure
- Basic Authentication screens(Login, Signup, Forgot Password) and flow
- Reusable common components, utility functions and constants
- Logger to log data more clearly using coloured logs in Chrome Debugger
- Navigation using react-navigation (v6)
- State management using redux
- Redux middleware redux-saga
- Git hooks using husky
- Staging and Production environment configurations using react-native-config
- TDD(Test-Driven Development) using jest
- (Unsecured) local data storage using AsyncStorage
- Splash screen using react-native-bootsplash
- API requests using axios
- Localization using react-native-localization
- Responsive UI using flexbox and react-native-size-matters
- Clone the repo
git clone https://github.com/binitvermani/sample-app-react-native.git
- Install
node_modules
if using yarn:
yarn install
if using npm:
npm install
- Install
pods(if running on MacOS)
An automation script runPostInstallUninstallTasks is added into the project which will run after every npm dependency install or uninstall. Using this, the step 2 will automatically install the pods for iOS if you are using the MacOS. For some reason, if the step 2 will fail to install the pods, then you can mannually install the pods using:
cd ios && pod install
- Create ENV files
Hit the following commands in the terminal to create the .env files for the respective environment. .env.staging and .env.production are added into the .gitignore file and will not be pushed to the version control system.
echo ENV_TYPE=staging > .env.staging
echo ENV_TYPE=production > .env.production
This app is configured for the custom staging and production environments. So, the standard npm run android or npm run ios commands will not work on this project.
- To run Android Staging Debug:
yarn androidStagingDebugornpm run androidStagingDebug - To run iOS Staging Debug:
yarn iosStagingDebugornpm run iosStagingDebug - To run Android Production Debug:
yarn androidStagingDebugornpm run androidProductionDebug - To run iOS Production Debug:
yarn androidStagingDebugornpm run iosProductionDebug