ericnograles / chain-reaction

Codebase for 2016 Orlando Code Camp talk "Chain Reaction"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chain Reaction

Presented By: Eric Nograles, Orlando Code Camp 2016

Overview

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.

Installation

  1. Install Node Version Manager
  2. Install MongoDB
  • (Mac OSX Users) You may want to install Homebrew and then run brew install mongodb
  1. Clone this repo
  2. 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

Run the Common Library

  1. In a terminal from the root of this repo, type in cd ./chain-reaction.common
  2. 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

Run the API

  1. In a terminal from the root of this repo, type in cd ./chain-reaction.api
  2. Make sure mongodb is running
  3. Run node app.js

Run the Web Client

  1. In a terminal from the root of this repo, type in cd ./chain-reaction.web
  2. Run ./start.sh
  3. Wait for browsers to open. http://localhost:8080 is the web application and http://localhost:8082 are your unit tests.
  • Note: Both will live reload as you modify files

Run the iOS App

Note: Be sure to install Xcode and/or the Android SDK before running.

  1. In a terminal from the root of this repo, type in cd ./chain-reaction.mobile
  2. Run ./start.sh

Architecture

Overview

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.

Development Mode

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.

Overview

A simple Sails.js Web API that serves as the backend for the app

Overview

A React SPA, packaged with Webpack, that serves as the web front-end

Overview

A React Native project that is the baseline for the iOS and Android versions of the app

About

Codebase for 2016 Orlando Code Camp talk "Chain Reaction"

License:MIT License


Languages

Language:Shell 100.0%