Short description about the project (Business case)
- About the project
- Run application
- Additional info
- Coding conventions
- Useful links
- Git conventions
- Troubleshooting
This is boilerplate.
- Yarn
- Node
NOTE: We always use Yarn as our default package manager tool.
// start development server
yarn start
// run ios app
yarn ios
// run android app
yarn android
PRO TIP: Make sure you’re connected to the internet!🙃
Open your terminal or run it inside this project's integrated terminal:
git --version
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
chmod -R 777 ./scripts
./scripts/reactNativeStarterPack.sh
NOTE: Script doesn't cover Xcode installation so you have to grab it from here.
yarn test-e2e
- For application monitoring and error tracking we're using Sentry
- For deployments and releases we're using Fastlane
- For navigation we're using react-native-router-flux, you can find demo navigation example on
src/containers/Routes.js
- Localization support is also included in the boilerplate
- fastlane/Matchfile: Enter your
app_identifier
e.g. com.nfq.projectname - fastlane/Fastline: Enter your app name to fields
workspace
andscheme
and edit path to firebase config script. - fastlane/Appfile: Add your
app_identifier
andpackage_name
e.g. app_identifier("com.nfq.projectname") and package_name("com.nfqprojectname")
- Fill in your project name
defaults.project=<your-project-name>
at ios/sentry.properties: and android/sentry.properties:
Managing locales:
We're currently using i18next with react-i18next. Boilerplate includes a working locale demo with language change handler.
Changing language is easy:
import { locale } from 'src/utils/locale';
const languageHandler = (lang) => {
locale.changeLanguage(lang);
}
Locale config can be found in src/utils/locale/
. Language files are located at src/assets/locale/
.
on<event-name>
, e.g.: onChange
, onSubmitClick
etc
handle<event-name>
, e.g.: handleChange
, handleSubmitClick
etc
Avoid shortened variable names:
- use
option
instead ofopt
- use
event
instead ofe
orevt
- use
nextLevelButton
instead ofnextLvlBtn
ornxtLevelButt
- exceptions:
- common shortenings that are used in everyday language, such as "config", "admin" etc
for
loop variables (i
,j
etc)
Any new icon should be placed in assets/icons
folder. And should be in svg
format. And run the script
yarn svg:icons
This script will:
- Optimize and replace all svg files
- Overwrite
assets/icons/index.ts
file and add export or update exports
yarn test
yarn lint
- Check Next.js Docs, they are very useful.
- Styled Components
- Atomic design
- Painless React Native Setup for Mac
- Fastlane setup
Branches should be named in a following manner:
// new feature
git checkout -b feature/<JiraID (if exists)>-comprehensible-name
// refactoring
git checkout -b refactoring/<JiraID (if exists)>-comprehensible-name
// bugfix
git checkout -b fix/<JiraID (if exists)>-comprehensible-name
// dependency updates
git checkout -b update/<JiraID (if exists)>-package-name
git checkout -b update/<JiraID(if exists)>-other-comprehensible-name
Make sure that for every bigger change you have checked out to new branch.
Same goes for complicated package updates (e.g. react-native
). Also make
sure to be on the new branch when changing something inside native projects
(namely ios
and android
directories).
Here we add troubleshooting tips if something needs more setup or one of the module is not working properly.
If you have encountered some problem and managed to fix it please leave a comment. Comment should be written in following manner:
- Node module name with version (for example:
[email protected]
) - Error name or text
- Platform [
ios
,android
] - Steps to reproduce (if there is some)
- Solution or link to solution
Here is some test data
[email protected]
test1234