
A production-ready starter template with everything you need to build and deploy high-performance Next.js applications.
This boilerplate is designed to give you a production-ready foundation with everything configured for optimal development experience and performance:
- 🚀 Performance Optimized - 100% Lighthouse score out of the box
- 🔍 SEO Ready - Comprehensive meta tags and structured data
- 🎨 Modern UI - Clean design with light/dark mode support
- 🛠️ Developer Experience - Comprehensive tooling preconfigured
- 📱 Responsive - Mobile-first approach for all screen sizes
- ♿ Accessible - WCAG compliance with a11y best practices
- 🔒 Type Safe - Full TypeScript support throughout the codebase
Next.js 15
- React framework for productionTypeScript
- Type safety and improved developer experienceTailwind CSS
- Utility-first CSS frameworkESLint
- Code quality and consistencyPrettier
- Code formattingHusky
- Git hooks for pre-commit validationnext-themes
- Theme management (light/dark mode)React Query
- Data fetching and state management
git clone https://github.com/AnwarHossainSR/nextjs-15-template.git
# Install dependencies
npm install
# or
yarn install
# Start development server
npm run dev
# or
yarn dev
Your application will be available at http://localhost:3000.
Command | Description |
---|---|
yarn dev |
Start development server |
yarn build |
Build production application |
yarn start |
Start production server |
yarn lint |
Run ESLint to check code quality |
yarn analyze |
Generate bundle analyzer report |
yarn format |
Format code with Prettier |
src/
├── app/ # App router pages
├── components/ # Reusable UI components
├── hooks/ # Custom React hooks
├── lib/ # Utility functions and libraries
├── providers/ # Context providers
├── styles/ # Global styles
├── types/ # TypeScript type definitions
└── utils/ # Helper functions
This boilerplate uses Tailwind CSS for styling with a custom theme configuration that supports light and dark modes. Styled Components are generated at build time and served with the document generated by Next.js Server Side Rendering for optimal performance.
The project includes Google Fonts (Inter and Poppins) preloaded at build time for improved performance and consistent typography.
Absolute imports are configured with the @/
prefix starting from the src
folder:
// Instead of this
import { Button } from '../../../components/ui/Button';
// You can write this
import { Button } from '@/components/ui/Button';
Imports are automatically grouped and sorted in the following order:
- External dependencies
- Absolute imports (
@/*
) - Relative imports
This is implemented using eslint-plugin-simple-import-sort
.
ESLint extends:
eslint-config-airbnb
eslint-config-next
eslint-plugin-jsx-a11y
for accessibility recommendations
On every commit, staged files are validated with ESLint using Husky and lint-staged:
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": "eslint --cache --fix --cache-location ./node_modules/.cache/.eslintcache"
}
- Comprehensive meta tags in the layout file
- OpenGraph and Twitter card metadata
/public/robots.txt
configured to allow indexing- Sitemap generation support
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
Made with ❤️ by Anwar Hossain