Skip to content

Jean-baptisteColette/nextjs-boilerplate

Repository files navigation

Next.js Boilerplate

🚀 Boilerplate and Starter for Next.js, Muiv5, TanStack Query, Storybook, i18n and TypeScript ⚡️ Made with developer experience first: Next.js, TypeScript, ESLint, Prettier, Husky, Lint-Staged, Jest, Testing Library.

Getting Started

Install dependencies with yarn if you have just cloned the repo

yarn

First, run the development server:

yarn dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying src/pages/index.tsx. The page auto-updates as you edit the file.

API routes can be accessed on http://localhost:3000/api/user. This endpoint can be edited in src/pages/api/user/index.ts.

The src/pages/api directory is mapped to /api/*. Files in this directory are treated as API routes instead of React pages.

Storybook on local

Install dependencies with yarn if you have just cloned the repo

yarn

First, run the storybook server:

yarn storybook

Open http://localhost:6006 with your browser to see the storybook.

Link Storybook to Chromatic

Production build

Install dependencies with yarn if you have just cloned the repo

yarn

First, build the app:

yarn build

Then start the app:

First, build the app:

yarn start

Mui Theme file and company

The src/components directory contains the theme file and some components. You can import each components in your modules or pages with import {<component-name>} from "@components/<component-name>"

Testing

Just run:

yarn test

Learn More

To learn more about Next.js, Mui, React Query, take a look at the following resources: