Overview
The React - NextJS boilerplate is a comprehensive starting point for building React applications using NextJS. It comes pre-configured with various useful tools and technologies including RTL, Styled Components, Storybook, TypeScript, Husky, Babel, ESLint, and Next PWA. With this boilerplate, developers can quickly set up a development environment and start building their React applications with a solid foundation.
Features
- RTL: The boilerplate includes RTL (Right-to-Left) support, making it suitable for internationalization and localization.
- Styled Components: Styled Components is integrated into the boilerplate, allowing developers to write CSS-in-JS for styling their components.
- Storybook: Storybook is included in the boilerplate, providing a convenient way to develop and showcase isolated components.
- TypeScript: The boilerplate is written in TypeScript, enabling static type checking and better editor tooling.
- Husky: Husky is set up in the boilerplate for easy Git hooks configuration, ensuring code quality and preventing common mistakes.
- Babel: Babel is used to transpile modern JavaScript syntax into browser-compatible code, ensuring compatibility across different browsers.
- ESLint: ESLint is configured in the boilerplate to enforce code quality and consistency rules.
- Next PWA: The boilerplate is equipped with Next PWA, allowing developers to easily create Progressive Web Apps.
Installation
To install all the dependencies, you can use either NPM or Yarn as the package manager.
npm install
or
yarn install
To run the project locally in development mode, you can use the following command:
yarn dev
or
npm run dev
To run the project in production mode, you should first build the project using the command:
yarn build
or
npm run build
After the build is complete, you can start the project with the following command:
yarn start
or
npm run start
To run all the tests, you can use the following command:
yarn test
To run the tests in development mode, watching for changes, you can use the command:
yarn test:watch
To open the Storybook page at port 6006, you can use the following command:
yarn storybook
To create static files for serving Storybook, you can use the command:
yarn build-storybook
Summary
The React - NextJS boilerplate is a feature-rich starting point for developing React applications with NextJS. It provides convenient integrations for tools like RTL, Styled Components, Storybook, TypeScript, Husky, Babel, ESLint, and Next PWA. The boilerplate includes easy-to-follow installation instructions for setting up the development environment, running the project, running tests, and working with Storybook. Developers can quickly get started with their React projects using this comprehensive boilerplate.