Skip to content
This repository has been archived by the owner on Jun 17, 2019. It is now read-only.

Beautiful Boilerplate: PWA, React, React Router, Hot Reload, Code splitting, JS, PostCSS

Notifications You must be signed in to change notification settings

nuremx/progressive-react-boilerplate

Repository files navigation

Progressive React Boilerplate banner

Progressive React Boilerplate

Dependency Status DevDependency Status

Boilerplate to create a greatly optimized React PWA, and using an Express server, custom configuration so it can be easily integrated with any library.


Features

  • 💛 JS Optional chaining, class properties and decorators, absolute imports
  • ⭐️ Flow
  • ⚛️ React v16
  • 🔄 React Router v4
  • 💠 Express server
  • 〽️ Babel 7 on server and web app
  • 🔥 React Hot Reload with webpack-hot-middleware
  • ⭕️ PostCSS with Sass-like syntax, auto-prefixer and modern css support
  • ✂️ Code splitting for .js and .css
  • 📱 Progressive Web App ready, service worker and manifest
  • 📦 Webpack v4
  • 👮 Basic security with helmet and hpp
  • 🐳 Docker support
  • 🌸 Easy to integrate with Apollo GraphQL
  • 💜 Easy to integrate with Redux

Usage

Targeted for node 8

You can set env variables at config, use .env.development and .env.production

Development

Runs development server with react hot reload and nodemon

> npm start

Production

Web app bundle

Saves bundle files at dist/app

> npm run build:app

Don't forget to set your app icons at src/assets

Server

Compiles server at dist/server and runs simple production node process

> npm run build
> npm run serve

With ** Docker **:

> docker build -t tag-name . # Build image, this compiles server
> # More docker stuff
> npm run serve:docker # In container, will run pm2 with clustering

Todos

  • Basic testing
  • Optional SSR rendering
  • AWS CI/CD integration
  • Example files

License

MIT. Copyright 2018 Nure.