Giter VIP home page Giter VIP logo

rn-boilerplate's Introduction

rn-boilerplate

  1. Follow guide on how to setup Android/IOS https://facebook.github.io/react-native/docs/getting-started.html
  2. $ npm install
  3. Create release keystore - https://facebook.github.io/react-native/docs/signed-apk-android.html (Name it rn-boilerplate-release-key.keystore)
  4. Put the release key in android/app folder
  5. Setup these gradle properties in ~/.gradle/gradle.properties: (values based on the keystore you created on step 3) RN_BOILERPLATE_ONESIGNAL_APP_ID=xxxx RN_BOILERPLATE_RELEASE_STORE_FILE=rn-boilerplate-release-key.keystore RN_BOILERPLATE_RELEASE_KEY_ALIAS=rn-boilerplate-key-alias RN_BOILERPLATE_RELEASE_STORE_PASSWORD=password RN_BOILERPLATE_RELEASE_KEY_PASSWORD=password
  6. $ react-native run-android

Whats this boilerplate includes

  1. Login page
  2. Authentication flow
  3. Using AsyncStorage to store session
  4. Drawer (side menu)
  5. Routing
  6. API mock
  7. Splash screen

Using new react native container

  1. Create new react native project
$ react-native init <project-name>
$ cd <project-name>
  1. Copy the whole src folders
$ cp -R <rn-boilerplate-dir>/src .
  1. Copy index.android.js and index.ios.js
$ cp <rn-boilerplate-dir>/index.android.js .
$ cp <rn-boilerplate-dir>/index.ios.js .

Note: Edit both file and rename the project name 4. Add required dependencies

$ npm install --save react-native-drawer
$ npm install --save react-native-router-flux
$ npm install --save react-native-snackbar
$ npm install --save redux
$ npm install --save react-redux
$ npm install --save redux-logger
$ npm install --save redux-thunk
$ npm install --save react-native-vector-icons
$ npm install --save react-native-onesignal
$ npm install --save react-native-animatable
  1. Link
$ react-native link

NOTE: you need to manually configure onesignal (check https://github.com/geektimecoil/react-native-onesignal) 6. Create release keystore and add the configuration on android/app/build.gradle 7. Run

$ react-native run-android

Architecture convention

  1. module's actions/states/components are shareable
  • scene MAY use module's actions/states/components
  • module MAY use other module's actions/states/components
  1. scene's actions/states/components are not shareable
  • scene should NEVER use other scene's actions/states/components
  • module should NEVER use scene's actions/states/components
  1. container is where to connect actions/states
  2. component's job should only be for rendering
  3. try not to use internal state at all

TODO

  1. Top level loading spinner modal
  2. Migrate to react navigation

rn-boilerplate's People

Contributors

aluksidadi avatar

Stargazers

Alexey Novak avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.