Code Monkey home page Code Monkey logo

r3-boilerplate's Introduction

react-redux-router-boilerplate

This project is actually created for my personal use, not as a new annoying react boilerplate. But if you like my project and want to use it, all is up to you.

Instructions

This boilerplate is used for scaling app, include Hot Module Replacement out of the box for React and Redux store, redux store, and routing for react app, plus Material-ui react components. Use beta version of @babel/core for using new syntax <>code</> comes with react^16.2.0 instead of additional div element, and @babel-** plugin for successful building React. routes folder contain all your routes in app, containers is used for separate logic from presentation. Linting with eslint + config-react + config airbnb.

Features

  • As with release of webpack 4, this boilerplate is using it.
  • For simplicity of adding image to code, use transform-react-jsx-img-import
  • Image optimization.
  • Code Spliting.
  • Stage 3

Installation

git clone https://github.com/FreAK19/r3-boilerplate.git
yarn install        // install all dependencies

Commands

yarn start      		//  automaticly open browser on localhost:8080 port
yarn build      		//  build production version
yarn lint      			//  eslinting
yarn flow      			//  check flow error
yarn flow-typed     //  install all flow-typed pkgs
yarn format      		//  prettier format for clean code
yarn test      			//  jest, enzyme test
yarn test:coverage  //  jest test coverage

Structure folder

Basic setup

build/
config/
coverage/
flow-typed/
src/
    App.jsx
    index.js
    favicon.ico
    App.less 

Components and tests

src/
    __tests__
    components/
    containers/
    routes/
        home/
            index.jsx
            reducer.js  

Redux

src/
    action/
        actionCreator/
    reducers/
         index.js    
    store
        index.js    

Todo

  • Server Side Rendering React...
  • Deploy to gh-pages, surge adn heroku

Extended

If you want to use preact-compat, for smaller bundle size, all you need to do is install preact and preact-compat packages to dependencies, then change configuration in config/webpack.prod.config.js like this

resolve: {
    alias: {
    	  'react': 'preact-compat',
        'react-dom': 'preact-compat'
    }
}

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.