Overview
The NEXT Boilerplate is a lightweight boilerplate for the Next.js framework. It was created to address the lack of certain features in Next.js that the developers needed. This boilerplate includes a range of features such as Redux for state management, Redux Saga for handling asynchronous actions and side effects, next-routes for dynamic route handling, axios for making HTTP requests, dotenv for using environment variables, express as the server, and more. It also comes pre-configured with prettier and eslint using airbnb’s styleguide for code formatting, as well as husky and lint-staged for autoformatting code before committing. Additionally, it includes styled-components, flow, and Storybook, although these can be removed if desired.
Features
- Redux: Manages application state.
- Redux Saga: Handles asynchronous actions and side effects.
- next-routes: Handles dynamic route handling.
- axios: Enables making HTTP requests.
- dotenv: Allows the use of environment variables.
- express: Serves as the server.
- redux-devtools: Facilitates development by providing a tool for managing actions and state changes.
- redux-logger: Logs actions and state changes for development purposes.
- universal-cookie-express: Provides middleware for writing cookies easily.
- compression: Compresses static assets.
- babel-plugin-module-resolver: Enables importing modules related to the root directory.
- prettier and eslint: Configured with airbnb’s styleguide for code formatting.
- husky and lint-staged: Autoformats code before commit.
- styled-components: Allows writing actual CSS code to style components.
- flow and Storybook: Includes flow for static type checking and Storybook for component development and testing.
Installation
To install the NEXT Boilerplate, follow these steps:
- Clone the repository:
git clone [repository_url] - Install dependencies:
npm install - Start the development server:
npm run dev
For more detailed information, please refer to the documentation.
Summary
The NEXT Boilerplate is a lightweight Next.js boilerplate that addresses the limitations of the Next.js framework by providing additional features and configurations. It includes popular libraries such as Redux, Redux Saga, Axios, and dotenv for managing application state, handling asynchronous actions, making HTTP requests, and using environment variables, respectively. It also comes with pre-configurations for code formatting using prettier and eslint, as well as tools for automating code formatting before committing. Additionally, it includes styled-components for styling components using CSS and flow for static type checking. Overall, the NEXT Boilerplate is a comprehensive solution for building Next.js applications with advanced features and configurations.