项目作者: yuzhva

项目描述 :
Super lightweight starter kit, based on: React + Redux + redux-saga
高级语言: JavaScript
项目地址: git://github.com/yuzhva/react-ethereal-boilerplate.git
创建时间: 2017-08-24T09:36:19Z
项目社区:https://github.com/yuzhva/react-ethereal-boilerplate

开源协议:MIT License

下载


React ethereal boilerplate

Super lightweight React starter kit

Table of Contents

The content of React ethereal boilerplate

  • ES6
  • webpack + webpack Dev Server
  • React
  • Redux
  • react-router-dom
  • react-router-redux
  • redux-saga
  • immutable

Plus:

  • Eslint (Airbnb JavaScript Style Guide)
  • pre-commit syntax checker

Quick start

1. Clone project

  1. # with SSH
  2. git clone git@github.com:YUzhva/react-ethereal-boilerplate.git NEW_PROJECT_NAME
  3. # with HTTPS
  4. git clone https://github.com/YUzhva/react-ethereal-boilerplate.git NEW_PROJECT_NAME

2. Go inside project folder cd NEW_PROJECT_NAME and edit project name inside package.json

  1. // change
  2. {
  3. "name": "react-ethereal-boilerplate",
  4. }
  5. // to the
  6. {
  7. "name": "NEW_PROJECT_NAME",
  8. }

Also update SPA DOM id at /src/index.template.html and /src/main.js to your own.

3. Delete .git folder

  1. # command for Mac/Linux
  2. rm -rf .git
  3. # command for Windows
  4. rmdir .git

4. Initialize new git

  1. git init
  2. git add .
  3. git commit -m "[initial commit] NEW_PROJECT_NAME"

:beer: Have fun :beer: (=

Project structure

  1. - src
  2. - components // reusable react components without redux
  3. * ComponentName
  4. tests
  5. index.js // entry point for component
  6. - containers // react components with redux and redux-saga data fetching
  7. * ContainerName
  8. tests
  9. index.js // entry point for container
  10. constants/actions/reducer/sagas/selectors.js // place container required files in root
  11. - global-reducer.js // connect other containers reducers here
  12. - global-sagas.js // connect other containers sagas here

Available Scripts

In the project directory, you can run:

yarn start / npm start

After starting the server webpack should automatically open next address:

  1. http://localhost:8080/

yarn build / npm build

Webpack will build all scripts into ./public folder.

yarn lint / npm lint

You will see all lint errors in the console.