This Next.js Boilerplate is a starter project that is set up with various technologies to enhance the development experience. It includes features such as Typescript, Chakra UI, Eslint, Prettier, Pre-commit (Husky + lint-staged), and Cypress. The boilerplate provides advantages offered by Next.js, supports styling with Chakra UI, and has a dark/light theme setup. It also includes type support through Typescript, code check and formatting through ESLint and Prettier, pre-commit checks through Husky and Lint-staged, and E2E and component testing with Cypress. With a minimal folder structure and SEO-friendly setup, this boilerplate offers productivity to your projects.
Install the create-next-js-boilerplate package:
$ yarn create next-js-boilerplate
or
$ npx create-next-js-boilerplate
Put Husky to work by running the following command:
$ yarn husky-install
or
$ npm run husky-install
Run the development server:
$ yarn dev
or
$ npm run dev
Clone the repository:
$ git clone https://github.com/AstrOOnauta/next-js-boilerplate.git
Install the project dependencies:
$ yarn
or
$ npm install
Put Husky to work by running the following command:
$ yarn husky-install
or
$ npm run husky-install
Run the development server:
$ yarn dev
or
$ npm run dev
Here are some useful terminal commands provided by the Next.js boilerplate:
dev: runs your application on localhost:3000build: creates the production build versionstart: starts a simple server with the build production codeprettier: runs the prettier commands in all components and pageslint: runs the lintering commands in all components and pageslint-staged: runs the linting & prettier commands to those files which are changed, not all project fileshusky-install: initialize Huskytype-check: runs the linter in all components and pagescypress:open: runs Cypress on a browser to check E2E and component testscypress:run: runs Cypress on a terminal to check E2E and component testsThe Next.js Boilerplate is a comprehensive starter project for developers. It comes with various features and technologies such as Typescript, Chakra UI, ESLint, Prettier, Husky, Lint-staged, and Cypress. The boilerplate offers advantages provided by Next.js and supports efficient styling with Chakra UI. With an easy installation process and useful terminal commands, this boilerplate enhances productivity and provides a solid foundation for developing Next.js applications.
Next.js is a React-based web framework that enables server-side rendering, static site generation, and other powerful features for building modern web applications.
Chakra UI is a popular open-source React component library that provides a set of accessible and customizable UI components to help developers create modern web applications.
ESLint is a linter for JavaScript that analyzes code to detect and report on potential problems and errors, as well as enforce consistent code style and best practices, helping developers to write cleaner, more maintainable code.
TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.