Code Monkey home page Code Monkey logo

react-boilerplate's Introduction

This project is archived and no longer maintained. Please refer to react-template instead.

react-boilerplate

This project is meant to be used as a boilerplate code for web projects based on React. It comes with an opinionated base folder structure and all libraries and webpack pre-configured.

Technologies and Libraries

UI and Navigation

Styling

State Management and Side-Effects

HTTP Requests

Minification, Compression and Bundling

Linting

Testing

SEO

  • react-helmet - to allow dynamically management of the document's head section.

Browser Support

Change the browserslist config inside package.json according to your needs.

Dockerr

Installation

$ cd react-boilerplate
$ npm install

Scripts

Development

Run the project locally by using webpack-dev-server, also providing live reloading.

$ npm start

Building

Create a dist directory with the production build of the app, ready for deployment. By default it runs the validate script right before building.

$ npm run build

Run the building script without validating the project.

$ npm run build:nocheck

Serve the generated assets locally using http-server package, for testing purposes. You must have it installed for it to work.

$ npm i http-server -g
$ npm run serve

Linting and Testing

Lint

Running the following command will run both eslint and stylelint.

$ npm run lint

You can also run them separately

$ npm run eslint
$ npm run stylelint

Jest

Run all tests.

$ npm test

Run watch mode.

$ npm run test:watch

Validation

Run both test and lint scripts.

$ npm run validate

Utilities

Clean

Delete node_modules and dist folder (This script won't work on Windows)

$ npm run clean

To-dos

  • Implement React Refresh
  • Browserslist is the default for webpack target, however it currently breaks page refresh on changes. This is an issue with webpack-dev-server that should be fixed in future releases (v4+)

Contributing

Feel free to contribute and open pull requests or issues.

Credits

Based on react-base, from Thiago L. Lima.

License

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.