Skip to content

A complex starter react boilerplate for an universal web application with express api backend and server side render.

License

Notifications You must be signed in to change notification settings

vinks/redux-ultimate-ssr

Repository files navigation

Redux Ultimate

Starter boilerplate for creating your own universal complex app with backend api. It built on the top of Node.js, Express, Knex, Objection, React, Redux, React Async Component and React Router v4. Includes all the hot stuff and modern web development tools such as Webpack 2, Babel, PostCSS, React Hot Loader 3 and Redux Devtools Extension.

Goals

  • Client-side Redux reducer hot reloading
  • Server-side Redux reducer hot reloading
  • Client-side React component hot reloading
  • Server-side React component hot reloading
  • Server-side express routes hot reloading
  • Resolve components asynchronously, with support for code splitting
  • Using mostly ES6 module syntax, except where dynamic loading is needed
  • Data fetching through a remote or local API
  • Multiple pages via Routing
  • Backend rest API

Requirements

Getting Started

1. You can start by clone the repository on your local machine by running:

git clone https://github.com/vinks/redux-ultimate-ssr.git
cd redux-ultimate-ssr

2. Install all of the dependencies:

yarn install

3. Populate development database:

yarn migrate
yarn seed

4. Populate production database:

yarn migrate:prod
yarn seed:prod

5. Start to run it:

yarn start:production    # Building bundle and running production server

6. Begin develop:

yarn start  # You need run yarn run build at first run

NPM Script Commands

All of the scripts are listed as following:

yarn <script> Description
start Run your app on the development server at localhost:3000. HMR will be enabled.
start:production Bundles the app to ./build and run it on the production server at localhost:8080.
start:prod Run your app on the production server only at localhost:8080.
build Remove the previous client and server bundled stuff and bundle them to ./build.
build:client Remove the previous client bundled stuff and bundle it to ./build/public/assets.
build:server Remove the previous server bundled stuff and bundle it to ./build.
lint Lint all .js and .scss files.
lint:js Lint all .js files.
lint:style Lint all .scss files.
test Run testing once (with code coverage reports).
clean:all Remove the client/server bundled stuff and the coverage report.
clean:client Remove the ./build/public/assets folder to clean the client bundled stuff.
clean:server Remove the server bundled stuff from the ./build folder.
clean:test Remove the ./coverage folder to clean the code coverage report.
migrate Runs migrations for development db.
rollback Rollback development db migrations
seed Seed development database
migrate:prod Runs migrations for production db.
rollback:prod Rollback production db migrations
seed:prod Seed production database