GithubHelp home page GithubHelp logo

haochuan / reactux Goto Github PK

View Code? Open in Web Editor NEW
7.0 5.0 2.0 2.99 MB

Node CLI to generate ready-to-go template for React + Redux + Express App

JavaScript 96.00% HTML 2.50% CSS 1.50%
react redux bolierplate template express nodejs react-router react-redux eslint jest

reactux's Introduction

reactux

Ready-to-go template for React + Redux + Express App

Installation

npm install -g reactux

Usage

reactux [project name]
// this will create a folder [project name] contains the template in current directory

Template Features

  • CLI to generate start files
  • Fully support ES6
  • Dev and Production environment setting
  • Bundle with webpack 2 with js, css, postcss, and file loaders
  • Reasonable file structure for both Frontend and Backend
  • React Router v4 support
  • Built-in Redux dev tools and middlewares
  • Express server with customization and configuration including auth, logger, cor
  • Tests Setup with Jest
  • eslint built-in with customized configuration
  • Option to sync Redux store with LocalStorage
  • Deploy with pm2

Project Stucture

Frontend

  • /src/react
    • action -> action creators in redux
    • components -> reusable components
    • constants -> const
    • containers -> parent components
    • reducers -> redux reducers
    • configureStore.js -> redux store setup
    • index.html -> html template
    • index.js -> entry point
    • localStorage.js -> setup sync between redux store and localStorage

Backend

  • /src/server
    • config -> server config like environment and database
    • middleware -> custom express middleware
    • models -> model used in database
    • routes -> routes setup
    • app.js -> main server app
    • index.js -> entry point

Run Dev Server

webpack will move and compile src/react into dist/react and use babel-node to run express server

Run Production Server

webpack will move and compile src/react and src/server into build/react and build/server and use node to run express server

Development

cd [your project]
yarn install // or npm install
yarn dev // or npm run dev

Test

yarn test // or npm run test

Linting

yarn lint // or npm run lin

Production

yarn install
yarn production

Deploy with PM2

yarn install
yarn production

License

Copyright (c) 2017 Haochuan Licensed under the MIT license.

reactux's People

Contributors

haochuan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

reactux's Issues

New example in template

  1. App/page structure: Main -> Dashboard contains 3 different page in same level
  2. Auth in react layer
  3. Backend for auth support

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.