ignite-axenu-boilerplate v0.0.1
Ignite Axenu
Axenu's boilerplate generator
Once you've installed React Native and the Ignite CLI, you can get started with this boilerplate.
Includes:
- React Native
- React Navigation
- MobX State Tree (Why MST?)
- react-native-firebase
- react-native-fast-image
- Fastlane
Quick Start
Prerequisite: install the React Native CLI -- choose React Native CLI, not Expo.
First, install Ignite CLI globally:
npm install -g ignite-cli
# or
yarn global add ignite-cliNote: Make sure you have CocoaPods installed because otherwise, React Native installation will fail.
Then spin up a new React Native app:
ignite new MyApp -b ignite-axenucd into your new app and run react-native run-ios or react-native run-android (note: in Android, you'll need an Android emulator running or an Android phone attached).
Explanation of folder structure
The Ignite Axenu boilerplate project's structure will look similar to this:
ignite-project
├── __test__
│ ├── __snapshots__
│ └── App-test.js
├── __mocks__
│ ├── __snapshots__
│ ├── setup.js
│ ├── @react-native-firebase
│ └── react-native-vector-icons
├── src
│ ├── components
│ ├── i18n
│ ├── navigation
│ ├── screens
│ ├── store
│ ├── theme
│ └── utils
├── fastlane
│ ├── Appfile
│ ├── Fastfile
│ └── MatchFile
├── ios
├── android
├── index.js
├── App.js
├── README.md
└── package.json./src directory
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
│── i18n
├── navigation
├── screens
├── store
├── theme
└── utilscomponents
This is where your React dumb components will live. Each component will have a directory containing the .tsx file, along with a story file, and optionally .presets, and .props files for larger components. The app will come with some commonly used components like Button.
i18n
This is where your translations will live if you are using react-native-i18n.
store
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. There's also an extensions directory with useful shared extensions that you can include in your models like .extend(withRootStore) or .extend(withEnvironment) to access the root store or environment respectively.
navigation
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.
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 truely 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.
6 years ago