Skip to content

🚀 React Webapp Boilerplate demonstrates how to scaffold a web application using React, Webpack and Jest.

License

Notifications You must be signed in to change notification settings

jeantimex/react-webapp-boilerplate

Repository files navigation

React Webapp Boilerplate

dependencies Status devDependencies Status Build Status Coverage Status

rocket

Features

Quick scaffolding
Save your time in putting React, Redux, Router, Webpack, Jest and localization together, so you can focus on coding your awesome project.

Basic react eco system
The scaffolded project will include the latest React, Redux, React Router and React Intl.

Webpack 3
Enjoy the tree shaking feature in Webpack 3.

Jest
Facebook's painless JavaScript test runner, no need to configure Karma Webpack, no need to use Sinon and Babel Rewire.

Quick start

Get up and running

  1. Clone this repo using git clone https://github.com/jeantimex/react-webapp-boilerplate.git
  2. Run yarn or npm install to install the dependencies
  3. Run yarn run dev or npm run dev to see the example app at http://localhost:3000

devtools

Unit testing
Unit testing is powered by Jest, run yarn run test or npm run test and the results will be printed:

 PASS  tests/pages/todos/Todos.spec.js
 PASS  tests/pages/about/About.spec.js
 PASS  tests/reducers/TodoReducer.spec.js
 PASS  tests/actions/index.spec.js
-----------------|----------|----------|----------|----------|----------------|
File             |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
-----------------|----------|----------|----------|----------|----------------|
All files        |      100 |      100 |      100 |      100 |                |
 pages/about     |      100 |      100 |      100 |      100 |                |
  About.js       |      100 |      100 |      100 |      100 |                |
 pages/todos     |      100 |      100 |      100 |      100 |                |
  Todos.js       |      100 |      100 |      100 |      100 |                |
 reducers        |      100 |      100 |      100 |      100 |                |
  TodoReducer.js |      100 |      100 |      100 |      100 |                |
-----------------|----------|----------|----------|----------|----------------|

Localization
This demo supports two locales: en-US and zh-CN, you can add other locales for your application. By default, en-US is used, to choose a different locale for development and final build, simply specify the LOCALE node environment to your locale, for example:

  • LOCALE=zh-CN yarn run dev or LOCALE=zh-CN npm run dev: Running example app in Chinese language.
  • LOCALE=zh-CN yarn run build or LOCALE=zh-CN npm run build: Build the dist for Chinese language.
  • yarn run release or npm run release: Bundle the assets for all supported locales that are defined in app/locales folder.

License

MIT License

Copyright (c) 2017 Yong Su @jeantimex

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.