Skip to content

Full-stack Next.js monorepo boilerplate featuring TypeScript, Drizzle ORM, PostgreSQL, and modern development tools. Built with clean architecture principles and ready for production use.

License

Notifications You must be signed in to change notification settings

axelhamil/nextjs-clean-architecture-starter

πŸš€ Full-Stack Next.js Monorepo Boilerplate

A production-ready, full-stack monorepo boilerplate featuring Next.js, Drizzle ORM, and a modern TypeScript stack. It's designed to be a starting point for your own applications, with a focus on Developer Experience and best practices.

✨ Features

  • Monorepo Structure powered by Turborepo and PNPM Workspaces
  • Full-Stack Next.js 15 with App Router, Server Components, and Route Handlers
  • Type Safety across all packages and apps with shared TypeScript configurations
  • Modern Development Tools including Biome for linting and formatting
  • Containerized Development with Docker and Docker Compose
  • Modern Styling with Tailwind CSS 4 and shadcn/ui
  • Type-Safe Database with Drizzle ORM and PostgreSQL
  • Dependency Injection with a lightweight container

πŸ“¦ Project Structure

.
β”œβ”€β”€ apps/
β”‚   └── nextjs/       # Full-Stack Next.js Application
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ drizzle/      # Database schema and migrations
β”‚   β”œβ”€β”€ libs/         # Shared utilities and types
β”‚   β”œβ”€β”€ ui/           # Shared UI components from shadcn/ui
β”‚   └── typescript-config/ # Shared TypeScript configurations

πŸ› οΈ Prerequisites

  • Node.js (version 22.16.0 or later)
  • PNPM package manager (10.12.1 or later)
  • Docker and Docker Compose
  • PostgreSQL (via Docker)

πŸš€ Getting Started

# Clone and install
git clone <repository-url> && cd <repository-name>
pnpm install

# Setup environment and database
cp .env.example .env
docker-compose up -d
pnpm db:push

# Start development
pnpm dev

🌐 Services

Service URL
Next.js http://localhost:3000

πŸ—οΈ Development

Available Scripts

pnpm dev        # Start all applications in development mode
pnpm build      # Build all applications and packages
pnpm lint       # Lint all applications and packages using Biome
pnpm format     # Format code using Biome
pnpm db:push    # Push database schema changes
pnpm db:generate # Generate database types and migrations
pnpm db:migrate # Run database migrations
pnpm db:studio  # Open Drizzle Studio
pnpm clean      # Clean up build artifacts and node_modules
pnpm type-check # Run TypeScript type checking
pnpm test       # Run tests

πŸ“š Tech Stack

Main Stack

Next.js React TypeScript Tailwind CSS Drizzle PostgreSQL shadcn/ui Zod Nuqs

⚑ Development

Turborepo PNPM Docker Biome Husky

πŸ”„ Utilities

Remeda Slugify

πŸ“ License

MIT

Created by @axelhamil

About

Full-stack Next.js monorepo boilerplate featuring TypeScript, Drizzle ORM, PostgreSQL, and modern development tools. Built with clean architecture principles and ready for production use.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks