React boilerplate

Build status

Starting the dev server

Make sure you have Node.js installed.

  1. Run npm install
  2. Start the dev server using npm start
  3. Open http://localhost:8080

Available Commands

  • npm start - start the dev server
  • npm clean - delete the dist folder
  • npm run production - create a production ready build in dist folder
  • npm run lint - execute an eslint check
  • npm test - run all tests
  • npm run test:watch - run all tests in watch mode
  • npm run coverage - generate code coverage report in the coverage folder

Vendor Exporting

You can export specific vendors in separate files and load them. All vendors should be included in app/vendors and will be exported in a vendors folder under dist. The main idea is to serve independent JavaScript and CSS libraries, though currently all file formats are supported.

! Don't forget to add the vendors in app/index.html and build/index.html.

Code Coverage

The project is using the Jest Code Coverage tool. The reports are generated by running npm run coverage. All configurations are located in package.json, inside the jest object.

The coverage report consists of an HTML reporter, which can be viewed in the browser and some helper coverage files like the coverage json and xml file.

Production code

Run npm run production. The production-ready code will be located under dist folder.

Environments & Deployment examples

There are UAT, PreProd, and Production environments. Details of these environments and the entire system can be found in the Environment Details page of the wiki.

Configuration settings for the environments is managed in the Git Repo redbook-config-files/offer-management-tool. Deployment of these configuration values to the environments is done via the GoCD pipeline redbookci/offer-management-tool-config.

Deployment of the application itself is done via the GoCD pipeline redbookci/offer-management-tool-deployment. By default the pipeline deploys the last successful build on the "master" code branch.

Tools that shine

  • ramda pure functional library (highly recommended)
  • date-fns date and time related functions