├── .editorconfig
├── .gitattributes
├── .gitignore
├── .travis.yml
├── CONTRIBUTING.md
├── LICENSE.txt
├── README.md
├── components
├── Button
│ ├── Button.js
│ ├── README.md
│ └── package.json
├── Footer
│ ├── Footer.js
│ └── package.json
├── Layout
│ ├── Header.css
│ ├── Header.js
│ ├── Layout.css
│ ├── Layout.js
│ ├── Navigation.js
│ └── package.json
└── Link
│ ├── Link.js
│ └── package.json
├── core
├── history.js
├── router.js
└── store.js
├── database.rules.json
├── docs
├── README.md
├── recipes
│ ├── deploy-to-amazon-s3.md
│ ├── deploy-to-github-pages.md
│ ├── how-to-integrate-material-design-lite.md
│ └── how-to-use-sass.md
└── routing-and-navigation.md
├── firebase.json
├── main.js
├── package.json
├── pages
├── about
│ ├── index.js
│ ├── index.md
│ └── styles.css
├── error
│ ├── index.js
│ └── styles.css
└── home
│ ├── index.js
│ ├── index.md
│ └── styles.css
├── public
├── apple-touch-icon.png
├── browserconfig.xml
├── crossdomain.xml
├── favicon.ico
├── humans.txt
├── index.ejs
├── robots.txt
├── sitemap.ejs
├── tile-wide.png
└── tile.png
├── routes.json
├── run.js
├── test
├── .eslintrc
└── spec.js
├── utils
├── markdown-loader.js
└── routes-loader.js
└── webpack.config.js
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig helps developers define and maintain consistent
2 | # coding styles between different editors and IDEs
3 | # http://editorconfig.org
4 |
5 | root = true
6 |
7 | [*]
8 |
9 | # Change these settings to your own preference
10 | indent_style = space
11 | indent_size = 2
12 |
13 | # We recommend you to keep these unchanged
14 | end_of_line = lf
15 | charset = utf-8
16 | trim_trailing_whitespace = true
17 | insert_final_newline = true
18 |
19 | [*.md]
20 | trim_trailing_whitespace = false
21 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Automatically normalize line endings for all text-based files
2 | # http://git-scm.com/docs/gitattributes#_end_of_line_conversion
3 | * text=auto
4 |
5 | # For the following file types, normalize line endings to LF on
6 | # checkin and prevent conversion to CRLF when they are checked out
7 | # (this is required in order to prevent newline related issues like,
8 | # for example, after the build script is run)
9 | .* text eol=lf
10 | *.css text eol=lf
11 | *.html text eol=lf
12 | *.js text eol=lf
13 | *.json text eol=lf
14 | *.md text eol=lf
15 | *.txt text eol=lf
16 |
17 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Include your project-specific ignores in this file
2 | # Read about how to use .gitignore: https://help.github.com/articles/ignoring-files
3 |
4 | # Compiled output
5 | public/dist
6 | public/index.html
7 | public/sitemap.xml
8 |
9 | # Node.js and NPM
10 | node_modules
11 | npm-debug.log
12 |
13 | # Firebase
14 | firebase-debug.log
15 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - '6'
4 | env:
5 | - CXX=g++-4.8
6 | addons:
7 | apt:
8 | sources:
9 | - ubuntu-toolchain-r-test
10 | packages:
11 | - g++-4.8
12 | script:
13 | - npm run lint
14 | - npm run test
15 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to React Static Boilerplate
2 |
3 | ♥ **React Static Boilerplate** and want to get involved? Thanks! There are plenty of ways you can
4 | help!
5 |
6 | Please take a moment to review this document in order to make the contribution process easy and
7 | effective for everyone involved.
8 |
9 | Following these guidelines helps to communicate that you respect the time of the developers managing
10 | and developing this open source project. In return, they should reciprocate that respect in
11 | addressing your issue or assessing patches and features.
12 |
13 |
14 | ## Using the issue tracker
15 |
16 | The [issue tracker](https://github.com/kriasoft/react-static-boilerplate/issues) is the preferred
17 | channel for [bug reports](#bugs), [features requests](#features) and [submitting pull
18 | requests](#pull-requests), but please respect the following restrictions:
19 |
20 | * Please **do not** use the issue tracker for personal support requests (use [Stack
21 | Overflow](https://stackoverflow.com/questions/tagged/react-starter-kit)).
22 |
23 | * Please **do not** derail or troll issues. Keep the discussion on topic and respect the opinions
24 | of others.
25 |
26 | * Please **do not** open issues or pull requests regarding the code in
27 | [`React`](https://github.com/facebook/react),
28 | [`Redux`](https://github.com/reactjs/redux),
29 | [`Babel`](https://github.com/babel/babel) or
30 | [`Webpack`](https://github.com/webpack/webpack) (open them in their respective repositories).
31 |
32 |
33 |
34 | ## Bug reports
35 |
36 | A bug is a _demonstrable problem_ that is caused by the code in the repository. Good bug reports are
37 | extremely helpful - thank you!
38 |
39 | Guidelines for bug reports:
40 |
41 | 1. **Use the GitHub issue search** — check if the issue has already been reported.
42 |
43 | 2. **Check if the issue has been fixed** — try to reproduce it using the latest `master` or
44 | development branch in the repository.
45 |
46 | 3. **Isolate the problem** — ideally create a [reduced test
47 | case](https://css-tricks.com/reduced-test-cases/) and a live example.
48 |
49 | A good bug report shouldn't leave others needing to chase you up for more information. Please try to
50 | be as detailed as possible in your report. What is your environment? What steps will reproduce the
51 | issue? What browser(s) and OS experience the problem? What would you expect to be the outcome? All
52 | these details will help people to fix any potential bugs.
53 |
54 | Example:
55 |
56 | > Short and descriptive example bug report title
57 | >
58 | > A summary of the issue and the browser/OS environment in which it occurs. If suitable, include the
59 | > steps required to reproduce the bug.
60 | >
61 | > 1. This is the first step
62 | > 2. This is the second step
63 | > 3. Further steps, etc.
64 | >
65 | > `` - a link to the reduced test case
66 | >
67 | > Any other information you want to share that is relevant to the issue being reported. This might
68 | > include the lines of code that you have identified as causing the bug, and potential solutions
69 | > (and your opinions on their merits).
70 |
71 |
72 |
73 | ## Feature requests
74 |
75 | Feature requests are welcome. But take a moment to find out whether your idea fits with the scope
76 | and aims of the project. It's up to *you* to make a strong case to convince the project's developers
77 | of the merits of this feature. Please provide as much detail and context as possible.
78 |
79 |
80 |
81 | ## Pull requests
82 |
83 | Good pull requests - patches, improvements, new features - are a fantastic help. They should remain
84 | focused in scope and avoid containing unrelated commits.
85 |
86 | **Please ask first** before embarking on any significant pull request (e.g. implementing features,
87 | refactoring code, porting to a different language), otherwise you risk spending a lot of time
88 | working on something that the project's developers might not want to merge into the project.
89 |
90 | Please adhere to the coding conventions used throughout a project (indentation, accurate comments,
91 | etc.) and any other requirements (such as test coverage).
92 |
93 | Adhering to the following process is the best way to get your work included in the project:
94 |
95 | 1. [Fork](https://help.github.com/articles/fork-a-repo/) the project, clone your fork, and configure
96 | the remotes:
97 |
98 | ```bash
99 | # Clone your fork of the repo into the current directory
100 | git clone https://github.com//react-static-boilerplate.git
101 | # Navigate to the newly cloned directory
102 | cd react-static-boilerplate
103 | # Assign the original repo to a remote called "upstream"
104 | git remote add upstream https://github.com/kriasoft/react-static-boilerplate.git
105 | ```
106 |
107 | 2. If you cloned a while ago, get the latest changes from upstream:
108 |
109 | ```bash
110 | git checkout master
111 | git pull upstream master
112 | ```
113 |
114 | 3. Create a new topic branch (off the main project development branch) to contain your feature,
115 | change, or fix:
116 |
117 | ```bash
118 | git checkout -b
119 | ```
120 |
121 | 4. Commit your changes in logical chunks. Please adhere to these [git commit message
122 | guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) or your code is
123 | unlikely be merged into the main project. Use Git's [interactive
124 | rebase](https://help.github.com/articles/about-git-rebase/) feature to tidy up your commits
125 | before making them public.
126 |
127 | 5. Locally merge (or rebase) the upstream development branch into your topic branch:
128 |
129 | ```bash
130 | git pull [--rebase] upstream master
131 | ```
132 |
133 | 6. Push your topic branch up to your fork:
134 |
135 | ```bash
136 | git push origin
137 | ```
138 |
139 | 7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) with a clear title
140 | and description.
141 |
142 | **IMPORTANT**: By submitting a patch, you agree to allow the project owners to license your work
143 | under the terms of the [MIT License](LICENSE.txt).
144 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | The MIT License
2 |
3 | Copyright (c) 2015-present Kriasoft, LLC. All rights reserved.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # React Static Boilerplate [](https://travis-ci.org/kriasoft/react-static-boilerplate) [](https://waffle.io/kriasoft/react-static-boilerplate) [](https://gitter.im/kriasoft/react-static-boilerplate)
2 |
3 | > [**React Static Boilerplate**](https://github.com/kriasoft/react-static-boilerplate) (RSB) is an
4 | > opinionated boilerplate and tooling for creating modern stand-alone web applications (aka
5 | > [SPA](https://en.wikipedia.org/wiki/Single-page_application)s) for a serverless architecture. RSB
6 | > significantly reduces cost by eliminating the need for servers such as EC2 instances because the
7 | > entire site can be hosted directly from CDN ([Firebase](https://www.firebase.com/), [GitHub
8 | > Pages](https://pages.github.com/), [Amazon S3](http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html),
9 | > or other similar cloud storage). Sites built with RSB can be fully functional with REST API or
10 | > GraphQL calls to micro-services such as [Amazon Lambda](https://aws.amazon.com/lambda/),
11 | > [Azure Functions](https://azure.microsoft.com/services/functions/), or dynamic Docker endpoints
12 | > hosted on [DigitalOcean](https://www.digitalocean.com/?refcode=eef302dbae9f&utm_source=github&utm_medium=oss_sponsorships&utm_campaign=opencollective).
13 | > RSB demonstrates how to use component-based UI development approach with best of breed
14 | > technologies including [React](http://facebook.github.io/react/), [Redux](http://redux.js.org/),
15 | > [Babel](http://babeljs.io/), [Webpack](https://webpack.github.io/), [Browsersync](https://browsersync.io/),
16 | > [React Hot Loader](http://gaearon.github.io/react-hot-loader/) and more.
17 |
18 | **The work is being sponsored by:**
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | ### Features
38 |
39 | ✓ Modern JavaScript syntax ([ES2015](http://babeljs.io/docs/learn-es2015/)+) via [Babel](http://babeljs.io/), modern CSS syntax via [PostCSS](https://github.com/postcss/postcss)
40 | ✓ Component-based UI architecture via [React](http://facebook.github.io/react/), [Webpack](https://webpack.github.io/) and [CSS Modules](https://github.com/css-modules/css-modules)
41 | ✓ Application state management /w time-travel debugging via [Redux](http://redux.js.org/) (see [`main.js`](main.js), [`core/store.js`](core/store.js))
42 | ✓ Routing and navigation via [`path-to-regexp`](https://github.com/pillarjs/path-to-regexp) and [`history`](https://github.com/mjackson/history) (see [`main.js`](main.js), [`core/router.js`](core/router.js), [`utils/routes-loader.js`](utils/routes-loader.js))
43 | ✓ [Code-splitting](https://github.com/webpack/docs/wiki/code-splitting) and async chunk loading via [Webpack](https://webpack.github.io/) and [ES6 System.import()](http://www.2ality.com/2014/09/es6-modules-final.html)
44 | ✓ Hot Module Replacement ([HMR](https://webpack.github.io/docs/hot-module-replacement.html)) /w [React Hot Loader](http://gaearon.github.io/react-hot-loader/)
45 | ✓ Cross-device testing with [Browsersync](https://browsersync.io/) (see [`run.js#start`](run.js))
46 | ✓ **24/7** community support on [Gitter](https://gitter.im/kriasoft/react-static-boilerplate); customization requests on [Codementor](https://www.codementor.io/koistya)
47 |
48 | **Demo**: https://rsb.kriasoft.com | **View** [docs](./docs) | **Follow us** on
49 | [Gitter](https://gitter.im/kriasoft/react-static-boilerplate), [Twitter](https://twitter.com/ReactStatic),
50 | or [ProductHunt](https://www.producthunt.com/tech/react-static-boilerplate) |
51 | **Learn** to [React.js and ES6](#learn-reactjs-and-es6)
52 |
53 |
54 | ### Directory Layout
55 |
56 | ```shell
57 | .
58 | ├── /components/ # Shared or generic UI components
59 | │ ├── /Button/ # Button component
60 | │ ├── /Layout/ # Website layout component
61 | │ ├── /Link / # Link component to be used insted of
62 | │ └── /... # etc.
63 | ├── /core/ # Core framework
64 | │ ├── /history.js # Handles client-side navigation
65 | │ ├── /router.js # Handles routing and data fetching
66 | │ └── /store.js # Application state manager (Redux)
67 | ├── /node_modules/ # 3rd-party libraries and utilities
68 | ├── /pages/ # React components for web pages
69 | │ ├── /about/ # About page
70 | │ ├── /error/ # Error page
71 | │ ├── /home/ # Home page
72 | │ └── /... # etc.
73 | ├── /public/ # Static files such as favicon.ico etc.
74 | │ ├── /dist/ # The folder for compiled output
75 | │ ├── favicon.ico # Application icon to be displayed in bookmarks
76 | │ ├── robots.txt # Instructions for search engine crawlers
77 | │ └── /... # etc.
78 | ├── /test/ # Unit and integration tests
79 | ├── /utils/ # Utility and helper classes
80 | │── main.js # React application entry point
81 | │── package.json # The list of project dependencies and NPM scripts
82 | │── routes.json # This list of application routes
83 | │── run.js # Build automation script, e.g. `node run build`
84 | └── webpack.config.js # Bundling and optimization settings for Webpack
85 | ```
86 |
87 |
88 | ### Getting Started
89 |
90 | **Step 1**. Make sure that you have [Node.js](https://nodejs.org/) v6 or newer installed on your
91 | machine.
92 |
93 | **Step 2**. Clone this repository or use [Yeoman
94 | generator](https://github.com/kriasoft/react-static-boilerplate/tree/generator-react-static) to
95 | bootstrap your project:
96 |
97 | ```shell
98 | $ git clone -o react-static-boilerplate -b master --single-branch \
99 | https://github.com/kriasoft/react-static-boilerplate.git MyApp
100 | $ cd MyApp
101 | $ npm install # Install project dependencies listed in package.json
102 | ```
103 |
104 |