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

https://github.com/omergulcicek/nextjs-boilerplate

πŸš€ Modern Next.js 15 boilerplate with TypeScript & Tailwind CSS
https://github.com/omergulcicek/nextjs-boilerplate

boilerplate eslint husky lucide next-themes nextjs nextjs-boilerplate prettier radix-ui react react-hook-form shadcn-ui tailwindcss tanstack-query typescript zod zustand

Last synced: about 1 month ago
JSON representation

πŸš€ Modern Next.js 15 boilerplate with TypeScript & Tailwind CSS

Awesome Lists containing this project

README

          

# Next.js Boilerplate

Modern **Next.js 15.3** boilerplate with **TypeScript** & **Tailwind CSS**

Live Demo: https://nextjs15-boilerplate.vercel.app/en

## Features

With this template, you get all the awesomeness you need:

- πŸ“‚ Advanced Folder Structures
- ⚑ [Next.js](https://nextjs.org/) with App Router support
- πŸ’Ž Type checking [TypeScript](https://www.typescriptlang.org/)
- 🎨 Styled using [Tailwind CSS](https://tailwindcss.com/)
- πŸ“¦ State management with [Zustand](https://zustand-demo.pmnd.rs/)
- πŸ—ΊοΈ [next-intl](https://next-intl.dev/) for internationalization
- 🧩 UI Components built with [shadcn/ui](https://ui.shadcn.com/)
- πŸ”„ Data Fetching, Caching and Mutation with [TanStack Query](https://tanstack.com/query/latest)
- ⌨️ Form handling with [React Hook Form](https://react-hook-form.com/)
- πŸ”΄ Validation library with [Zod](https://zod.dev/)
- 🌸 Smart masking and validation with [@omergulcicek/forms](https://www.npmjs.com/package/@omergulcicek/forms)
- 🧹 Linter with [ESLint](https://eslint.org/)
- πŸ’– Code Formatter with [Prettier](https://prettier.io/)
- πŸŽ‰ [Storybook](https://storybook.js.org/) for UI development
- 🚨 Error tracking with [Sentry](https://sentry.io/)
- πŸ“Š Analytics with [Google Analytics](https://analytics.google.com/)
- ⏳ Loading UI using [Skeleton Components](https://ui.shadcn.com/docs/components/skeleton)
- πŸŒ“ Dark theme with [next-themes](https://npmjs.com/package/next-themes)
- πŸ’‘ [Absolute Imports](https://nextjs.org/docs/pages/building-your-application/configuring/absolute-imports-and-module-aliases) with `@` prefix
- ✨ Beautiful and consistent icons from [Lucide](https://lucide.dev/)
- 🐢 [Husky](https://typicode.github.io/husky/) for Git Hooks
- πŸ€– Sitemap.xml and robots.txt
- βš™οΈ Metadata files optimized for SEO
- πŸͺ Storage helpers for Local, Session, Cookies
- πŸ’― Maximize lighthouse score

## Project structure

```shell
β”‚
β”œβ”€β”€ .husky # Husky git hook scripts
β”œβ”€β”€ messages # i18n messages
β”œβ”€β”€ public # Public assets folder
β”œβ”€β”€ src
β”‚ β”œβ”€β”€ app # Next JS App (App Router)
β”‚ β”œβ”€β”€ assets # Static assets (images, fonts, etc.)
β”‚ β”œβ”€β”€ components # React components
β”‚ β”‚ β”œβ”€β”€ icons # svg icons
β”‚ β”‚ β”œβ”€β”€ features # Components with hooks and calculations
β”‚ β”‚ β”œβ”€β”€ shared # Header, footer, aside components
β”‚ β”‚ β”œβ”€β”€ skeletons # Loading components
β”‚ β”‚ β”œβ”€β”€ ui # Atomic components
β”‚ β”‚ └── widgets # Advanced UI components
β”‚ β”œβ”€β”€ constants # Project-wide constants
β”‚ β”œβ”€β”€ data # Static or mock data
β”‚ β”œβ”€β”€ helpers # Reusable utility functions (e.g., API, formatting, storage)
β”‚ β”œβ”€β”€ hooks # Reusable custom React hooks
β”‚ β”œβ”€β”€ i18n # Internationalization setup
β”‚ β”œβ”€β”€ lib # Common utility functions
β”‚ β”œβ”€β”€ providers # Global context providers (theme, data fetching, notifications, i18n)
β”‚ β”œβ”€β”€ schemas # Validation schemas
β”‚ β”œβ”€β”€ services # API request functions
β”‚ β”œβ”€β”€ stores # Global state
β”‚ β”œβ”€β”€ types # TypeScript type definitions
β”‚ └── .middleware # Middleware for Next.js
β”œβ”€β”€ .env # Environment variables
β”œβ”€β”€ .gitignore # Git ignore rules
β”œβ”€β”€ .prettierrc # Prettier config
β”œβ”€β”€ components.json # shadcn/ui config
β”œβ”€β”€ eslint.config.mjs # ESLint config
β”œβ”€β”€ next.config.mjs # Next.js config
β”œβ”€β”€ package.json # Project dependencies and scripts
β”œβ”€β”€ postcss.config.js # PostCSS config
β”œβ”€β”€ README.md # README file
β”œβ”€β”€ tailwind.config.js # Tailwind CSS config
└── tsconfig.json # TypeScript config
```

## File Naming Conventions

The project follows consistent file naming conventions:

| File Type | Example | Style |
| -------------- | ---------------- | ---------- |
| Component | `LoginForm.tsx` | PascalCase |
| Hook | `useLogin.ts` | camelCase |
| Helper, Schema | `form-schema.ts` | kebab-case |
| Folder | `login-form/` | kebab-case |
| Constants | `ALPHA_REGEX` | SNAKE_CASE |

## Monitoring & Analytics

🚧 Don't forget to replace all FIXME tags with proper code before finalizing the changes.

### Error Tracking

We use [Sentry](https://sentry.io/) for error tracking and performance monitoring. To set up:

1. Create a Sentry account
2. Add your DSN to `.env`:

```env
NEXT_PUBLIC_SENTRY_DSN=your-sentry-dsn
```

### Analytics

We use [Google Analytics](https://analytics.google.com/) for tracking user behavior. To set up:

1. Create a Google Analytics account
2. Add your ID to `.env`:

```env
NEXT_PUBLIC_GA_ID=G-XXXXXXXXXX
```

### Contributors

- [@omergulcicek](https://github.com/omergulcicek)