Skip to content

Commit bd8c7c6

Browse files
committed
chore: update README
1 parent a32b05f commit bd8c7c6

File tree

1 file changed

+65
-17
lines changed

1 file changed

+65
-17
lines changed

README.md

+65-17
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,38 @@
1-
# universal-react-redux
1+
# Universal React Redux Boilerplate
22

33
A universal React/Redux boilerplate with sensible defaults. Out of the box, this
44
boilerplate comes with:
55

66
- Server-side rendering with Express
7-
- Code splitting with Webpack's dynamic `import()`s and [react-loadable](https://github.com/thejameskyle/react-loadable)
7+
- Code splitting with [dynamic imports](https://webpack.js.org/guides/code-splitting/#dynamic-imports) and [react-loadable](https://github.com/thejameskyle/react-loadable)
88
- Sane [webpack configurations](webpack/)
9-
- JS hot reloading with `react-hot-loader` and `webpack-dev-server`
10-
- CSS, SASS and `css-modules` support with hot reloading and no [flash of unstyled content](https://en.wikipedia.org/wiki/Flash_of_unstyled_content) (`css-hot-loader`)
11-
- Routing with `react-router-v4`
9+
- JS hot reloading with [react-hot-loader (@next)](https://github.com/gaearon/react-hot-loader) and [webpack-dev-server](https://github.com/webpack/webpack-dev-server)
10+
- CSS, SASS and [css-modules](https://github.com/css-modules/css-modules) support with hot reloading and no [flash of unstyled content](https://en.wikipedia.org/wiki/Flash_of_unstyled_content) ([css-hot-loader](https://github.com/shepherdwind/css-hot-loader))
11+
- Routing with [react-router-v4](https://github.com/ReactTraining/react-router)
1212
- Full production builds that do not rely on `babel-node`.
1313

14-
## Get started
14+
## Philosophy
15+
16+
The JavaScript ecosystem is brimming with open source libraries. With advances
17+
in ES6 and commitments by the big tech companies to invest in JavaScript, the
18+
last several years have arguably turned web development into what was once a
19+
huge pain in the ass, to a pretty decently enjoyable experience.
20+
21+
With so many different packages now available, we now have the freedom and the
22+
choice to craft applications to our exact specifications, reducing bloat and
23+
minimizing the number of code we need to support cross-platform apps. It really
24+
is a new world.
25+
26+
However, with so many different developers working on different libraries,
27+
things are constantly in flux, and breaking changes are often introduced. It can
28+
be hard to keep up with the latest and greatest since they're always changing.
29+
30+
To help alleviate this, we've collected some of the best practices and features
31+
from the React ecosystem and put them in one place. Although this boilerplate is
32+
fully production-capable as is, its main goal is to serve as an example of how
33+
to bring an application together using the latest tools in the ecosystem.
34+
35+
## Development Mode
1536

1637
Copy environment variables and edit them if necessary:
1738

@@ -28,45 +49,72 @@ npm start
2849

2950
Direct your browser to `http://localhost:3000`.
3051

31-
For production builds:
52+
## Production Builds
53+
54+
Add environment variables the way you normally would on your production system.
3255

3356
```
3457
npm run prod:build
3558
npm run serve
3659
```
3760

38-
Or simply
61+
Or simply:
3962

4063
```
4164
npm run prod
4265
```
4366

44-
For Heroku, simply add a `Procfile`:
67+
If using Heroku, simply add a `Procfile` in the root directory. The
68+
[postinstall](postinstall.js) script will do the rest.
4569

4670
```
4771
web: npm run serve
4872
```
4973

74+
## Environment Variables
75+
76+
In development mode, environment variables are loaded by `dotenv` off the `.env`
77+
file in your root directory. In production, you'll have to manage these
78+
yourself.
79+
80+
An example with Heroku:
81+
82+
```
83+
heroku config:set FOO=bar
84+
```
85+
5086
## CSS Modules
5187

5288
This project uses [CSS Modules](https://github.com/css-modules/css-modules).
53-
Class names should be in `camelCase`. Place the css file as a sibling to the
54-
component with the same name, for example:
89+
Class names should be in `camelCase`. Simply import the .scss file into your
90+
component, for example:
5591

5692
```
5793
├── components
5894
│   ├── Header.js
5995
│   ├── Header.scss
6096
```
6197

62-
## Environment Variables
63-
64-
In development mode, environment variables are loaded by `dotenv` off the `.env`
65-
file in your root directory. In production, you'll have to manage these
66-
yourself. In Heroku, this is simple as running:
98+
```
99+
// Header.scss
100+
.headerContainer {
101+
height: 100px;
102+
width: 100%;
103+
}
104+
```
67105

68106
```
69-
heroku config:set FOO=bar
107+
// Header.js
108+
import css from './Header.scss';
109+
110+
const Header = (props) => {
111+
return (
112+
<div className={css.headerContainer}>
113+
{...}
114+
</div>
115+
);
116+
}
117+
70118
```
71119

72120
## Redux Devtools

0 commit comments

Comments
 (0)