React js boilerplate is to help you kick start your react web application, with all bundling and build configured for you.
yarn
ornpm install
yarn start:dev
to build and watch for changes, also a dev server will start onhttp://localhost:8080/
yarn json-server
to create test json apihttp://localhost:3001/
yarn lint
to run eslint onsrc
folder and display code errors if anyyarn flow
to run flow
- ES6 Features
- React Redux to maintain application state
- Redux Thunk to handle asynchronous actions
- axios to handle all api calls
['GET','POST','PUT','DELETE', ...]
- React CSS Modules to be able to build modular CSS code for each React component.
- React Router v4 for routing between application pages
- Bootstrap v4 for grid system and all new bootstrap 4 features
- Svgo to make sure all your svg icons are optimized
- Node express based development server
- json-server no need to wait for backend api to start development, use
json-server
to have test data and test api ready for use - eslint the project contains eslint with
eslint-config-airbnb
extended, to fix and flag javascript code errors. - flow static type checker for javascript
- husky to add
pre-commit
hook that will triggeryarn lint && yarn flow
to make sure no bad commits are pushed
Webpack is the only tool used in this project for bundling project dependencies and build, copy files.
- babel-loader with
['es2015', 'react', 'stage-1', 'flow']
presets for ES6 features and React JSX transpilation to ES5 understood by all browsers. - sass-loader Loads a Sass/SCSS file and compiles it to CSS
- css-loader interprets
@import
/url()
to js modules - postcss-loader to process CSS with PostCSS
- style-loader
- file-loader interprets
@import
/url()
to image files, to copy them todist
folder and return url for these images - svg-sprite-loader to add all your icons in one sprite.svg file and interpret
@import
from javascript orurl()
in css - svgo-loader to optimize svg before generating final sprite.svg
- uglifyjs-webpack-plugin for javascript minification
- copy-webpack-plugin used to copy
index.html
todist
folder - extract-text-webpack-plugin extract final bundled css files to
dist
folder - svg-sprite-loader/plugin part of
svg-sprite-loader
to generate finalsprite.svg
indist
- compression-webpack-plugin for gzip compression of scripts.js
You can use any prefered editor, in case you are using Atom the following packages can help speed up your development process: