A production-ready Next.js 15 boilerplate with authentication, multi-tenancy, RBAC, and internationalization.
- Authentication - NextAuth v5 with credentials provider
- Multi-tenancy - Complete tenant isolation with slug-based identification
- RBAC - Role-based access control with CASL permissions
- i18n - Internationalization support (English, Vietnamese, French)
- API Routes - Hono for fast, type-safe API endpoints
- Database - PostgreSQL with Drizzle ORM
- UI - shadcn/ui components with Tailwind CSS
- Code Quality - Biome for linting and formatting
-
Install dependencies
bun install
-
Set up environment variables
cp .env.example .env # Edit .env and add your DATABASE_URL and AUTH_SECRET -
Push database schema
bunx drizzle-kit push
-
Run development server
bun --bun dev
bun dev # Start development server
bun build # Build for production
bun start # Start production server
bun lint # Lint code with Biome
bun format # Format code with Biome-
Build the image
docker build -t nextjs-saas . -
Run the container
docker run -p 3000:3000 \ -e DATABASE_URL="your_database_url" \ -e AUTH_SECRET="your_auth_secret" \ nextjs-saas
Create a docker-compose.yml:
services:
app:
build: .
ports:
- "3000:3000"
environment:
- DATABASE_URL=${DATABASE_URL}
- AUTH_SECRET=${AUTH_SECRET}
depends_on:
- db
db:
image: postgres:16
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=myapp
volumes:
- postgres_data:/var/lib/postgresql/data
volumes:
postgres_data:Then run:
docker-compose up- Framework: Next.js 15 with App Router
- Auth: Better Auth
- Database: PostgreSQL + Drizzle ORM
- API: Hono
- UI: shadcn/ui + Tailwind CSS v4
- Permissions: CASL
- Code Quality: Biome