Presented By: Eric Nograles, Orlando Code Camp 2016
This project represents a hypothetical multi-platform application called Chain Reaction that demonstrates how React, React Native and Redux, when used together, can be an amazing architectural foundation for applications of any scale.
- Install Node Version Manager
- Install MongoDB
- (Mac OSX Users) You may want to install Homebrew and then run
brew install mongodb
- Clone this repo
- Run
./install.sh
Note: This project has not been tested in a Windows machine, but should theoretically work, assuming you have a bash port for Windows installed, such as cygwin or win-bash
- In a terminal from the root of this repo, type in
cd ./chain-reaction.common
- Run
npm run dev
Note: The common library gets transpiled to ES5 using Babel and we utilize Nodemon to watch any changes to /src
, which will then compile into /lib
automatically once you run npm run dev
- In a terminal from the root of this repo, type in
cd ./chain-reaction.api
- Make sure mongodb is running
- Run
node app.js
- In a terminal from the root of this repo, type in
cd ./chain-reaction.web
- Run
./start.sh
- Wait for browsers to open.
http://localhost:8080
is the web application andhttp://localhost:8082
are your unit tests.
- Note: Both will live reload as you modify files
Note: Be sure to install Xcode and/or the Android SDK before running.
- In a terminal from the root of this repo, type in
cd ./chain-reaction.mobile
- Run
./start.sh
The chain-reaction.common library represents all cross-platform shareable code. This includes all Redux components (store, reducers, actions) and also infrastructure items (services) that talk to external resources, such as a Web API.
This library was designed to be independent of any client framework. As such, you'll notice that we use NPM symlinks in the root install.sh
to point the Web project to the source code. This is so that you can develop on the library concurrently with the web components.
For the Mobile application, because React Native's packager doesn't quite play well with symlinks, we simply have a Nodemon instance as part of its start.sh
file which brings in an updated copy of chain-reaction.common to the mobile project.
In practice, a library like this may live in npm (public or private) which you can then npm install
normally into the web or mobile projects, as any other Node library.
A simple Sails.js Web API that serves as the backend for the app
A React SPA, packaged with Webpack, that serves as the web front-end
A React Native project that is the baseline for the iOS and Android versions of the app