Production-ready boilerplate for building universal web apps with React and Redux
$ git clone https://github.com/60frames/react-boilerplate.git
$ cd react-boilerplate
$ rm -r .git
$ cp ./server/_env ./server/.env
$ npm install
$ npm start
- ES2015/16 with Babel
- Universal rendering with support for data fetching and code splitting.
- Hot reloading on both client and server
- Locally scoped CSS with CSS modules
- Scalable unit testing via Jest
- Development and release builds with Webpack 2
- State management with Redux
- ...Just 4 commands
Serves the app in development mode
NOTE: This is simply an alias for
npm run serve
.
Runs unit tests
Builds the app ready for release
Serves the app in release mode
NOTE: Requires you to first build the app with
npm run build
.
Environment variables are defined via Unix env vars and are documented in the ./server/_env
file.
To avoid the hassle of having to define env vars on your local machine during development we recommend you simply rename the ./server/_env
file to ./server/.env
which, in the absence of a predefined NODE_ENV
, will be copied to your environment.
NOTE: Any of the environment variables can be made available to the client by explicitly declaring them in the root Html component. This extra step is required to prevent accidentally leaking sensitive data to the client.
MIT