Ignite BoilerPlate Template - https://docs.infinite.red/ignite-cli/
Currently includes:
- React Native: Framework for building native apps using React.
- React Navigation: Routing and navigation for your React Native apps.
- Redux Toolkit: State management library for efficient and scalable state management.
- TypeScript: Typed superset of JavaScript that compiles to plain JavaScript.
- Formik and Yup: Libraries for form validation and handling.
- react-native-mmk: Storage solution for React Native.
- Jest & testing-library/react-native: Tools for testing React Native components.
- Reactotron: Debugging tool for React Native.
- react-native-maps: Integration with Google Maps.
- Atomic Design: Design pattern for all the UI components.
- And more!
Ensure you have the following installed on your machine:
- Node.js (version 14 or higher)
- npm (version 6 or higher) or Yarn
- Expo CLI (if not installed, run
npm install -g expo-cli)
-
Clone the repository:
git clone https://github.com/lawinko/ymf-dev.git cd ymf-dev -
Install dependencies:
npm install
or if you prefer Yarn:
yarn install
-
Set up environment variables such as GOOGLE_MAP_API_KEY:
- Set the development values in
.env.dev. - Set the production values in
.env.prod.
- Set the development values in
-
Prebuild ios and android folders: Since Expo Go doesn't support
react-native-mmkv, you will need to build the iOS and Android folders usingexpo-dev-client.
To prebuild the folders, run:
sh npm run prebuild:clean
or if you prefer Yarn:
sh yarn prebuild:clean
-
Run on Android (Development):
npm run android:dev
or if you prefer Yarn:
yarn android:dev
-
Run on Android (Production):
npm run android:prod
or if you prefer Yarn:
yarn android:prod
-
Run on iOS (Development):
npm run ios:dev
or if you prefer Yarn:
yarn ios:dev
-
Run on iOS (Production):
npm run ios:prod
or if you prefer Yarn:
yarn ios:prod
-
Build for Android (Development):
npm run build:android:dev
or if you prefer Yarn:
yarn build:android:dev
-
Build for Android (Production):
npm run build:android:prod
or if you prefer Yarn:
yarn build:android:prod
-
Build for iOS (Development):
npm run build:ios:dev
or if you prefer Yarn:
yarn build:ios:dev
-
Build for iOS (Production):
npm run build:ios:prod
or if you prefer Yarn:
yarn build:ios:prod
-
Run tests:
npm testor if you prefer Yarn:
yarn test -
Run tests in watch mode:
npm run test:watch
or if you prefer Yarn:
yarn test:watch
-
Lint the code:
npm run lint
or if you prefer Yarn:
yarn lint
-
Format the code:
npm run format
or if you prefer Yarn:
yarn format
-
Reverse adb ports for Android development:
npm run adb
or if you prefer Yarn:
yarn adb
-
Clean prebuild:
npm run prebuild:clean
or if you prefer Yarn:
yarn prebuild:clean
The Ignite boilerplate project's structure will look similar to this:
ignite-project
├── app
│ ├── components
│ ├── config
│ ├── i18n
│ ├── models
│ ├── navigators
│ ├── screens
│ ├── services
│ ├── theme
│ ├── utils
│ └── app.tsx
├── assets
│ ├── fonts
│ ├── icons
│ └── images
├── test
│ ├── __snapshots__
│ ├── mockFile.ts
│ └── setup.ts
├── README.md
├── android
│ ├── app
│ ├── build.gradle
│ ├── gradle
│ ├── gradle.properties
│ ├── gradlew
│ ├── gradlew.bat
│ ├── keystores
│ └── settings.gradle
├── ignite
│ └── templates
| |── app-icon
│ ├── component
│ ├── model
│ ├── navigator
│ └── screen
├── index.js
├── ios
│ ├── IgniteProject
│ ├── IgniteProject-tvOS
│ ├── IgniteProject-tvOSTests
│ ├── IgniteProject.xcodeproj
│ └── IgniteProjectTests
├── .env
└── package.json
Included in an Ignite boilerplate project is the app directory. This is a directory you would normally have to create when using vanilla React Native.
The inside of the app directory looks similar to the following:
app
├── components
├── config
├── i18n
├── models
├── navigators
├── screens
├── services
├── theme
├── utils
└── app.tsx
components This is where your reusable components live which help you build your screens.
i18n
This is where your translations will live if you are using react-native-i18n.
models
This is where your app's models will live. Each model has a directory which will contain the mobx-state-tree model file, test file, and any other supporting files like actions, types, etc.
navigators
This is where your react-navigation navigators will live.
screens
This is where your screen components will live. A screen is a React component which will take up the entire screen and be part of the navigation hierarchy. Each screen will have a directory containing the .tsx file, along with any assets or other helper files.
services Any services that interface with the outside world will live here (think REST APIs, Push Notifications, etc.).
theme Here lives the theme for your application, including spacing, colors, and typography.
utils This is a great place to put miscellaneous helpers and utilities. Things like date helpers, formatters, etc. are often found here. However, it should only be used for things that are truly shared across your application. If a helper or utility is only used by a specific component or model, consider co-locating your helper with that component or model.