Skip to content

🀘 This repository consists of a modern technical stack for a frontend tier. A combination of the technologies presented here addresses your need in a reliable scalable isomorphic application based on Javascript. Server-side part is hosted on Express, SPA part is bundled with Webpack

License

Notifications You must be signed in to change notification settings

not-bad-react/not-bad-react-starter

Β 
Β 

Repository files navigation

Not Bad React Starter

This repository consists of a modern technical stack for a frontend tier. A combination of the technologies presented here addresses your need in a reliable scalable isomorphic application based on Javascript. Server-side part is hosted on Express, SPA part is bundled with Webpack.

This project is a fork of WellyShen's React Cool Starter. Main ideas behind the separation are: simplification, migration for another solutions, and preparation for real-life CI/CD.

Not Bad Technical React Stack

Requirements

  • node >= 5.0, < 8.0
  • npm >= 3.0, < 5.0

Getting Started

1. Clone the repository

2. Install all the dependencies

yarn install

or

npm i

3. Start the app in production mode

npm run start

It will trigger building the bundle and running a server.

Development

Server with hot reloading:

npm run build && npm run start:dev

Development in offline mode:

USE_MOCKS=true npm run start:dev

If you prefer working with mocks only, set it in config/default.js.

Run tests check:

npm test

Please see package.json for other npm sripts useful in development.

App Structure

.
β”œβ”€β”€ build                             # Webpack bundled files will be placed into it
β”‚   └── public                        # The Express server static path
β”‚       └── favicon.ico               # Favicon is placed in the same path with the main HTML page
β”œβ”€β”€ src                               # App source code
β”‚   β”œβ”€β”€ config                        # App configuration settings, used with `config` npm package
β”‚   β”œβ”€β”€ components                    # Reusable components (including scss/testing files)
β”‚   β”œβ”€β”€ containers                    # Container components (including assets/action/reducer/scss/testing files)
β”‚   β”œβ”€β”€ utils                         # App-wide utils
β”‚   β”œβ”€β”€ redux                         # Redux related setups
β”‚   β”‚   β”œβ”€β”€ reducers.js               # The root reducer (registry and injection)
β”‚   β”‚   └── store.js                  # Configure and instrument Redux store
β”‚   β”œβ”€β”€ theme                         # App-wide style and vendor CSS framework
β”‚   β”œβ”€β”€ types                         # Flow types for actions, reducers and more
β”‚   β”œβ”€β”€ client.js                     # App bootstrap and rendering (webpack entry)
β”‚   β”œβ”€β”€ routes.js                     # Routes configuration for both client and server side
β”‚   └── server.js                     # Express server (with webpack dev/hot middlewares)
β”œβ”€β”€ tools                             # Project related configurations (testing/build etc.)
β”‚   β”œβ”€β”€ flow                          # Flow types, interface, module aliasing definitions
β”‚   β”œβ”€β”€ openBrowser                   # Utility for opening Google Chrome
β”‚   β”œβ”€β”€ jest                          # Jest CSS modules and assets mocks settings
β”‚   β”œβ”€β”€ webpack                       # Webpack configuration settings
β”‚   β”‚   β”œβ”€β”€ config.js                 # Configuration for CSS modules, vendor registering
β”‚   β”‚   β”œβ”€β”€ webpack.client.babel.js   # Webpack configuration for client
β”‚   β”‚   β”œβ”€β”€ webpack.server.babel.js   # Webpack configuration for server
β”‚   β”‚   └── WIT.config.js             # Webpack Isomorphic Tools configuration file
└── index.js                          # App entry point

Server Side Security and Performance

Concerning to the security and performance for Express in production, WellyShen already setup some middlewares for you:

  • helmet - Helps secure Express server with various HTTP headers.
  • hpp - Express middleware to protect against HTTP Parameter Pollution attacks.
  • compression - Gzip compression support for speeding up Express server responses.

Note: It's just a basic protected mechanism for your app, you can see the security best practices for more advanced configuration.

About

🀘 This repository consists of a modern technical stack for a frontend tier. A combination of the technologies presented here addresses your need in a reliable scalable isomorphic application based on Javascript. Server-side part is hosted on Express, SPA part is bundled with Webpack

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 97.7%
  • CSS 2.3%