/universal-react-redux-starter

A barebones place to start building universal apps.

Primary LanguageJavaScriptISC LicenseISC

Universal React-Redux Starter

This is an example of using React, React Router, and Redux in a universal (or isomorphic) context.

You may reference this project to learn how to build web apps that render on both a client and a server. You may also use this project as a starting point for your own universal app.

Usage

  1. Clone this repository

git clone https://github.com/knicklabs/universal-react-redux-sample

  1. Change into the project directory and install the dependencies

cd universal-react-redux-sample && npm install

  1. Run the development server

npm start

  1. Visit http://localhost:4000 to see the results

Acknowledgements

The inspiration to create this starter app came from a long and exhaustive search for an existing example/starter app that I could use as the basis for creating universal JavaScript applications. The starter apps that I found tended to fall into one of two categories: (1) incomplete or (2) convoluted. The convoluted examples were difficult to learn from and included a lot of their authors' opinions encapsulated as dependencies. In such cases, it was a matter of either: (a) forging ahead with a stack that I may not have chosen for myself, or (b) spending vast amounts of time to understand a project so that I could refactor it into something that I wanted to work with.

I set out to create a starter app that was very simple and had few dependencies. Alex Fedoseev wrote an excellent four-part series on building a universal JavaScript app with React, Redux and Ruby on Rails. I borrowed heavily from the ideas and sample code in this article, adapting it to my own personal preferences and pairing it back a bit into what I consider a good starting point for creating an application. I haven't made too many decisions for those who take this code and run with it to build something of their own. They will find ample freedom to easily take this project in the direction of their choosing.