Production-grade Turborepo template for Next.js apps.
sbrubbles-forge is a comprehensive Next.js monorepo boilerplate for building modern, production-ready web applications. It provides a solid, opinionated foundation with enterprise-grade features, tooling, and best practices built-in.
Author: Beno Dresch sbrubbles@sbrubbles.work
- π Next.js 16 with App Router, Server Components, Server Actions & Turbopack
- β‘ Turborepo for high-performance monorepo management with remote caching
- π¨ Design System with shadcn/ui components, React Aria, and Tailwind CSS v4
- π Authentication with custom auth package
- πΎ Database setup with PostgreSQL + Drizzle ORM
- π§ Email templates with React Email and preview server
- π Internationalization ready with i18n support
- π Analytics with self-hosted Umami integration
- π³ Payments infrastructure with Stripe
- π Security best practices (rate limiting, CSRF protection)
- π SEO optimization utilities
- π¦ Storage management with rustfs (S3-compatible)
- π Notifications system with ntfy integration
- π Webhooks handling with Svix
- π§ͺ Testing setup with Vitest (unit) and Playwright (E2E)
- π Observability with Sentry integration
- π€ AI/ML integrations ready
- π― Type-safe with strict TypeScript configuration
- π§Ή Code Quality with Ultracite (Biome-powered)
- π³ Docker compose for local development services
- π Storybook for component development and documentation
Clone this repository:
git clone https://github.com/sbrubbles-work/sbrubbles-forge.git
cd sbrubbles-forge
pnpm install- Node.js >= 24.14.0
- pnpm 11.1.1 (or compatible)
- Docker (required for local services: PostgreSQL, Umami, GlitchTip, etc.)
sbrubbles-forge/
βββ apps/
β βββ api/ # API routes and backend services (port 3006)
β βββ app/ # Main Next.js application (port 3005)
β βββ email/ # Email preview and development (port 3009)
β βββ storybook/ # Component documentation (port 6006)
β βββ studio/ # Drizzle Studio database management (port 3008)
βββ packages/
β βββ ai/ # AI/ML integrations
β βββ analytics/ # Analytics tracking
β βββ auth/ # Authentication system
β βββ database/ # Database schemas and migrations
β βββ design-system/# UI components library
β βββ email/ # Email templates
β βββ localization/ # i18n support
β βββ next-config/ # Shared Next.js configuration
β βββ notifications/# Notification system
β βββ observability/# Monitoring and logging (Sentry)
β βββ payments/ # Payment processing
β βββ rate-limit/ # Rate limiting utilities
β βββ security/ # Security middleware and utilities
β βββ seo/ # SEO helpers
β βββ storage/ # File storage management
β βββ testing/ # Testing utilities
β βββ typescript-config/ # Shared TypeScript configs
β βββ webhooks/ # Webhook handlers
βββ e2e/ # End-to-end tests (Playwright)
βββ docker/ # Docker configurations & database scripts
βββ scripts/ # Utility scripts
The primary user-facing Next.js application with:
- Server Components and Server Actions
- Authentication integration
- Database access via Drizzle ORM
- Analytics, notifications, and SEO utilities
- Responsive design system components
- Running on port 3005
Backend API services including:
- RESTful API routes
- Webhook handlers (Stripe, etc.)
- AI/ML integrations
- Payment processing
- Storage management
- Running on port 3006
Development environment for email templates:
- React Email components
- Live preview server
- Template testing
- Running on port 3009
Component documentation and development:
- Interactive component showcase
- Design system documentation
- Visual testing
- Running on port 6006
Drizzle Studio for database management:
- Browse database tables
- Run queries
- Manage data
- Running on port 3008
pnpm dev # Start all apps in development mode
pnpm build # Build all apps and packages
pnpm start # Start production build
pnpm test # Run unit tests
pnpm e2e # Run end-to-end testspnpm check # Check code with Ultracite (linting + formatting)
pnpm fix # Auto-fix issues with Ultracite
pnpm lint # Lint code
pnpm analyze # Analyze bundle sizes
pnpm boundaries # Check architecture boundariespnpm db:migrate # Run database migrations
pnpm db:generate # Generate migrations from schema
pnpm db:pull # Pull schema from database
pnpm db:push # Push schema to database
pnpm db:backup # Backup PostgreSQL database
pnpm db:seed # Seed database with sample data
pnpm studio # Open Drizzle Studio (port 3008)pnpm services:start # Start all Docker services (PostgreSQL, Umami, GlitchTip, etc.)pnpm release:patch # Release patch version
pnpm release:minor # Release minor version
pnpm release:major # Release major version
pnpm changeset # Create a changeset
pnpm release # Publish changeset- Framework: Next.js 15 with App Router & Turbopack
- UI Library: React 19
- Styling: Tailwind CSS (v4 with @tailwindcss/postcss)
- Components: shadcn/ui + React Aria Components
- State Management: React hooks + Server Components
- Forms: React Hook Form with Zod validation
- Data Fetching: Next.js Server Components & Server Actions
- Runtime: Node.js 24.14.0+
- Database: PostgreSQL with Drizzle ORM
- Authentication: Custom auth package
- API: Next.js API Routes & Server Actions
- Payments: Stripe integration
- Storage: File storage utilities
- Webhooks: Svix for webhook handling
- Monorepo: Turborepo
- Package Manager: pnpm 11.1.1
- Language: TypeScript (strict mode)
- Linting/Formatting: Ultracite (Biome engine)
- Testing: Vitest (unit) + Playwright (E2E)
- Component Dev: Storybook
- Email Dev: React Email
- Bundle Analysis: Next.js analyzer
- Error Tracking: Sentry
- Analytics: Umami (self-hosted)
- Containerization: Docker & Docker Compose
- CI/CD: Release-it + Changesets
- Local Services:
- PostgreSQL (database)
- Umami (analytics)
- GlitchTip (error tracking alternative)
- Valkey (Redis alternative, caching)
- ntfy (notifications)
- rustfs (file storage)
All packages extend from @repo/typescript-config for consistent type checking across the monorepo.
Shared Tailwind v4 configuration via @repo/design-system with PostCSS integration.
Base configuration shared through @repo/next-config with optimizations for:
- Standalone output for production
- Sentry integration
- Bundle analysis
- Turbopack in development
Create .env.local files in the root and/or individual apps. Key variables include:
# Database
DATABASE_URL=postgresql://postgres:mypassword@localhost:5432/postgres
# Authentication
NEXTAUTH_SECRET=your-secret-key
NEXTAUTH_URL=http://localhost:3005
# Payments (if using Stripe)
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
# Storage
STORAGE_URL=http://localhost:9000
# Analytics
ANALYTICS_URL=http://localhost:6005
# Monitoring
SENTRY_DSN=https://...Each workspace package (e.g., @repo/auth, @repo/database) can be imported directly:
import { auth } from '@repo/auth';
import { db } from '@repo/database';
import { Button } from '@repo/design-system';The project includes comprehensive testing infrastructure:
- Run all unit tests:
pnpm test - Tests are located in
__tests__directories alongside source code - Configuration via
@repo/testingpackage - Fast execution with Vitest's watch mode
- Run E2E tests:
pnpm e2e - Tests located in
e2e/tests/ - Multi-browser support (Chromium, Firefox, WebKit)
- Screenshots and traces saved in
e2e/test-results/ - HTML reports generated in
e2e/playwright-report/
Current E2E tests include:
- Sign-in flow validation
- Form validation and error handling
- User authentication scenarios
# Unit tests
pnpm test # Run all unit tests
# E2E tests
pnpm e2e # Run all E2E tests
pnpm e2e --ui # Run with Playwright UI
pnpm e2e --headed # Run in headed modeStart all local services at once:
pnpm services:startThis command starts the following Docker services defined in docker/docker-compose.yml:
- PostgreSQL (port 5432) - Primary database
- Umami (port 6005) - Self-hosted analytics platform
- GlitchTip (port 8005) - Open-source error tracking
- Valkey (port 6379) - Redis-compatible caching layer
- ntfy (port 8010) - Notification delivery service
- rustfs (ports 9000-9001) - S3-compatible file storage
Backup and restore PostgreSQL databases:
pnpm db:backup # Creates timestamped backup in docker/backups/
pnpm db:seed # Seeds database with sample dataThe docker/init-db.sql script automatically creates multiple databases on first startup.
-
Start Docker services
pnpm services:start
-
Run database migrations
pnpm db:push
-
Start development servers
pnpm dev
This will start:
- Main app on http://localhost:3005
- API on http://localhost:3006
- Storybook on http://localhost:6006
- Email preview on http://localhost:3009
- Database studio on http://localhost:3008
-
Code quality checks
pnpm check # Check for issues pnpm fix # Auto-fix issues
-
Run tests
pnpm test # Unit tests pnpm e2e # E2E tests
This project is licensed under the MIT License - see the LICENSE file for details.
Built with:
For issues and questions:
- GitHub Issues: sbrubbles-work/sbrubbles-forge/issues
- Email: sbrubbles@sbrubbles.work
Contributions, issues, and feature requests are welcome!
Built with β€οΈ using Next.js, Turborepo, and modern web technologies.