Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

react-cool-starter

> 前端框架
Open source

A starter boilerplate for a universal web app with the best development experience and a focus on performance and best practices.

1.3K stars0 likes3 views
WebsiteGitHub

About

A starter boilerplate for a universal web app with the best development experience and a focus on performance and best practices.

REACT COOL STARTER

A simple but feature rich starter boilerplate for creating your own universal app. It built on the top of React, Redux, React Router and Express. Includes all the hot stuff and modern web development tools such as Redux Toolkit, TypeScript, Webpack, Babel, PostCSS, React Refresh, Jest and React Testing Library. See the “Features” section for other awesome features you can expect.

I will maintain the starter boilerplate and keep all of the technologies on trend. Welcome to join me if you want. Hope you guys love it

Real Case Study

If you have built a production web app based on this starter, please open a PR to add it here.

  • Spinny is a fully inspected highest quality second hand cars with money-back guarantee. simple and transparent buying.
  • BAM Music is a new generation of music platform for audio visual professionals, filmmakers and content producers. Upgrade your soundtrack with great music that emphasizes your story!
  • Rendah Mag is a music magazine which exists to bring exposure to an ever-growing community, focusing on the latest Halftime, Beats & Experimental news & releases. Congrats for the amazing product.
  • DealDrop is the best place to find verified coupon codes, deals, promos and offers for thousands of stores & brands you love. Never pay full price again.
  • BECK Friends is an international delivery service, which is built based on this starter boilerplate. Congrats for successful migrating to React.

Features

Really cool starter boilerplate with the most popular technologies:

  • Universal rendering with async data fetching.
  • React as the view library.
  • Redux as the state management.
  • Redux Toolkit for efficient Redux development.
  • React Router as the router.
  • Connected React Router to bind Redux with React Router. Refer to document to see how it works.
  • Express server.
  • TypeScript as the static type checker for JavaScript.
  • Webpack for app bundling.
  • Babel for transpile ES6+ to ES5.
  • React Refresh to fast refresh components without losing their state.
  • nodemon to monitor for any changes in your Node.js application and automatically restart the server.
  • axios as the Promise-based HTTP client for the browser and Node.js.
  • react-helmet to manage title, meta, styles and scripts tags on both server and client.
  • loadable-component to lazy load a component when needed. Reduce your bundle size without stress.
  • Webpack Dev Middleware serves the files emitted from webpack over the Express server.
  • Webpack Hot Middleware allows you to add hot reloading into the Express server.
  • Webpack Bundle Analyzer creates a visualize size of webpack output files with an interactive zoomable treemap.
  • helmet, hpp, and compression for server-Side security and performance.
  • morgan the HTTP request logger for server side debugging.
  • ESLint to maintain a consistent TypeScript/JavaScript code style (with Airbnb configuration).
  • stylelint to maintain a consistent CSS/SASS code style.
  • Prettier to format code and style.
  • CSS and SASS support with PostCSS for advanced transformations (e.g. autoprefixer, cssnext etc.). CSS modules enabled.
  • Image (optimized/compressed by Imagemin Webpack) and Font support.
  • Minimize JavaScript (by terser-webpack-plugin) and CSS (by css-minimizer-webpack-plugin) bundles for you.
  • Split vendor's libraries from client bundle.
  • No other view engines, just JavaScript based HTML rendering component.
  • Shared app configuration between development and production.
  • 404 error page and redirect handling.
  • Integrate Jest with React Testing Library as the solution for writing unit tests with code coverage support.
  • Yarn as the package manager.

Who's the Starter for?

They're several React frameworks today, however this is a DIY oriented start-kit. It shows you how to build a universal web app from scratch and how to test it. If you're new to React or you want a ready-to-go solution, I'd recommend the following alternatives for you:

  • For client-side rendering, use create-react-app.
  • For server-side rendering, use Next.js.

Requirements

  • node >= 12.0
  • npm >= 6.0

Looking for Docker Image?

You can find Docker support version on this branch.

Getting Started

1. You can start by cloning the repository on your local machine by running:

bash
git clone https://github.com/wellyshen/react-cool-starter.git
cd react-cool-starter

2. Install all of the dependencies:

bash
yarn

3. Start to run it:

bash
yarn build  # Building bundle
yarn start  # Running production server

Now the app should be running at http://localhost:8080

Note: You can change the port that you want from the ./src/config.

Script Commands

I use cross-env to set and use environment variables across platforms. All of the scripts are listed as following:

yarn Description
dev Runs your app on the development server at localhost:3000. HMR will be enabled.
dev:build Bundles server-side files in development mode and put it to the ./public/server.
start Runs your app on the production server only at localhost:8080.
build Bundles both server-side and client-side files.
build:server Bundles server-side files in production mode and put it to the ./public/server.
build:client Bundles client-side files in production mode and put it to the ./public/assets.
analyze:server Visualizes the bundle content of server-side.
analyze:client Visualizes the bundle content of client-side.
lint Lints all .tsx?, .jsx? and .scss files.
lint:code Lints all .tsx? and .jsx? files (With --fix to auto fix eslint errors).
lint:type Runs type checking for .tsx? files.
lint:style Lints all .scss files (With --fix to auto fix stylelint errors).
lint:format Formats all files except the file list of .prettierignore.
test Runs testing.
test:watch Runs an interactive test watcher.
test:cov Runs testing with code coverage reports.
test:update Updates jest snapshot.

App Structure

Here is the structure of the app, which serves as generally accepted guidelines and patterns for building scalable apps.

…

Server-Side Security and Performance

Concerning the security and performance of Express in production, I already setup some middleware 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.

Develop with Redux Toolkit

Redux Toolkit is the official, opinionated, batteries-included toolset for efficient Redux development. It includes several utility functions that simplify the most common Redux use cases. In a word, we can do more work with less code, start from the tutorial to learn more about it.

  • Supports Redux Devtools Extension, you can follow the installation guide to use it.
  • Built-ins most commonly used Redux middlewares for better DX, such as Redux Thunk, Immer etc.
  • Provides useful APIs for better development efficiency. We can even create entire slices of state at once without writing any action creators or action types by hand.
  • Integrates the Reselect library for optimizing the performance of your React + Redux app.

Let's see how powerful it is by a simple asynchronous data fetching example:

…

Overview

Functional Components and Hooks

React v16.8 introduced a series of Hooks, which let you use state and other React features without writing a class. In the starter boilerplate, you can see how I leverage the benefit of functional components + hook APIs to write a demo with clean code.

Adding Routes

This starter use [React Router](h

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptboilerplatecode-splittingcss-moduleses6

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架