You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+38-6Lines changed: 38 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,30 @@ This project is a [React Native](https://facebook.github.io/react-native/) boile
4
4
5
5
The boilerplate provides **an architecture optimized for building solid applications** through separation of concerns between the UI and business logic. It is extremely documented so that each piece of code that lands in your application can be understood and used.
6
6
7
+
## Architecture
8
+
9
+
The driving goal of the architecture of the boilerplate is separation of concerns. Namely:
10
+
11
+
-**Presentational components are separated from containers** (aka "screens").
12
+
13
+
Presentational components are small components that are concerned with *how things look*. Containers usually define whole application screens and are concerned with *how things work*: they include presentational components and wire everything together.
14
+
15
+
If you are interested you can [read more about it here](https://medium.com/@dan_abramov/smart-and-dumb-components-7ca2f9a7c7d0).
16
+
17
+
-**State is managed using global [Redux](https://redux.js.org/) stores**.
18
+
19
+
When applications grow, sharing state and its changes can become very hard. Questions like "How can I access this data?" or "When did this change?" are common, just like passing data around components just to be able to use it in nested components.
20
+
21
+
With Redux, state is shared using global *stores*, and changes are predictable: *actions* are applied by *reducers* to the state. While the pattern can be a bit much for small projects, the clear separation of responsibilities and predictability helps with bigger applications.
22
+
23
+
If you are interested you can [read more about it here](https://redux.js.org/introduction/motivation).
24
+
25
+
-**Application side-effects (API calls, etc.) are separated from UI and state manipulation using [Redux Saga](https://redux-saga.js.org/)**.
26
+
27
+
Using Redux Saga has two benefits: keeping application side-effects and related business logic out of UI components, as well as executing that logic in an asynchronous way without ending in callback hell.
28
+
29
+
Sagas are triggered by Redux actions and can also trigger Redux actions to alter state. By using JavaScript generators (`yield`), sagas are written in a synchronous-like manner while still executing asynchronously.
30
+
7
31
## Content
8
32
9
33
The boilerplate contains:
@@ -18,9 +42,7 @@ The boilerplate contains:
18
42
-[apisauce](https://github.com/infinitered/apisauce) (v0.15) to make [axios](https://github.com/axios/axios) even better
19
43
-[prettier](https://prettier.io/) and [eslint](https://eslint.org/) preconfigured for React Native
20
44
21
-
## Updates
22
-
23
-
The boilerplate will follow new React-Native releases as soon as libraries and tools used here are compatible.
45
+
The boilerplate includes an example (displaying the current weather temperature) from UI components to the saga. The example is easy to remove so that it doesn't get in the way.
24
46
25
47
## Directory layout
26
48
@@ -35,6 +57,10 @@ The boilerplate will follow new React-Native releases as soon as libraries and t
35
57
36
58
For more information on each directory, click the link and read the directory's README.
37
59
60
+
## Updates
61
+
62
+
The boilerplate will follow new React-Native releases as soon as libraries and tools used here are compatible.
63
+
38
64
## Requirements
39
65
40
66
Node 8 or greater is required. Development for iOS requires a Mac and Xcode 9 or up, and will target iOS 9 and up.
@@ -81,8 +107,14 @@ This project is released under the [MIT License](LICENSE).
81
107
82
108
[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).
83
109
84
-
## See also
110
+
## Alternative boilerplates
111
+
112
+
We looked into existing boilerplates before starting this project, and while many of them are awesome, we did not find what we were looking for.
113
+
114
+
The most popular is [mcnamee's Starter Kit](https://github.com/mcnamee/react-native-starter-kit), which is unfortunately [limited by *Expo*](https://facebook.github.io/react-native/docs/getting-started#caveats) and misses Redux Saga.
115
+
116
+
If we look at the rest (and ignore unmaintained projects), many popular boilerplates are too opinionated: they include 3rd party services or very strong architecture choices that we are not comfortable with. To name a few: [Snowflake](https://github.com/bartonhammond/snowflake) runs with a Hapi Server running on Redhat OpenShift, [Hasura's boilerplate](https://github.com/hasura/react-native-auth-boilerplate) uses Hasura's SaaS for authentication, [Apollo's StarterKit](https://github.com/sysgears/apollo-universal-starter-kit) is targeted at GraphQL using Apollo, the [Meteor Boilerplate](https://github.com/spencercarli/react-native-meteor-boilerplate) targets Meteor…
85
117
86
-
Here are alternative boilerplates that you may want to check out:
118
+
Finally some did not contain the architecture we are looking for (the separation of concerns with Redux, Sagas, etc.), for example [re-start](https://github.com/react-everywhere/re-start).
87
119
88
-
-[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
120
+
One interesting exception is [Ignite IR Boilerplate "Andross"](https://github.com/infinitered/ignite-ir-boilerplate-andross), but after consideration we decided not to use it because of the large amount of unnecessary code/components it provided.
0 commit comments