react-static-boilerplate 0,5,2,9,5,0,15,0 editorconfig travis-ci npm webpack

Boilerplate and tooling for web application development based on React (ReactJS), Redux, Babel, Webpack, CSS Modules, PostCSS, Browsersync, React Hot Loader and optimized for CDN hosting in Firebase

2 years after MIT

React Static Boilerplate  

React Static Boilerplate (RSB) is a boilerplate and tooling for creating modern stand-alone web applications (aka SPAs) for a serverless architecture. RSB significantly reduces cost by eliminating the need for servers such as EC2 instances because the entire site can be hosted directly from CDN (Firebase, GitHub Pages, Amazon S3, or other similar cloud storage). Sites built with RSB can be fully functional with REST API or GraphQL calls to micro-services such as Amazon Lambda, Azure Functions, or dynamic Docker endpoints hosted on DigitalOcean. RSB demonstrates how to use component-based UI development approach with best of breed technologies including React, Redux, Babel, Webpack, Browsersync, React Hot Loader and more. This work is being sponsored by:

Features

✓ Modern JavaScript syntax (ES2015+) via Babel, modern CSS syntax via PostCSS
✓ Component-based UI architecture via React, Webpack and CSS Modules
✓ Application state management /w time-travel debugging via Redux (see main.js, store.js)
✓ Routing and navigation via path-to-regexp and history (main.js, router.js, tools/routes-loader.js)
Code-splitting and async chunk loading via Webpack v2
✓ Hot Module Replacement (HMR) /w React Hot Loader, cross-device testing with Browsersync (see run.js)
24/7 community support on Gitter + perimum support on Skype (book a session)

View docs, online demo  |  Follow us on Gitter, Twitter or ProductHunt  |  Learn React.js and ES6

Directory Layout

├── components/                 # Shared or generic UI components
│   ├── Button/                 # Button component
│   ├── Layout/                 # Website layout component
│   ├── Link/                   # Link component to be used instead of <a>
│   └── ...                     # etc.
├── docs/                       # Documentation to the project
├── node_modules/               # 3rd-party libraries and utilities
├── src/                        # Application source code
│   ├── about/                  # About page
│   ├── error/                  # Error page
│   ├── home/                   # Home page
│   ├── history.js              # Handles client-side navigation
│   ├── main.js                 # <== Application entry point <===
│   ├── router.js               # Handles routing and data fetching
│   ├── routes.json             # This list of application routes
│   └── store.js                # Application state manager (Redux)
├── public/                     # Static files such as favicon.ico etc.
│   ├── dist/                   # The folder for compiled output
│   ├── favicon.ico             # Application icon to be displayed in bookmarks
│   ├── robots.txt              # Instructions for search engine crawlers
│   └── ...                     # etc.
├── test/                       # Unit and integration tests
├── tools/                      # Utility and helper classes
└── package.json                # The list of project dependencies and NPM scripts

Getting Started

Step 1. Make sure that you have Node.js v6 or newer and Yarn installed on your development machine.

Step 2. Clone this repository (alternatively, use Yeoman generator to bootstrap your project):

$ git clone -o react-static-boilerplate -b master --single-branch \
      https://github.com/kriasoft/react-static-boilerplate.git MyApp
$ cd MyApp
$ yarn install                  # Install project dependencies listed in package.json

Step 3. Compile and launch your app by running:

$ yarn start                    # Compiles the app and opens it in a browser with "live reload"

You can also test your app in release (production) mode by running yarn start -- --release or with HMR and React Hot Loader disabled by running yarn start -- --no-hmr. The app should become available at http://localhost:3000/.

How to Test

The unit tests are powered by chai and mocha.

$ yarn lint                     # Check JavaScript and CSS code for potential issues
$ yarn test                     # Run unit tests. Or, `yarn run test:watch`

How to Deploy

Update publish script in the tools/publish.js file with your full Firebase project name as found in your Firebase console. Note that this may have an additional identifier suffix than the shorter name you've provided. Then run:

$ yarn run publish                  # Builds and deployes the app to Firebase

The first time you publish, you will be prompted to authenticate with Google and generate an authentication token in order for the publish script to continue.

publish

If you need to build the project without publishing it, simply run:

$ yarn build                    # Compiles the app into the /public/dist folder

How to Update

You can always fetch and merge the recent changes from this repo back into your own project:

$ git checkout master
$ git fetch react-static-boilerplate
$ git merge react-static-boilerplate/master
$ yarn install

Learn React.js and ES6

:mortar_board:   React.js Training Program by Tyler McGinnis
:mortar_board:   React for Beginners and ES6 Training Course by Wes Bos
:green_book:   React: Up & Running: Building Web Applications by Stoyan Stefanov (Aug, 2016)
:green_book:   Getting Started with React by Doel Sengupta and Manu Singhal (Apr, 2016)
:green_book:   You Don't Know JS: ES6 & Beyond by Kyle Simpson (Dec, 2015)

Related Projects

  • React Starter Kit — Isomorphic web app boilerplate (Node.js, React, GraphQL, Webpack, CSS Modules)
  • Node.js API Starter Kit — Boilerplate and tooling for building data APIs with Node.js, GraphQL and Relay
  • ASP.NET Core Starter Kit — Cross-platform single-page application boilerplate (ASP.NET Core, React, Redux)
  • Babel Starter Kit — JavaScript library boilerplate (ES2015, Babel, Rollup, Mocha, Chai, Sinon, Rewire)
  • React App SDK — Create React apps with just a single dev dependency and zero configuration
  • Universal Router — Isomorphic router for web and single-page applications (SPA)
  • History — HTML5 History API wrapper library that handle navigation in single-page apps

How to Contribute

Anyone and everyone is welcome to contribute to this project. The best way to start is by checking our open issues, submit a new issues or feature request, participate in discussions, upvote or downvote the issues you like or dislike, send pull requests.

License

Copyright © 2015-present Kriasoft, LLC. This source code is licensed under the MIT license found in the LICENSE.txt file.


Made with ♥ by Konstantin Tarkus (@koistya) and contributors

Related Repositories

react-starter-kit

react-starter-kit

React Starter Kit — isomorphic web app boilerplate (Node.js, Express, GraphQL, R ...

react-rocket-boilerplate

react-rocket-boilerplate

A boilerplate written in ES6 using ReactJS (along with React Router and RefluxJS ...

react-app-boilerplate

react-app-boilerplate

React application boilerplate ...

react-static-boilerplate-ES6

react-static-boilerplate-ES6

☁️ React Static Site Boilerplate with ES6 ...

Webpack2-React-Redux-Boilerplate

Webpack2-React-Redux-Boilerplate

面向React+Redux+Webpack的单项目多应用脚手架 ...


Top Contributors

koistya b2whats frenzzy HaNdTriX alerosa cobbweb tonybennett bdefore Christilut creeperyang dax70 adityachugh laCour jdelafon liesislukas pedrinholula i8ramin TheoMer james4388 xdamman jacobhamblin vitr

Dependencies

package version
babel-polyfill ^6.23.0
classnames ^2.2.5
fastclick ^1.0.6
history ^4.6.1
react ^15.4.2
react-dom ^15.4.2
react-mdl ^1.9.0
react-redux ^5.0.3
redux ^3.6.0
whatwg-fetch ^2.0.3
dev assets-webpack-plugin ^3.5.1
autoprefixer ^6.7.7
babel-core ^6.24.0
babel-eslint ^7.1.1
babel-loader ^6.4.1
babel-plugin-transform-runtime ^6.23.0
babel-preset-latest ^6.24.0
babel-preset-react ^6.23.0
babel-preset-stage-1 ^6.22.0
babel-register ^6.24.0
babel-runtime ^6.23.0
browser-sync ^2.18.8
chai ^4.0.0-canary.1
connect-history-api-fallback ^1.3.0
css-loader ^0.27.3
ejs ^2.5.6
eslint ^3.18.0
eslint-config-airbnb ^14.1.0
eslint-plugin-import ^2.2.0
eslint-plugin-jsx-a11y ^4.0.0
eslint-plugin-react ^6.10.2
file-loader ^0.10.1
firebase-tools ^3.5.0
front-matter ^2.1.2
highlight.js ^9.10.0
json-loader ^0.5.4
markdown-it ^8.3.1
mocha ^3.2.0
path-to-regexp ^1.7.0
pixrem ^3.0.2
pleeease-filters ^3.0.1
postcss ^5.2.16
postcss-calc ^5.3.1
postcss-color-function ^3.0.0
postcss-custom-media ^5.0.1
postcss-custom-properties ^5.0.2
postcss-custom-selectors ^3.0.0
postcss-flexbugs-fixes ^2.1.0
postcss-import ^9.1.0
postcss-loader ^1.3.3
postcss-media-minmax ^2.1.2
postcss-nesting ^2.3.1
postcss-selector-matches ^2.0.5
postcss-selector-not ^2.0.0
react-hot-loader ^3.0.0-beta.2
rimraf ^2.6.1
s3 ^4.4.0
style-loader ^0.14.1
stylelint ^7.9.0
stylelint-config-standard ^16.0.0
url-loader ^0.5.8
webpack ^2.2.1
webpack-dev-middleware ^1.10.1
webpack-hot-middleware ^2.17.1

Releases

-   v1.0.0 zip tar