Skip to content

A production-ready Next.js boilerplate with modern tooling, comprehensive testing, and enterprise-grade features.

Notifications You must be signed in to change notification settings

arrowsw/nextjs-starter-template

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Next.js Starter Template

A production-ready Next.js boilerplate with modern tooling, comprehensive testing, and enterprise-grade features.

πŸ’« Built with love by Yeasin

✨ Features

πŸ—οΈ Core Framework

  • ⚑ Next.js 15 with App Router & Server Components
  • πŸ”· TypeScript 5.8 with strict configuration
  • βš›οΈ React 19 with latest features

🎨 UI & Styling

  • 🎯 Tailwind CSS with custom design system
  • 🧩 shadcn/ui components with Radix UI primitives
  • πŸŒ™ Dark mode support with next-themes
  • 🎭 Lucide React icons

πŸ—„οΈ Database & ORM

  • 🐘 Drizzle ORM with PostgreSQL support
  • 🌐 Multi-provider support (Neon, PlanetScale, Turso, Xata)
  • πŸ”„ Database migrations and seeding
  • πŸŽ›οΈ Drizzle Studio for database management

πŸ” Authentication

  • πŸ‘€ Clerk integration for user management
  • πŸ”’ Secure authentication flows
  • πŸ“§ Email templates with React Email

🌍 Internationalization

  • πŸ—£οΈ next-intl for i18n support
  • 🌐 Locale routing and translations

πŸ§ͺ Testing Suite

  • ⚑ Vitest for unit testing with jsdom
  • 🎭 Playwright for E2E testing
  • πŸ§ͺ Testing Library for React components
  • πŸ“š Storybook for component development
  • πŸ“Š Coverage reports with v8

πŸ”§ Development Tools

  • 🎯 ESLint with Next.js & TypeScript configs
  • πŸ’… Prettier with Tailwind plugin
  • πŸ” Knip for unused code detection
  • πŸ¦… Codehawk for code analysis
  • πŸ“¦ Bundle Analyzer for optimization

🐳 DevOps & Deployment

  • 🐳 Docker with multi-stage builds
  • πŸ”„ Docker Compose for development/production
  • πŸ₯ Health checks and monitoring
  • πŸ“ˆ Performance monitoring with React Scan

πŸ›‘οΈ Security & Performance

  • πŸ”’ Security headers configured
  • πŸš€ Standalone output for Docker
  • πŸ“Š OpenTelemetry integration
  • ⚑ Edge runtime support

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ or Bun
  • PostgreSQL database
  • Git

Installation

# Clone the repository
git clone https://github.com/yeasin2002/nextjs-starter-template.git
cd nextjs-starter-template

# Install dependencies
npm install
# or
bun install

# Copy environment variables
cp .env.example .env

# Set up your database URL and other environment variables
# Edit .env file with your configuration

# Generate database schema
npm run db:generate

# Run database migrations
npm run db:migrate

# Seed the database (optional)
npm run db:seed

# Start development server
npm run dev

Visit http://localhost:3000 to see your application.

πŸ“œ Available Scripts

πŸ”§ Development

npm run dev          # Start development server
npm run build        # Build for production
npm run start        # Start production server
npm run type-check   # TypeScript type checking

πŸ—„οΈ Database

npm run db:generate  # Generate database migrations
npm run db:migrate   # Apply database migrations
npm run db:studio    # Open Drizzle Studio
npm run db:seed      # Seed database with sample data

πŸ§ͺ Testing

npm run test         # Run unit tests
npm run test:watch   # Run tests in watch mode
npm run test:coverage # Run tests with coverage report
npm run test:e2e     # Run E2E tests
npm run test:e2e:ui  # Run E2E tests with UI

πŸ’… Code Quality

npm run lint         # Run ESLint
npm run lint:fix     # Fix ESLint issues automatically
npm run format       # Format code with Prettier
npm run format:check # Check code formatting
npm run knip         # Check for unused code
npm run codehawk     # Analyze code quality

🐳 Docker

npm run docker:build # Build Docker image
npm run docker:dev   # Run development container
npm run docker:prod  # Run production container
npm run docker:test  # Run test container

πŸ“š Storybook

npm run storybook       # Start Storybook dev server
npm run build-storybook # Build Storybook for production

πŸ“Š Analysis

npm run analyze      # Analyze bundle size

πŸ“ Project Structure

β”œβ”€β”€ .kiro/              # Kiro AI assistant configuration
β”œβ”€β”€ .storybook/         # Storybook configuration
β”œβ”€β”€ config/             # Application configuration
β”œβ”€β”€ public/             # Static assets
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/            # Next.js App Router pages
β”‚   β”œβ”€β”€ components/     # Reusable React components
β”‚   β”‚   └── ui/         # shadcn/ui components
β”‚   β”œβ”€β”€ db/             # Database configuration & schema
β”‚   β”œβ”€β”€ hooks/          # Custom React hooks
β”‚   β”œβ”€β”€ i18n/           # Internationalization
β”‚   β”œβ”€β”€ lib/            # Utility libraries
β”‚   β”œβ”€β”€ styles/         # Global CSS
β”‚   β”œβ”€β”€ types/          # TypeScript definitions
β”‚   └── utils/          # Helper functions
β”œβ”€β”€ tests/              # E2E and integration tests
└── scripts/            # Build and deployment scripts

πŸ”§ Configuration

Environment Variables

Copy .env.example to .env and configure:

  • Database connection
  • Clerk authentication keys
  • Optional: Sentry, PostHog, Stripe, etc.

Database Setup

  1. Set your DATABASE_URL in .env
  2. Run migrations: npm run db:migrate
  3. Optional: Seed data: npm run db:seed

Authentication

  1. Create a Clerk account at clerk.com
  2. Add your Clerk keys to .env
  3. Customize sign-in/sign-up URLs as needed

πŸš€ Deployment

Docker Deployment

# Build production image
npm run docker:build

# Run production container
npm run docker:prod

Vercel Deployment

  1. Connect your repository to Vercel
  2. Set environment variables in Vercel dashboard
  3. Deploy automatically on push to main branch

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request

πŸ“„ License

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

πŸ™ Acknowledgments


⭐ Star this repository if it helped you!

About

A production-ready Next.js boilerplate with modern tooling, comprehensive testing, and enterprise-grade features.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 98.0%
  • Other 2.0%