Home

Awesome

reactGo

Dependency Status Gitter npm version

한글 공식문서

Your One-Stop solution for a full-stack app with ES6/ES2015 React.js featuring universal Redux, Redux Thunk, React Router, Hot reloading, Emotion, Express 4.x, and multiple ORMs. :rocket:

Formerly known as choonkending/react-webpack-node

Cap 2020-11-16 12-51-16-569

2020-11-15 14-39-12

Features:

Motivation

The motivation is simple: best practices and a wonderful development experience. Our ultimate goal is to provide a boilerplate for building non-trivial applications that are secure, performant and free of bugs. Believing a mixture of React.js, Webpack and Node was the best way to accomplish this, we created react-webpack-node.

reactGo also works great as a learning tool for anyone interested in learning how to implement a large React application, or those who want a modern setup ASAP.

We've had extensive community additions to this boilerplate over time as practices have evolved, and are always interested in hearing new ideas or contributions.

Why Redux

We're really big fans of this implementation of flux for state management. The main principles of having:

make it very fun and easy to write predictable code! There's a ton of reasons why, but you should head to the Redux docs to dive in!

Or if you are more of a visual learner watch the free egghead video series narrated by the creator of redux:

  1. Getting Started
  2. Building Idiomatically

Data Flow

A simplistic representation of data flow from server to client is:

Express app.use() receives a request
-> Calls a pre-built webpack file for the server
-> Runs matching of routes in react-router for server(with react-router-config)
-> Makes async data fetching request
-> Renders Route component to string
-> Construct HTML file (with Meta, Link tags using helmet)
-> Browser receives html file with initial state
-> Client side React.JS kicks in and initializes with given state
-> Continues where it left off
-> Everyone is happy :)

More TBD

Instructions

Database

We currently support MongoDB, MySQL and Postgres, as well as the ability to not use any database. Learn about how to configure your app.

Development

You have to install ReactGo CLI to set up development environment.

# Install ReactGo CLI first
# Your terminal have to be located at reactGo project.
npm i -g @reactgo/cli
# After installation, move to the directory you wanna clone ReactGo
cd /somewhere/you/want/to/clone
# Run CLI and choose which stack you wanna use
reactgo

The next process is outlined here.

Building the application

# Build the application for development
npm run build

# Build the application for production
npm run build:dev

Running the application

# Run in development mode (with hot-reloading)
npm run dev

# Run in production mode
npm start

Unit Tests

Testing with:

# Run test once
npm test

# Run in watch mode
npm test:watch

We have unit tests for async (redux) actions, reducers, and stateless components with enzyme.

Deployment

Currently we support Heroku and Digital Ocean and AWS

Check out what people have done

We have a list of projects that have been created with this boilerplate. Check them out to see what can be done or to get some inspiration.

How to Contribute:

Best way to keep up to date is check the issues. I really welcome improvements for all aspects of an app.

  1. Any suggestions/improvements/bugs can be in the form of Pull Requests, or creating an issue.
  2. Coding guidelines:
  1. If you wanna change codes and make some PR, you have to follow following steps.
# Install ReactGo CLI
# Your terminal have to be located at reactGo project.
npm i -g
# Run CLI and choose which stack you wanna change
reactgo -d
# Then app and server folders will be symlinked from original ones that you chose.
# Change whatever you want, but don't touch app and server folders. Those are just symlinks.
# Commit and push after done.

Easter Eggs :egg:

This boilerplate has gone through an evolution

React.js -> Facebook Flux -> Alt -> Redux(thunk -> saga -> toolkit)
                                 -> MobX(in mobx branch)

License

MIT