Next Boilerplate

screenshot of Next Boilerplate
nextjs
react
tailwind

A well-structured production-ready Next.js boilerplate with a well-documented directory structuring that supports Typescript, Jest, react-testing-library, Cypress, configurable Fetch and SWR, and a configured component library using Emotion, twin.macro, Tailwind, and Storybook. Plus, taking advan...

Overview:

The Next.js opinionated boilerplate is a well-structured and production-ready boilerplate for Next.js applications. It comes with a fully-documented directory structure and supports various features such as Typescript, Jest, react-testing-library, Cypress, configurable Fetch and SWR, and a configured component library using Emotion, twin.macro, Tailwind, and Storybook. It also includes NextSeo and NextSitemap for SEO optimization.

Features:

  • Setup strong Linter, lint-staged, husky
  • Setup Jest and react-test-renderer
  • Setup Cypress
  • Setup GitHub actions
  • Deploy on Vercel
  • Dockerize the application
  • Setup directory structure and global types
  • Setup configurable Fetch and SWR
  • Setup Analytics tools with separate business level abstracting
  • Setup SEO optimization (NextSeo, NextSitemap)
  • Setup Error Handling and Reporting
  • Setup Redux
  • Setup Emotion and twin.macro with fully-configured Tailwind
  • Setup UI library (Storybook installed with some helper functions)
  • Setup MediaQuery module (SSR support)
  • Setup optimized, easy to change, testable Google font
  • Setup Layout structure (Per page layout support)
  • Implement a minimal component library (with the help of headless ui)
  • Additional hooks: useAliveRef, useCombinedRef, useElementSize, useIntersect, useResizeEffect, useScrollEffect, useThrottleCallback, useThrottleEffect, useInfiniteLoader, useClipboard, useLocalStorageState, useCookieState, useNetworkStatus
  • Additional components: TruncatedText, Running

Build and deploy:

To ensure a clean deployment and run the project, execute the following commands:

  • To build the Storybook: npm run build-storybook
  • To deploy the project: npm run deploy

Summary:

The Next.js opinionated boilerplate is a comprehensive and well-structured boilerplate for Next.js applications. It includes a wide range of features and tools such as Typescript, Jest, Cypress, Fetch and SWR, Emotion and Tailwind for styling, SEO optimization, error handling, Redux, and much more. With its clear directory structure and extensive documentation, it provides developers with a solid foundation to start building their Next.js projects.

nextjs
Next.js

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.

react
React

React is a widely used JavaScript library for building user interfaces and single-page applications. It follows a component-based architecture and uses a virtual DOM to efficiently update and render UI components

tailwind
Tailwind

Tailwind CSS is a utility-first CSS framework that provides pre-defined classes for building responsive and customizable user interfaces.

eslint
Eslint

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.

postcss
Postcss

PostCSS is a popular open-source tool that enables web developers to transform CSS styles with JavaScript plugins. It allows for efficient processing of CSS styles, from applying vendor prefixes to improving browser compatibility, ultimately resulting in cleaner, faster, and more maintainable code.

Storybook

Storybook is a tool for developing and testing UI components in isolation. It provides a sandbox environment where you can experiment with different props and states to see how your component responds.

typescript
Typescript

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.