Giter Site home page Giter Site logo

xunianddup / react-redux-boilerplate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xuqingkuang/react-redux-boilerplate

0.0 2.0 0.0 1.75 MB

React + Redux boilerplate written with TypeScript.

Home Page: http://kxq.io/react-redux-boilerplate/#/

License: MIT License

JavaScript 14.28% HTML 11.78% TypeScript 71.80% CSS 2.14%

react-redux-boilerplate's Introduction

React Redux Boilerplate

Build Status codecov.io Dependency Status devDependency Status

Another template that makes React and redux web app developmet easier.

Babel 6 version was stopped maintenance, please look at v1.0.0 if you need.

Demo

Click here for demo

Features

  • TypeScript 2, no Babel required any more
  • Unit testing covered with Jest
  • Different configs for different environment.
  • React 15
  • React Router 3
  • Redux 3.6 (Predictable state container)
  • Sass css pre-processor with lint
  • Yarn supported
  • Webpack 2 + webpack-dev-server 2
  • Redux Devtools for Chrome Extension supported (Better than redux-logger)
  • Browser live reload
  • Using Webpack DllReferencePlugin plugin to optimize build speed

If you are interested, please read the package.json file for all installed modules.

Feel free to contribute or fork it if you find this repo could help the community.

Installation

Requirements

  • Node 6 LTS for building

Start

  1. Clone the repo - $ git clone https://github.com/xuqingkuang/react-redux-boilerplate
  2. Install the dependencies - $ cd react-redux-boilerplate && yarn

Executions

Build the vendor libraries

$ npm run buildvendor

The command will genderate the vendors package at first time. It's using webpack.DllReferencePlugin to splite code to be vendor.js and app.js,

vendor.js contains the libraries defined in webpack-vendor.config.js, you may add more items if you need splite the dependencies building from application. app.js was the code build from src.

By using this feature, the build speed is much faster.

Start develop environment

$ npm start

Run start directly without any options will build the codes and start a development web server on http://0.0.0.0:8000, then you can open a browser to access the page with any IP address such as http://localhost:8000, the codes in src will be compiled at run time when change anything, and the browser will auto reload.

By the way, the step is running on memory, there's no any files generated.

Unit test

$ npm run test

Will call Jest to execute the unit testing.

Build the codes for production

$ npm run build

The codes will be compiled and placed to dist folder, all of them are minimized.

Clean the built folder

$ npm run clean

The all files in dist folder will be removed.

Structure

react-redux-boilerplate           - Project root
|-- __mocks__                     - Jest mocks, see package.json jest section.
|   `-- file-mock                 - Mock for static handler
|-- assets                        - Static resources
|   |-- imgs                      - Static Images
|   |-- index.html                - Entrance html
|   `-- vendor.js                 - The file contains libraries
|-- coverage                      - Testing coverage report generated
|   `-- icov-report
|       `-- index.html            - Graphic testing coverage report
|-- src                           - Source codes
|   |-- app.tsx                   - Entrance Javascript
|   |-- prepare.ts                - App preparings, init history and store.
|   |-- routes.tsx                - Routes config
|   |-- constants.ts              - Redux constants
|   |-- actions                   - Redux actions
|   |   |-- __tests__             - Unit testing folder, following are same
|   |   |   `-- titles-test.ts
|   |   |-- index.ts
|   |   `-- titles.ts
|   |-- components                - React Components
|   |   |-- home
|   |   |   |-- home.tsx
|   |   |   `-- index.tsx
|   |   |-- index.ts
|   |   |-- layout.tsx
|   |   |-- layout.scss           - Sass for layout.tsx
|   |   `-- not-found.tsx
|   |-- config                    - Runtime config
|   |   |-- index.ts              - Default config
|   |   `-- production.ts         - Production config
|   `-- reducers                  - Redux Reducers
|       |-- index.ts
|       `-- titles.ts
|-- dist                          - Built app for production
|   |-- app.js                    - Built Javascript
|   |-- app.js.map                - Source map for Built Javascript
|   |-- imgs                      - Static images
|   |-- index.html                - Entrance html
|   `-- vendor.js                 - The file contains libraries
|-- .travis.yml                   - Travis CI config
|-- LICENSE                       - Copyright notice
|-- README.md                     - This file
|-- package.json                  - Package informations
|-- webpack.config.js             - Development build configuration
|-- webpack-production.config.js  - Production build configuration
`-- webpack-vendor.config.js      - Pre build the libraries

react-redux-boilerplate's People

Contributors

xuqingkuang avatar

Watchers

xunian 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.