Base template for WR (Web-React) frontend projects at Dome Consulting.
This template is a starting point for building a frontend using React, Redux and Material-UI. It provides the project's folder structure, main dependencies and commonly used configurations.
To start a new project, copy this template and replace the example code.
git clone https://github.com/dome-consulting/wr-frontend-boilerplate.git
cd wr-frontend-boilerplate/
npm install
npm start
open http://localhost:8000
conf
Contains the configuration per environmentdist
Directory where the resources (JS/CSS/HTML) are publishedsrc
Intended for source code and unit testsactions
Redux action creators and Redux Thunk functionscomponents
React-redux components grouped by featurei18n
Provides internationalizationreducers
Provides the root reducerroutes
Provides the Redux router and routes definitionsstore
Provides the Redux store with Redux Thunk middleware
test
Intended for integration tests and unit tests helpers
This boilerplate uses React-intl for internationalization.
The translated messages are stored as JSON in src/i18n/messages.json
.
The supported languages must be defined in src/i18n/index.js
and have the corresponding entries in the JSON file.
npm start
Starts WebpackDevServer in watch mode withlocal
configurationnpm test
Runs all tests insrc/**/*.spec.js
npm run build-local
Builds the frontend for local developmentnpm run build-dev
Builds the frontend for the development environmentnpm run build-pre
Builds the frontend for the pre-production environmentnpm run build-production
Builds the frontend for the production environment
This project template supports:
- ES6 syntax
- ES6 polyfills
- Stage 1 preset features
- JSX syntax
- SASS Preprocessor
- React
- Redux
- Redux Thunk
- Redux Form
- React Flexboxgrid
- Material UI
- Webpack 2 (build)
- Mocha, Chai and Enzyme (tests)