# react-cool-starter **Repository Path**: germey/react-cool-starter ## Basic Information - **Project Name**: react-cool-starter - **Description**: 😎 🐣 A starter boilerplate for a universal web app with the best development experience and a focus on performance and best practices. - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-12-18 - **Last Updated**: 2021-12-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # REACT COOL STARTER A simple but feature rich starter boilerplate for creating your own [universal](https://medium.com/@mjackson/universal-javascript-4761051b7ae9) app. It built on the top of [React](https://facebook.github.io/react), [Redux](https://github.com/reactjs/redux), [React Router](https://reacttraining.com/react-router) and [Express](https://expressjs.com). Includes all the hot stuff and modern web development tools such as [Redux Toolkit](https://redux-toolkit.js.org), [TypeScript](https://www.typescriptlang.org), [Webpack](https://webpack.js.org/), [Babel](https://babeljs.io), [PostCSS](https://github.com/postcss/postcss-loader), [React Refresh](https://github.com/facebook/react/tree/master/packages/react-refresh), [Jest](https://facebook.github.io/jest) and [React Testing Library](https://github.com/testing-library/react-testing-library). See the [**β€œFeatures”**](#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 🀩 > πŸ‘€ Looking for a form library? Give [React Cool Form](https://react-cool-form.netlify.app) a try! [![build status](https://img.shields.io/github/workflow/status/wellyshen/react-cool-starter/CI?style=flat-square)](https://github.com/wellyshen/react-cool-starter/actions?query=workflow%3ACI) [![coverage status](https://img.shields.io/coveralls/github/wellyshen/react-cool-starter?style=flat-square)](https://coveralls.io/github/wellyshen/react-cool-starter?branch=master) [![dependencies status](https://img.shields.io/david/wellyshen/react-cool-starter?style=flat-square)](https://david-dm.org/wellyshen/react-cool-starter) [![devDependencies status](https://img.shields.io/david/dev/wellyshen/react-cool-starter?style=flat-square)](https://david-dm.org/wellyshen/react-cool-starter?type=dev) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4?style=flat-square)](https://github.com/prettier/prettier) [![MIT licensed](https://img.shields.io/github/license/wellyshen/react-cool-starter?style=flat-square)](https://raw.githubusercontent.com/wellyshen/react-cool-starter/master/LICENSE) [![All Contributors](https://img.shields.io/badge/all_contributors-22-orange?style=flat-square)](#contributors-) [![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen?style=flat-square)](CONTRIBUTING.md) [![Twitter URL](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2Fwellyshen%2Freact-cool-starter)](https://twitter.com/intent/tweet?text=With%20@react-cool-starter,%20I%20can%20build%20my%20universal%20web%20app%20easily.%20Thanks,%20@Welly%20Shen%20🀩) ## Real Case Study > πŸ’‘ If you have built a production web app based on this starter, please open a PR to add it here. - [Spinny](https://www.spinny.com) is a fully inspected highest quality second hand cars with money-back guarantee. simple and transparent buying. - [BAM Music](https://www.bammusic.com) 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](https://www.rendahmag.com) 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](https://www.dealdrop.com) 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](https://www.beckfriends.com) 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](https://medium.com/@mjackson/universal-javascript-4761051b7ae9) rendering with async data fetching. - [React](https://facebook.github.io/react) as the view library. - [Redux](https://github.com/reactjs/redux) as the state management. - [Redux Toolkit](https://redux-toolkit.js.org) for efficient Redux development. - [React Router](https://reacttraining.com/react-router) as the router. - [Connected React Router](https://github.com/supasate/connected-react-router) to bind Redux with React Router. Refer to [document](https://github.com/supasate/connected-react-router/blob/master/FAQ.md#frequently-asked-questions) to see how it works. - [Express](https://expressjs.com) server. - [TypeScript](https://www.typescriptlang.org) as the static type checker for JavaScript. - [Webpack](https://webpack.js.org) for app bundling. - [Babel](https://babeljs.io) for transpile ES6+ to ES5. - [React Refresh](https://github.com/facebook/react/tree/master/packages/react-refresh) to fast refresh components without losing their state. - [nodemon](https://nodemon.io) to monitor for any changes in your Node.js application and automatically restart the server. - [axios](https://axios-http.com) as the Promise-based HTTP client for the browser and Node.js. - [react-helmet](https://github.com/nfl/react-helmet) to manage title, meta, styles and scripts tags on both server and client. - [loadable-component](https://github.com/smooth-code/loadable-components) to lazy load a component when needed. Reduce your bundle size without stress. - [Webpack Dev Middleware](https://github.com/webpack/webpack-dev-middleware) serves the files emitted from webpack over the Express server. - [Webpack Hot Middleware](https://github.com/glenjamin/webpack-hot-middleware) allows you to add hot reloading into the Express server. - [Webpack Bundle Analyzer](https://github.com/webpack-contrib/webpack-bundle-analyzer) creates a visualize size of webpack output files with an interactive zoomable treemap. - [helmet](https://github.com/helmetjs/helmet), [hpp](https://github.com/analog-nico/hpp), and [compression](https://github.com/expressjs/compression) for [server-Side security and performance](#server-side-security-and-performance). - [morgan](https://github.com/expressjs/morgan) the HTTP request logger for server side debugging. - [ESLint](http://eslint.org) to maintain a consistent TypeScript/JavaScript code style (with Airbnb configuration). - [stylelint](http://stylelint.io) to maintain a consistent CSS/SASS code style. - [Prettier](https://prettier.io) to format code and style. - CSS and SASS support with [PostCSS](https://github.com/postcss/postcss-loader) for advanced transformations (e.g. autoprefixer, cssnext etc.). [CSS modules](https://github.com/css-Modules/css-Modules) enabled. - Image (optimized/compressed by [Imagemin Webpack](https://github.com/webpack-contrib/image-minimizer-webpack-plugin)) and Font support. - Minimize JavaScript (by [terser-webpack-plugin](https://github.com/webpack-contrib/terser-webpack-plugin)) and CSS (by [css-minimizer-webpack-plugin](https://github.com/webpack-contrib/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](https://facebook.github.io/jest) with [React Testing Library](https://github.com/testing-library/react-testing-library) as the solution for writing unit tests with code coverage support. - [Yarn](https://yarnpkg.com/lang/en) 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](https://create-react-app.dev). - For server-side rendering, use [Next.js](https://nextjs.org). ## Requirements - [node](https://nodejs.org/en) >= 12.0 - [npm](https://www.npmjs.com) >= 6.0 ## Looking for Docker Image? You can find Docker support version on this [branch](https://github.com/wellyshen/react-cool-starter/tree/docker). ## Getting Started **1. You can start by cloning the repository on your local machine by running:** ```sh git clone https://github.com/wellyshen/react-cool-starter.git cd react-cool-starter ``` **2. Install all of the dependencies:** ```sh yarn ``` **3. Start to run it:** ```sh yarn build # Building bundle yarn start # Running production server ``` Now the app should be running at [http://localhost:8080](http://localhost:8080) > Note: You can change the port that you want from the `./src/config`. ## Script Commands I use [cross-env](https://github.com/kentcdodds/cross-env) to set and use environment variables across platforms. All of the scripts are listed as following: | `yarn