An open API service indexing awesome lists of open source software.

https://github.com/AnwarHossainSR/nextjs-15-template

This is next js 15 boilerplate. You can start your next 15 project without any hassle of setup.
https://github.com/AnwarHossainSR/nextjs-15-template

boilerplate boilerplate-template next-auth next-tailwind next15 next15-boilerplate next15example nextboiler nextjs nextjs-15 nextjs-template nextjs15-starter nextjs15-typescript nodejs react react-query reactjs tailwindcss tanstack-react-query template

Last synced: 12 days ago
JSON representation

This is next js 15 boilerplate. You can start your next 15 project without any hassle of setup.

Awesome Lists containing this project

README

        

# Next.js 15 Boilerplate


Next.js Boilerplate

A production-ready starter template with everything you need to build and deploy high-performance Next.js applications.



[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![TypeScript](https://img.shields.io/badge/TypeScript-5.3-blue)](https://www.typescriptlang.org/)
[![Next.js](https://img.shields.io/badge/Next.js-15.0-black)](https://nextjs.org/)
[![Tailwind CSS](https://img.shields.io/badge/Tailwind-3.4-38bdf8)](https://tailwindcss.com/)
[![ESLint](https://img.shields.io/badge/ESLint-8.0-4b32c3)](https://eslint.org/)
[![Perfect Lighthouse Score](https://img.shields.io/badge/Lighthouse-100%25-success)](https://developer.chrome.com/docs/lighthouse/overview/)

## 🖥️ Demo


Next.js Boilerplate Home Page Demo

## ✨ Features

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

## 📚 Tech Stack

- [`Next.js 15`](https://nextjs.org/) - React framework for production
- [`TypeScript`](https://typescriptlang.org) - Type safety and improved developer experience
- [`Tailwind CSS`](https://tailwindcss.com/) - Utility-first CSS framework
- [`ESLint`](https://eslint.org/) - Code quality and consistency
- [`Prettier`](https://prettier.io/) - Code formatting
- [`Husky`](https://github.com/typicode/husky) - Git hooks for pre-commit validation
- [`next-themes`](https://github.com/pacocoursey/next-themes) - Theme management (light/dark mode)
- [`React Query`](https://tanstack.com/query) - Data fetching and state management

## 🚀 Getting Started

### Create a new project using this boilerplate

```bash
git clone https://github.com/AnwarHossainSR/nextjs-15-template.git
```

### Development

```bash
# 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](http://localhost:3000).

## 📋 Scripts

| 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 |

## 🧰 Project Structure

```
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
```

## 💅 Styling

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.

## 🧩 Development Features

### Absolute Imports

Absolute imports are configured with the `@/` prefix starting from the `src` folder:

```tsx
// Instead of this
import { Button } from '../../../components/ui/Button';

// You can write this
import { Button } from '@/components/ui/Button';
```

### Import Sorting

Imports are automatically grouped and sorted in the following order:

1. External dependencies
2. Absolute imports (`@/*`)
3. Relative imports

This is implemented using [`eslint-plugin-simple-import-sort`](https://github.com/lydell/eslint-plugin-simple-import-sort).

### Code Quality

ESLint extends:

- [`eslint-config-airbnb`](https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb)
- [`eslint-config-next`](https://www.npmjs.com/package/eslint-config-next)
- [`eslint-plugin-jsx-a11y`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y) for accessibility recommendations

### Git Hooks

On every commit, staged files are validated with ESLint using Husky and lint-staged:

```json
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": "eslint --cache --fix --cache-location ./node_modules/.cache/.eslintcache"
}
```

## 🔍 SEO

- Comprehensive meta tags in the layout file
- OpenGraph and Twitter card metadata
- `/public/robots.txt` configured to allow indexing
- Sitemap generation support

## 📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

## 🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

---


Made with ❤️ by Anwar Hossain