A modern, batteries-included Next.js 15 frontend boilerplate designed for rapid development and scalable applications.
-
β‘ Next.js 15 with Turbopack support and using App Router
-
π¨ UI powered by Mantine v8
-
π Built-in Internationalization (i18n) with Next-Intl
-
π§ͺ Vitest for unit testing
-
π§ Playwright for E2E testing
-
π React-scan to check for application performance issues
-
π§Ό Strict linting via ESLint and lint-staged
-
π¨ TailwindCSS v4 ready
-
π¦ Storybook 8 with onboarding & styling addons
-
π Commitlint, CZ-git, Husky, and Conventional Commits setup
-
π TypeScript + aliases + strong types
-
ποΈ Clean folder structure and scalable architecture
-
π§ Zustand for global state management
-
π² Faker.js for mock data generation
-
π TanStack Query for server-state caching and fetching
-
π T3 Env for type-safe environment variables
-
π§Ύ Zod for schema validation and parsing
-
β»οΈ ts-reset to enhance the TypeScript standard library
-
π§© nextjs-third-parties for simplified third-party integrations
-
π Axios for powerful and flexible HTTP requests
-
π Automatic generation of folders and files when creating a new feature with the cli
First, check the following prerequisites. To check the node version, use the node -v
command in your CMD, and to check the pnpm version, use the pnpm -v
command.
-
Node.js β₯ 20
-
pnpm = 10.11.0
π tip: Depending on your experience and needs, you can use fnm or nvm
- π₯ Cloning a project
git clone https://github.com/your-repo/your-project.git
cd your-project
- π€ Setting up GitHub actions
To be able to use GitHub actions for CI workflow, you need to create an environment in your GitHub repository. You can use the following path:
your repo > Settings > Secrets and variables > Actions > Variables(tab) > Manage environment variables > New environment
In CI workflow, the name assigned to the environment is production
by default. If you want to change the name of the environment to your liking, use the name you specified when creating the environment in GitHub. To change the name of the environment locally, go to .github\workflows\CI.yml
and change the name of the environment.
Also, check that your variable names match in the .github\workflows\CI.yml
file:
Β env:
Β Β NEXT_PUBLIC_BASE_API_URL: ${{ vars.NEXT_PUBLIC_BASE_API_URL }}
Β Β NEXT_PUBLIC_APP_URL: ${{ vars.NEXT_PUBLIC_APP_URL }}
- π± Setting environment variables
Make a copy of the .env.example file and set the required variables.
- π§ Installation
pnpm install
- π§© Installing vscode extensions (optional)
I strongly recommend installing all the suggested plugins to increase the quality and speed of development
-
βοΈ vitest.explorer
-
π mikestead.dotenv
-
π lokalise.i18n-ally
pnpm dev
My boilerplate has built-in capabilities that are either completely independent or are a combination of existing libraries. These capabilities can be very useful and speed up development several times.
Instead of manually creating the files and folders needed for a new feature, you can use our CLI tool. Just specify the name of the feature, then select the files and folders you need. Everything will be generated automatically.
pnpm new-feature
By running this command, first enter the name of the feature. Then select the files and folders you want to create. To select or deselect, use the Space
key in the browser.
Each folder may contain a required file, and each file (in the root of the feature folder or in any subfolder) may contain the code required for minimal development.
Inside the src/config/routes.ts
file you can manage all your routes. This includes site pages and api routes.
Below are some useful scripts that can help with project development:
Command | Description |
---|---|
pnpm dev |
Runs the development server on port 3000 |
pnpm build:safe |
Checks for typos before building |
pnpm build |
Build for production |
pnpm lint |
Checks code against eslint rules |
pnpm lint:fix |
Fixes problems on the fly in addition to what lint does |
pnpmΒ check-types |
Checks for typescript errors |
pnpm test |
Running vitest tests |
pnpm test:watch |
Real-time execution and review of vitest tests |
pnpm test:e2e |
Run E2E tests with Playwright |
pnpmΒ deploy:simple |
Builds once before pushing the project to your GitHub repository |
pnpmΒ deploy:strict |
Checks types, eslint rules, and test results before pushing the code to the GitHub repository, and then builds (recommended) |
pnpm build-storybook |
Export static Storybook |
I have created configurations for each library that can improve the quality of the output, provide a better development experience, and be suitable for most projects.
Please note that these configs are personal. If you have any problems with the configuration, you will need to apply the changes manually
β Important note: Although this Boilerplate supports development with tailwindCSS well and is partially integrated with Mantine, it is strongly recommended that the entire UI structure be developed with Mantine.
-
Integrating Link Next.js and Next-Intl components with Mantine components
-
Integrating Image Next.js component with Mantine Image component
-
Integrated with tailwindcss (beta)
-
expanding and standardizing theme sizes
-
ability to display notifications
-
connecting to chromatic for UI testing
-
support for styling with Webpack
-
integrated with mantine UI
-
dark mode for storybook UI
-
accessibility testing
-
user interaction testing
-
typescript augmentation: Accurate typing for default language keys
-
vscode integration: Using the i18n Ally plugin (if you install this plugin)
-
storybook: Internationalization test within Storybook
- Built-in retry without a library and merge with tanstack query
- Ability to add query parameters without a library
-
Enabling devtool mode for better request review
-
Integrated with eslint
- Bundle analyzer enabled
-
Configure Fira Code font to increase code readability (you must install Fira Code font)
-
Integrated with Next.js, Mantine, Next-Intl, typescript, vitest, eslint
-
In the search section, ignoring files that do not have a direct impact on the development process
-
Integrated with tailwindCSS (to increase development quality with mantine)
Powered by next-intl
. All messages are managed inside:
src/config/i18n/messages/{locale}.json
-
Create a new translation file in the path
src/config/i18n/messages/{langKey}.json
. Note that you must replacelangKey
with your desired language key. -
Add new text keys:
{ "key": "text" }
-
Use in component:
const t = useTranslations(); return <Text>{t('key')}</Text>;
I strongly recommend installing all the suggested plugins to increase the quality and speed of development
In order to improve the development experience, increase productivity and standardize the code, it is recommended to use the following extensions for the Visual Studio Code development environment:
-
dbaeumer.vscode-eslint
The official ESLint plugin to automatically check the quality of the codes based on the lint rules defined in the project. -
YoavBls.pretty-ts-errors
Displays TypeScript errors in a more readable, understandable and suitable for quick debugging. -
streetsidesoftware.code-spell-checker
Check the spelling of words in English texts in the code and reduce spelling errors in variables and descriptions.
-
PKief.material-icon-theme
A set of beautiful and diverse icons for files and folders in VS Code, suitable for increasing the readability of the project structure. -
bradlc.vscode-tailwindcss
Full support for Tailwind CSS including class autocompletion, color preview, and detection of spelling errors in classes. -
formulahendry.auto-rename-tag
Automatic update of the closing tag when changing the opening tag in HTML and JSX files. -
formulahendry.auto-close-tag
Automatic closing of tags immediately after writing the opening tag, to increase coding speed and reduce errors.
-
vitest.explorer
A graphical interface for viewing and running unit tests using the Vitest framework. -
ms-playwright.playwright
The official Playwright plugin for managing End-to-End tests with the ability to run and debug in a graphical environment.
-
vunguyentuan.vscode-postcss
Supports PostCSS syntax and provides features such as autocompletion and code highlighting for PostCSS files. -
vunguyentuan.vscode-css-variables
Displays and autocompletions of defined CSS variables, suitable for developing design systems and custom themes.
lokalise.i18n-ally
A professional tool for managing translation files (i18n) with support for various formats such as.json
,.yaml
, and.po
.
-
mikestead.dotenv
Support for.env
environment files with syntax highlighting for managing configuration variables. -
SeanGilbertson.auto-collapse-folders
Automatically closes unopened folders to focus more on the current project structure and reduce clutter in the file browser.
This set of plugins can significantly help improve the development experience, reduce errors, and increase code quality. They are recommended for use in team projects, especially in TypeScript, React, and Tailwind environments.
You can deploy to any Vercel-compatible platform. Just make sure to set environment variables correctly via .env
.
Made with β€οΈ by Seyed Mojtaba Shadab
π§ [email protected]
π GitHub