Code Monkey home page Code Monkey logo

react-redux-boilerplate's Introduction

react-redux-boilerplate

  • It is React-Redux as infrastructure boilerplate, with this developers just focus on developing component, action creator and reducer, without spending time in router, dev/pro build enviroement, wiring up file and express as HTTP server.

Read more

Install

$ git clone https://github.com/wahengchang/react-redux-boilerplate
$ npm install

Run (Develop Mode)

It is runnign in Development mode, enable HMR

$ npm run dev
open http://localhost:3000/

Run (Production Mode)

  • Compiling react/redux script to browser use lib, with webpack default optimized config.
  • Disable unnecessary funtionality which helps to debug in development mode
$ npm run build
$ node dist/server.js 

lint

lint fix

$ npm run lint:fix

lint check

$ npm run lint

Storybook

$ npm run storybook

Test

More detail: about test of action creater, component, container and reducer

$ npm run test


Test Suites: 4 passed, 4 total
Tests:       6 passed, 6 total
Snapshots:   0 total
Time:        1.824s, estimated 2s

or watch mode

$ npm run test:watch

Server Rendering Structure

Server Rendering structure Above is the structure of how the whole app works, the app bases on Express web framework, which serves only one route, with res.sendFile function to put index.html into the browser. Inside the scoop of the structure, what we are interested is the blue box, the interaction between react component, redux, root component, store and reducer.

Shared Components

react-redux-universial-container-compont

React-Redux Structure

react-helloworld-component-5-20 index.js , as the entry file and a high level root component, which gathers all the sub-component as the subtree of the Virtual DOM, also it is the only file entangled with many independent modules. Apart from it, different file requires independent modules, which makes clean code and work independently.

Credit

react-redux-boilerplate's People

Contributors

hangeer avatar wahengchang avatar

Watchers

 avatar  avatar

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.