Overview
This is a boilerplate for a React.js app using Next.js, Redux, Antd, and Less. It provides a starting point for building a React app with these technologies.
Features
- Updated with React 18x, Next.js 13x, Antd 4x, Less, ESLint, and Webpack 5
- Easy installation and setup process
- Development and production build scripts
- Auto-update of pages as you edit the code
- API routes for accessing data
- Environment variables management
- Built-in LESS support for customizing Ant Design theme
- Support for global and component-level LESS stylesheets
Installation
To install this boilerplate, follow the steps below:
- Check if your Node.js version is >= 10.13.
- Clone this repository.
- Change the package’s name, description, and repository fields in package.json.
- Change the name of your app on public/manifest.json.
- Run
yarn
to install the dependencies. - Run
yarn dev
for development. - Run
yarn build
andyarn start
for production. - Run
yarn build:staging
andyarn start:staging
for staging. - Open http://localhost:8080 with your browser to see the result.
- You can start editing the page by modifying pages/index.js.
- API routes can be accessed on http://localhost:8080/api/users. This endpoint can be edited in pages/api/users/index.js.
- The pages/api directory is mapped to /api/*. Files in this directory are treated as API routes instead of React pages.
Summary
This boilerplate provides a convenient starting point for building a React app using Next.js, Redux, Antd, and Less. It includes essential features such as environment variable management, built-in support for customizing Ant Design theme, and support for global and component-level LESS stylesheets. With a simple installation process and clear documentation, developers can quickly get started with their React project and leverage the benefits of these technologies.