A React Native project boilerplate for producing reliable applications.
This project is a React Native boilerplate that can be used to kickstart a mobile application.
The boilerplate provides a architecture optimized for developing reliable cross-platform mobile applications through the separation of concerns between the UI and business logic. It is remarkably documented so that each section of code that lands in your application can be understood and used.
If you find this boilerplate useful then please give the repository a star
The main purpose of the Architecture of the boilerplate is the separation of concerns
Presentational components are separated from screens.
State is managed using global Redux stores.
Application side-effects (API calls, etc.) are separated from UI and state manipulation using Redux Saga.
The boilerplate contains:
NavigationService
to handle routing and navigation in the boilerplateDarkTheme
and LightTheme
Note: Custom Drawer and Custom Bottom Tabs are also part of the boilerplate.
app/components
: Presentational componentsapp/screens
: The application's screensapp/assets
: Assets (image, audio files) used by the applicationapp/i18next
: Language setup and localize used by the applicationapp/navigation
: React-Navigation settingapp/redux/store
: Redux storeapp/redux/sagas
: Redux sagasapp/redux/actions
: Redux actionsapp/redux/reducers
: Redux reducersapp/redux/connects
: Redux data connectorsapp/redux/types
: Redux action typesapp/redux/api
: application services, e.g. API clientsapp/Utils
: Styles helpers for the applicationapp/config
: Routes and Screen configurationsapp/constants
: Colors, images and common stylesapp/helpers
: Colors, images and common stylesNode 8 or greater is required. Development for iOS requires a Mac and Xcode 9 or up and will target iOS 9 and up.
You also need to install the dependencies required by React Native:
To create a new project using the boilerplate:
rm -rf .git/
yarn
or npm install
yarn run rename -- <YourProjectName>
or npm run rename -- <YourProjectName>
(the default name is boilerplate
)yarn run rename -- <YourProjectName> -b <bundleIdentifier>
or npm run rename -- <YourProjectName> -b <bundleIdentifier>
(the default name is boilerplate
)FacebookAppID
and FacebookLoginProtocolScheme
value in the .env.staging and .env.production files present in the root directorygoogle-services.json
into Android/app
folderGoogleService-Info.plist
to project folder in the xcode and replace REVERSED_CLIENT_ID
value present in the .env.staging
and .env.production
with REVERSED_CLIENT_ID
present in the GoogleService-info.plistandroid/app/src/main/assets/appcenter-config.json
. Go to the Distribute
side menu on the app center, click code push, and generate production and staging deployment keys. Place production deployment key into file .env.production
present in the root directory against key CodePushDeploymentKey_Android
and place staging deployment key into file .env.staging
present in the root directory against key CodePushDeploymentKey_Android
AppCenter-Config.plist
. Go to the Distribute
side menu on the app center, click code push, and generate production and staging deployment keys. Place production deployment key into file .env.production
present in the root directory against key CodePushDeploymentKey_iOS
and place staging deployment key into file .env.staging
present in the root directory against key CodePushDeploymentKey_iOS
You can now create a new git repository for your project (using git init
) and create the first commit.
Assuming you have all the requirements installed, you can setup and run the project by running:
yarn
or npm install
to install the dependenciescd android/app
keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000
cd ../..
to come back to the root folderyarn start
or npm install
to start the metro bundler, in a dedicated terminalyarn run android:debug-release
or npm run android:debug-release
to run the Android application (remember to start a simulator or connect an Android phone)cd ios
pod install
to install pod dependenciescd ..
to come back to the root folderreact-native run-ios
to run the iOS application (remember to start a simulator or connect an iPhone phone)CodePush is an App Center cloud service that enables Apache Cordova and React Native developers to deploy mobile app updates directly to their users’ devices.
Google Sign-In is a secure authentication system that reduces the burden of login for your users, by enabling them to sign in with their Google Account—the same account they already use with Gmail, Play, and other Google services.
The Facebook SDK for is the easiest way to integrate your app with Facebook. It enables:
Facebook Analytics
- Understand how people are using your product.Facebook Login
- Authenticate people with their Facebook credentials.Share and Send dialogs
- Enable sharing content from your app to Facebook.App Events
- Log events in your application.Graph API
- Read and write to Graph API.I18next is an internationalization-framework written in and for JavaScript. But it's much more than that.
i18next goes beyond just providing the standard i18n features such as (plurals, context, interpolation, format). It provides you with a complete solution to localize your product from web to mobile and desktop.
This project is released under the MIT License.
I looked into existing boilerplates before starting this project, and while many of them are awesome, But every boilerplate was lacking something, so I come up with a boilerplate that has all the features that modern app needed. For example
React Native Latest Stable Version (v0.63.2)
Great Architecture
React Navigation 5 Integrated
Redux Integrated
Redux Saga Integrated
Redux Persist Integrated
Firebase SDK Integrated
Facebook SDK Integrated
Google Sign-in SDK Integrated
Code-Push SDK Integrated
Push Notifications Integratd
Theme Integrated
Multilingual Integrated
Splash Screen Integrated
Vector Icons Integrated
TypeScript Support