Skip to content

Commit

Permalink
Merge branch 'master' into startup-saga
Browse files Browse the repository at this point in the history
# Conflicts:
#	README.md
  • Loading branch information
Matthieu Napoli committed Sep 12, 2018
2 parents 1b8b5f9 + 0b77645 commit 05b73bc
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 6 deletions.
3 changes: 3 additions & 0 deletions App/Services/WeatherService.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { create } from 'apisauce'
import { Config } from 'App/Config'

const weatherApiClient = create({
/**
* Import the config from the App/Config/index.js file
*/
baseURL: Config.API_URL,
headers: {
Accept: 'application/json',
Expand Down
58 changes: 52 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,30 @@

This project is a [React Native](https://facebook.github.io/react-native/) boilerplate that can be used to kickstart a mobile application.

This boilerplate contains:
The boilerplate provides an architecture optimized for building solid applications through separation of concerns between the UI and business logic.

- an empty React Native application created with `react-native init`
## Content

The boilerplate contains:

- an "[ejected](https://github.com/react-community/create-react-native-app/blob/master/EJECTING.md)" React Native application (v0.55) created with `react-native init`
- a [clear directory layout](#directory-layout) to provide a base architecture for your application
- [Redux](https://redux.js.org/) (v3.7) to help manage state
- [Redux Persist](https://github.com/rt2zz/redux-persist) (v5.9) to persist the Redux state
- [Redux Sagas](https://redux-saga.js.org) (v5.0) to separate side-effects and logic from state and UI logic
- [reduxsauce](https://github.com/infinitered/reduxsauce) (v0.7) to facilitate using Redux
- [apisauce](https://github.com/infinitered/apisauce) (v0.15) to make [axios](https://github.com/axios/axios) even better
- [prettier](https://prettier.io/) and [eslint](https://eslint.org/) preconfigured for React Native
- a [directory layout](#directory-layout) for organizing the code of the application
- a navigation using [react-native-navigation](https://reactnavigation.org)

## Updates

The boilerplate will follow new React-Native releases as soon as libraries and tools used here are compatible.

## Directory layout

- [`App/Components`](App/Components): presentational components
- [`App/Config`](App/Config): configuration of the application
- [`App/Containers`](App/Containers): container components
- [`App/Images`](App/Images): images used by the application
- [`App/Stores`](App/Stores): redux [actions, reducers and stores](https://redux.js.org/basics)
Expand All @@ -21,15 +35,37 @@ This boilerplate contains:

For more information on each directory, click the link and read the directory's README.

## Installation
## Requirements

Node 8 or greater is required. Development for iOS requires a Mac and Xcode 9 or up, and will target iOS 9 and up.

Make sure you have installed [everything needed to run React Native](https://facebook.github.io/react-native/docs/getting-started.html), then:
You also need to install the dependencies required by React Native:

- for [Android development](https://facebook.github.io/react-native/docs/getting-started.html#installing-dependencies-3)
- for [iOS development](https://facebook.github.io/react-native/docs/getting-started.html#installing-dependencies)

## Using the boilerplate

To create a new project using the boilerplate:

- clone this repository
- remove the previous git history: `rm -rf .git/`
- install the npm dependencies by running `yarn`
- rename the React Native project to your own project name: `npm run rename -- <YourProjectName>` (the default name is `Boilerplate`)
- remove the LICENSE file and the "License" section from the README if your project is not open source

Feel free to remove the section "Using the boilerplate" from the README (you will not need it anymore in your project). You are encouraged to keep the rest of the documentation in your project so that it is self-explanatory.

You can now start the application, for example with `react-native run-android`.
You can now create a new git repository for your project (using `git init`) and create the first commit.

## Running the project

Assuming you have all the requirements installed, you can setup and run the project by running:

- `yarn install` to install the dependencies
- create your [configuration file `App/Config/index.js`](App/Config) from `index.dev.js` (in you are in dev environment) and fill the missing values
- `react-native run-android` to run the Android application (remember to start a simulator or connect an Android phone)
- `react-native run-ios` to run the iOS application (remember to start a simulator or connect an iPhone phone)

## Useful documentation

Expand All @@ -40,3 +76,13 @@ You can now start the application, for example with `react-native run-android`.
## License

This project is released under the [MIT License](LICENSE).

## About us

[TheCodingMachine](https://www.thecodingmachine.com/) is a web and mobile agency based in Paris and Lyon, France. We are [constantly looking for new developers and team leaders](https://www.thecodingmachine.com/nous-rejoindre/) and we love [working with freelancers](https://coders.thecodingmachine.com/). You'll find [an overview of all our open source projects on our website](https://thecodingmachine.io/open-source) and on [Github](https://github.com/thecodingmachine).

## See also

Here are alternative boilerplates that you may want to check out:

- [Ignite boilerplate](https://github.com/infinitered/ignite-ir-boilerplate-andross): this boilerplate is much more opinionated and packed that this one, we wanted something lighter which is why we did no go with it
8 changes: 8 additions & 0 deletions docs/beta builds.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,11 @@ Before continuing make sure you have:

- [ ] This thing
- [ ] This thing


## Troubleshooting

### Stuck at `bundle install` running `fastlane init`

If the `fastlane init` process is stuck when running `bundle install` it may mean that `bundle install` is asking for root permissions.
You can stop the process and retry again with `sudo fastlane init`, however you will need to change back ownership of the generated files to your user when it finishes (`sudo chown <your-user> <files>`).

0 comments on commit 05b73bc

Please sign in to comment.