All Projects → kiki-le-singe → React Redux Universal Boilerplate

kiki-le-singe / React Redux Universal Boilerplate

Licence: mit
An Universal ReactJS/Redux Boilerplate

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Redux Universal Boilerplate

React Pages Boilerplate
Deliver react + react-router application to gh-pages
Stars: ✭ 134 (-18.79%)
Mutual labels:  webpack, eslint, babel, boilerplate, enzyme, hot-reload, react-router, css-modules
Express React Boilerplate
🚀🚀🚀 This is a tool that helps programmers create Express & React projects easily base on react-cool-starter.
Stars: ✭ 32 (-80.61%)
Mutual labels:  webpack, eslint, babel, boilerplate, code-splitting, react-router
React
Extremely simple boilerplate, easiest you can find, for React application including all the necessary tools: Flow | React 16 | redux | babel 6 | webpack 3 | css-modules | jest | enzyme | express + optional: sass/scss
Stars: ✭ 244 (+47.88%)
Mutual labels:  webpack, babel, boilerplate, enzyme, react-router, css-modules
Iceberg
Front-End Boilerplate built with React + Babel + Webpack + SASS
Stars: ✭ 144 (-12.73%)
Mutual labels:  webpack, eslint, babel, boilerplate, sass
react-ssr-spa
Server side rendered single page app using reactjs official libraries.
Stars: ✭ 30 (-81.82%)
Mutual labels:  mocha, react-router, eslint, karma, hot-reload
Simple React App
Simple base app using react, react-router v4, hot-reload & sass.
Stars: ✭ 263 (+59.39%)
Mutual labels:  eslint, boilerplate, enzyme, hot-reload, sass
Pwa
An opinionated progressive web app boilerplate
Stars: ✭ 353 (+113.94%)
Mutual labels:  webpack, eslint, babel, boilerplate, react-router
Universal React Redux
🧐 A sensible universal starter kit for React + Redux
Stars: ✭ 112 (-32.12%)
Mutual labels:  webpack, babel, hot-reload, react-router, css-modules
Threejs Webpack Es6 Boilerplate
A basic boilerplate for a Three.js project compiled with Webpack and transpiled via Babel to enable using ES6 syntax.
Stars: ✭ 267 (+61.82%)
Mutual labels:  webpack, eslint, babel, boilerplate, sass
Js Stack Boilerplate
Final boilerplate code of the JavaScript Stack from Scratch tutorial –
Stars: ✭ 145 (-12.12%)
Mutual labels:  webpack, eslint, babel, boilerplate, react-router
Static Site Boilerplate
A better workflow for building modern static websites.
Stars: ✭ 1,633 (+889.7%)
Mutual labels:  webpack, eslint, babel, boilerplate, sass
Budgeting
Budgeting - React + Redux + Webpack (tree shaking) Sample App
Stars: ✭ 971 (+488.48%)
Mutual labels:  webpack, eslint, babel, sass, react-router
React Starter Kit
React, Redux, Webpack, Material UI, Boostrap 4, Code Splitting, HMR
Stars: ✭ 229 (+38.79%)
Mutual labels:  webpack, eslint, babel, boilerplate, code-splitting
Project Webcube
Continuously updated JS infrastructure for modern web dev
Stars: ✭ 141 (-14.55%)
Mutual labels:  webpack, eslint, babel, boilerplate, react-router
React Ssr Setup
React Starter Project with Webpack 4, Babel 7, TypeScript, CSS Modules, Server Side Rendering, i18n and some more niceties
Stars: ✭ 678 (+310.91%)
Mutual labels:  webpack, eslint, babel, react-router, css-modules
React Boilerplate
Production-ready boilerplate for building universal web apps with React and Redux
Stars: ✭ 53 (-67.88%)
Mutual labels:  webpack, babel, boilerplate, code-splitting, css-modules
React Redux Auth0 Kit
Minimal starter boilerplate project with CRA, React, Redux, React Router and Auth0 authentication
Stars: ✭ 115 (-30.3%)
Mutual labels:  webpack, eslint, babel, boilerplate, react-router
Template Rwb
A full-featured Webpack setup with hot-reload
Stars: ✭ 165 (+0%)
Mutual labels:  webpack, boilerplate, hot-reload, react-router
React Redux Saucepan
A minimal and universal react redux starter project. With hot reloading, linting and server-side rendering
Stars: ✭ 86 (-47.88%)
Mutual labels:  eslint, babel, boilerplate, react-router
Express Webpack React Redux Typescript Boilerplate
🎉 A full-stack boilerplate that using express with webpack, react and typescirpt!
Stars: ✭ 156 (-5.45%)
Mutual labels:  webpack, eslint, babel, react-router

React Redux Universal Boilerplate

Introduction

I started this project to learn tools like React, Redux, Webpack, babeljs.io, ES6/ES2015... I did it mainly for fun. But it will be maintained and then I used it as Boilerplate for my React|Redux projects. So don't worry it works :p. It's not perfect but it works :).

Enjoy it! :)

An Universal ReactJS/Redux Boilerplate.

Requirements

Node >=7.6.0

Optional

Installation

$ git clone https://github.com/kiki-le-singe/react-redux-universal-boilerplate.git <name>
$ cd <name>
$ npm install or yarn
$ on postinstall you should choose between SASS or CSSNEXT

Run

  • npm start (dev mod)
  • npm run deploy (prod mod - Runs npm run build:client and npm run build:server scripts)
  • cd readyToDeploy, npm install or yarn then npm start (prod mod)

Some NPM Script Commands

Storybook

$ npm run storybook

Starts Storybook on `http://localhost:6006/``

Development

$ npm run setup

Allows to choose between sass or cssnext and clean up unnecessary files. This question you will be asked: You will use SASS as CSS extension language 😉 . Do you wish to use CSSNEXT 😀 ? This choice is irreversible. Obviously you can install the project again or just use your version control system to discard changes in working directory.

This script runs on postinstall script (see package.json).

$ npm run dev

Serves your app at localip:3000. HMR will be enabled in development. A proxy is used for when you request http://localip:3000/, it will fetch http://localip:3001/ and return.

$ npm start

Runs npm run dev script.

$ npm run start:server

Starts the dev server with nodemon to serve your app at localip:3000.

$ npm run start:client:server

Starts the webpack dev server to serve your webpack bundle at localip:3001 and enable HMR in development.

Production

$ npm run build:client

It does some optimizations and compiles the client app, for the production, to disk (~/readyToDeploy/static/dist).

$ npm run build:server

It does some optimizations and compiles the server app, for the production, to disk (~/readyToDeploy/server.js).

$ npm run deploy

Runs npm run build:client and npm run build:server scripts.

$ cd readyToDeploy
$ npm install or yarn
$ npm start

Starts the prod server to serve your app at localip:3000.

Test

$ npm run test

Runs unit tests with Karma. It will generate a coverage report to ~/coverage.

$ npm run test:dev

Same as npm run test except it watches for changes to re-run tests.

Linter

$ npm run lint

Lint all files in ~/src and ~/__tests__.

Deployment

Runs npm run deploy and everything is in the ~/readyToDeploy folder.

You can read the README.

DEBUG

You should just install an extension Redux DevTools Extension. Personally I use Redux DevTools for Chrome

Are there any other alternatives? Sure! You can also use Redux DevTools. And there is also a small logger middleware redux-logger to log all actions and states after they are dispatched.

Features

Styles

CSSNEXT You can use .css file extensions using the latest CSS syntax with postcss-cssnext.

SASS You can use scss.|css file extensions using the sass syntax with sass.

CSS are automatically autoprefixed. You don't need to add prefixes like -webkit. See:

See the ~/src/common/styles/global directory to implement global styles (site's theme for example) and see an example of use case css module ~/src/common/views/AboutView. There is also a ~/src/common/styles/local directory for common local styles (this could allow to use css modules' composition between components).

Are there any other solutions ? Fortunately yes!

I could try one of these following options if what I implemented doesn't work very well...

  • It's possible to use css-modules for Theming
  • Obviously you can use the traditional method (it works very well) to do your own css or sass:
.foo-namespace {
  .baz {
    ...
  }
  .bar {
    ...
  }
}
<div className="foo-namespace">
  <div className="baz">baz</div>
  <div className="bar">bar</div>
</div>

Globals

These are global variables available to you anywhere in your source code. They can be found in ~/config/index.js.

new webpack.DefinePlugin({
  __CLIENT__: projectConfig.__CLIENT__,
  __SERVER__: projectConfig.__SERVER__,
  __DEV__: projectConfig.__DEV__,
  __PROD__: projectConfig.__PROD__,
})

Webpack is made for client side code development only. So we also have to define them on the server side

/**
 * Define isomorphic constants.
 */

// src/server/index.js

global.__CLIENT__ = false
global.__SERVER__ = true
global.__DEV__ = projectConfig.__DEV__
global.__PROD__ = projectConfig.__PROD__

Unit Tests

Tests are in ~/__tests__. Mocha will be used for structuring tests, karma as the test runner, Chai for assertions, Sinon.JS for spies... And Enzyme to simplify testing react components.

Tips

  • For the backend, if you want to ignore some modules, you can use the IgnorePlugin
new webpack.IgnorePlugin(/\.(css|less|scss|jpg|png|...)$/)

Message received from Webpack via terminal: WARNING in asset size limit: The following asset(s) exceed the recommended size limit (250 kB)

Sources

Learn more

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].