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 16- React framework for production with TurbopackReact 19- Latest React with improved performancePrisma- Next-generation ORM for database managementClerk- Complete user management and authenticationFramer Motion- Production-ready animation libraryTypeScript- 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)TanStack Query- Powerful data fetching and state management
git clone https://github.com/AnwarHossainSR/nextjs-16-template.git# Install dependencies
npm install
# or
yarn install
# Start development server
npm run dev
# or
yarn devYour application will be available at http://localhost:3000.
| Command | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build production application |
npm run start |
Start production server |
npm run lint |
Run ESLint to check code quality |
npm run format |
Format code with Prettier |
npm run prisma:generate |
Generate Prisma client |
npm run prisma:push |
Push schema changes to database |
npm run seed |
Seed database with initial data |
src/
βββ app/ # App router pages and API routes
βββ components/ # Reusable UI components
βββ config/ # Application configuration
βββ context/ # React context providers
βββ env/ # Environment variable configuration
βββ hooks/ # Custom React hooks
βββ layouts/ # Layout components
βββ lib/ # Utility functions and libraries
βββ providers/ # Context providers
βββ services/ # API services and business logic
βββ styles/ # Global styles
βββ types/ # TypeScript type definitions
prisma/
βββ schema.prisma # Database schema
βββ seed.ts # Database seeding script
This boilerplate uses Tailwind CSS v4 with canonical syntax for styling with a custom theme configuration that supports light and dark modes. The project uses CSS variables for theming, making it easy to customize colors and styles.
This project uses the new canonical Tailwind CSS syntax:
// Old syntax
className = 'bg-[var(--primary)] text-[var(--foreground)]';
// New canonical syntax
className = 'bg-(--primary) text-(--foreground)';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';User authentication is handled by Clerk, providing:
- Email/password authentication
- Social login (Google, GitHub, etc.)
- User management dashboard
- Session management
- Protected routes
The project uses Prisma as the ORM with MongoDB:
# Generate Prisma client
npm run prisma:generate
# Push schema changes
npm run prisma:push
# Seed database
npm run seedESLint is configured with:
eslint-config-next- Next.js recommended rules- React Compiler rules for optimal performance
- Custom rules for code quality and consistency
On every commit, the following checks run automatically:
- TypeScript type checking - Ensures type safety
- ESLint with auto-fix - Fixes code quality issues
- Prettier formatting - Ensures consistent code style
- Commitlint - Validates commit message format
On every push:
- Production build - Ensures the app builds successfully
- Prisma client generation - Validates database schema
# Commit message format
type(scope): subject
# Examples
feat: add user authentication
fix: resolve build error
chore: update dependencies- Comprehensive meta tags in the layout file
- OpenGraph and Twitter card metadata
/public/robots.txtconfigured to allow indexing- Sitemap generation support
- Next.js 16 with Turbopack for faster builds
- React 19 for improved performance
- Optimized images with next/image
- Server-side rendering and static generation
Create a .env file in the root directory:
# Database
MONGODB_URI=your_mongodb_connection_string
# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
CLERK_SECRET_KEY=your_clerk_secret_key
CLERK_WEBHOOK_SECRET=your_clerk_webhook_secret
# Clerk URLs
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/dashboard
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/dashboard
# NextAuth
NEXTAUTH_SECRET=your_nextauth_secret
# Environment
NODE_ENV=developmentThis 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
