|
| 1 | +# React Static Boilerplate |
| 2 | + |
| 3 | +> Static website generator built on top of React.js and Gulp/Webpack |
| 4 | +
|
| 5 | +<em>**NOTE**: It's still in early preview! Feel free to join the project :+1:</em> |
| 6 | + |
| 7 | +### Features |
| 8 | + |
| 9 | + ✓ Generates static `.html` pages from [React](http://facebook.github.io/react/) components<br> |
| 10 | + ✓ Next generation JavaScript with [Babel](https://github.com/babel/babel)<br> |
| 11 | + ✓ Next generation CSS with [postCSS](https://github.com/postcss/postcss) and [cssnext](http://cssnext.io/)<br> |
| 12 | + ✓ Development web-server with [React Hot Loader](http://gaearon.github.io/react-hot-loader/)<br> |
| 13 | + ✓ Bundling and optimization with [Gulp](http://gulpjs.com/)/[Webpack](http://webpack.github.io/)<br> |
| 14 | + ✓ [Code-splitting](https://github.com/webpack/docs/wiki/code-splitting) and async chunk loading<br> |
| 15 | + ✓ Easy deployment to [GitHub Pages](https://pages.github.com/) or [Amazon S3](http://davidwalsh.name/hosting-website-amazon-s3)<br> |
| 16 | + |
| 17 | +### Getting Started |
| 18 | + |
| 19 | +Just clone the repo, install Node.js modules and run `npm start`: |
| 20 | + |
| 21 | +``` |
| 22 | +$ git clone -o upstream https://github.com/koistya/react-static-boilerplate MyApp |
| 23 | +$ cd MyApp |
| 24 | +$ npm install |
| 25 | +$ npm start |
| 26 | +``` |
| 27 | + |
| 28 | +Then open [http://localhost:3000/](http://localhost:3000/) in your browser. |
| 29 | + |
| 30 | +### Directory Layout |
| 31 | + |
| 32 | +``` |
| 33 | +. |
| 34 | +├── /build/ # The folder for compiled output |
| 35 | +├── /components/ # React.js components |
| 36 | +├── /content/ # React.js-based web pages and other assets |
| 37 | +├── /node_modules/ # 3rd-party libraries and utilities |
| 38 | +├── /scripts/ # JavaScript code |
| 39 | +│ ├── /app.js # Startup script |
| 40 | +│ ├── /pages.js # Utility to generate html pages during a build |
| 41 | +│ └── /routes-loader.js # Webpack loader to generate the list of URLs |
| 42 | +│── gulpfile.babel.js # Build automation script(s) |
| 43 | +│── package.json # The list of 3rd party libraries and utilities |
| 44 | +└── webpack.config.js # Configuration for bundling and optimization |
| 45 | +``` |
| 46 | + |
| 47 | +### How to Test |
| 48 | + |
| 49 | +The unit tests are powered by [chai](http://chaijs.com/) and [mocha](http://mochajs.org/). |
| 50 | + |
| 51 | +``` |
| 52 | +$ npm test |
| 53 | +``` |
| 54 | + |
| 55 | +### How to Deploy |
| 56 | + |
| 57 | +```shell |
| 58 | +$ npm run build -- --release # Builds the project in release mode |
| 59 | +$ npm run deploy # Deploys the project to GitHub Pages |
| 60 | +``` |
| 61 | + |
| 62 | +### How to Update |
| 63 | + |
| 64 | +You can always fetch and merge the recent changes from this repo back into |
| 65 | +your own project: |
| 66 | + |
| 67 | +```shell |
| 68 | +$ git checkout master |
| 69 | +$ git fetch upstream |
| 70 | +$ git merge upstream/master |
| 71 | +$ npm install |
| 72 | +``` |
| 73 | +### Related Projects |
| 74 | + |
| 75 | + * [React Starter Kit](https://github.com/kriasoft/react-starter-starter) |
| 76 | + |
| 77 | +### Learn More |
| 78 | + |
| 79 | + * [Getting Started with React.js](http://facebook.github.io/react/) |
| 80 | + * [React.js Wiki on GitHub](https://github.com/facebook/react/wiki) |
| 81 | + * [React.js Questions on StackOverflow](http://stackoverflow.com/questions/tagged/reactjs) |
| 82 | + * [React.js Discussion Board](https://discuss.reactjs.org/) |
| 83 | + * [Learn ES6](https://babeljs.io/docs/learn-es6/), [ES6 Features](https://github.com/lukehoban/es6features#readme) |
| 84 | + |
| 85 | +--- |
| 86 | +Copyright (c) Konstantin Tarkus ([@koistya](https://twitter.com/koistya)) | MIT License |
0 commit comments