boilerplate for making gracefull react apps
- node
^5.0.0
- yarn
^0.23.0
or npm^3.0.0
First of all you need to download repo to your local machine:
$ git clone https://github.com/pustovitDmytro/react <my-project-name>
$ cd <my-project-name>
This will create your own project based on react-boilerplate
.
After, install the project dependencies. It is recommended that you use Yarn, but npm install
will also suffice.
$ yarn install
Now you have different variants how to launch new app:
- The simplest variant: use
webpack-dev-server
$ yarn start:dev-server
after that open localhost:5000.
In case you need specify own port you can do it in webpack/devserver.js
:
devServer: {
compress: true,
port: 5000,
hot: true,
https: false
}
- static http-server
$ yarn start
the app should run in your default browser.
Anyway, you can open it via localhost:7000.
To change default port you have to look into package.json
:
"start": "npm run build && npm run start:http-server",
"start:http-server": "http-server build -p 7000 -o",
- Assembling without launching server:
yarn build
or in development mode:
yarn assemble
with watch:
yarn start:watch
- Of course you can mix these variants
.
├── build # All build-related code
├── public # Static public assets (not imported anywhere in source code)
├── server # Express application that provides webpack middleware
│ └── main.js # Server application entry point
├── src # Application source code
│ ├── index.html # Main HTML page container for app
│ ├── main.js # Application bootstrap and rendering
│ ├── normalize.js # Browser normalization and polyfills
│ ├── components # Global Reusable Components
│ ├── containers # Global Reusable Container Components
│ ├── layouts # Components that dictate major page structure
│ │ └── PageLayout # Global application layout in which to render routes
│ ├── routes # Main route definitions and async split points
│ │ ├── index.js # Bootstrap main application routes with store
│ │ ├── Home # Fractal route
│ │ │ ├── index.js # Route definitions and async split points
│ │ │ ├── assets # Assets required to render components
│ │ │ ├── components # Presentational React Components
│ │ │ └── routes ** # Fractal sub-routes (** optional)
│ │ └── Counter # Fractal route
│ │ ├── index.js # Counter route definition
│ │ ├── container # Connect components to actions and store
│ │ ├── modules # Collections of reducers/constants/actions
│ │ └── routes ** # Fractal sub-routes (** optional)
│ ├── store # Redux-specific pieces
│ │ ├── createStore.js # Create and instrument redux store
│ │ └── reducers.js # Reducer registry and injection
│ └── styles # Application-wide styles (generally settings)
└── tests # Unit tests
There are some more boilerplates that I'm working on:
- gulp - simple template for quick site creation via gulp
- web-extension - boilerplate to making web-extensions (firefox and chrome simultaneously)
- parser - tiny universal Python-based asynchronous sites scrapper
MIT