Introduction
SaaS4Builders is a production-ready, multi-tenant SaaS boilerplate built with Laravel 13 and Nuxt 4. It gives you authentication, billing, teams, usage tracking, and internationalization out of the box — so you can focus on your product logic instead of rebuilding infrastructure.
This is not a starter kit with a login page and a TODO list. It is a complete, opinionated foundation for subscription-based SaaS applications, with Stripe integration, single-database multi-tenancy, role-based access control, and a full Docker development environment.
You bought it to ship faster. This documentation shows you how.
The Problem
Building a SaaS from scratch is repetitive, slow, and error-prone. You spend weeks on authentication, billing integration, tenant isolation, and team management before writing a single line of product code.
Most existing boilerplates fall short:
- Too closed — products like Laravel Spark or Paddle Billing lock you into their opinions with limited extensibility.
- Too product-specific — tools like ShipFast or Supastarter are optimized for a single use case.
- Incompatible stacks — few boilerplates combine a Laravel API backend with a modern Nuxt frontend.
SaaS4Builders fills this gap: a full-stack, modular boilerplate with built-in AI agent support that eliminates setup friction while staying fully extensible.
Feature Overview
Authentication and Authorization
Sanctum-based token authentication with access and refresh tokens. OAuth login via Google and GitHub through Laravel Socialite. Role-based access control powered by Spatie Laravel Permission, with a full permission hierarchy across platform admins and tenant-scoped roles (owner, admin, member). Impersonation support for platform administrators.
Multi-Tenancy
Single-database multi-tenancy with automatic tenant_id scoping via a global Eloquent scope. A BelongsToTenant trait on models enforces data isolation. Tenant resolution happens through middleware based on the authenticated user. No data leaks — and tests verify it.
Billing and Subscriptions
Full Stripe integration supporting three pricing models:
- Flat-rate — fixed monthly or yearly price
- Seat-based — price per team member
- Usage-based — metered billing tied to usage events
Includes Stripe Checkout, subscription lifecycle management (trialing, active, past_due, canceled), invoice sync via webhooks, optional Stripe Tax, and multi-currency support. The boilerplate ships with EUR, USD, GBP, and CHF pre-configured, but you can add any currency supported by Stripe. The SaaS application is the seller of record — Stripe handles payment processing.
Teams
Invite team members by email with token-based invitations. Assign roles: owner, admin, or member — each with a distinct permission set. Create custom roles per tenant. Transfer ownership. Seat-based billing enforces team size limits automatically.
Usage Tracking
Record usage events against named meters (e.g., api_calls). Enforce quotas through entitlements tied to plan features. Track consumption over time for metered billing and analytics.
Internationalization
Ships with four locales out of the box: English, French, Spanish, and Italian. You can add, replace, or remove locales — the i18n system is fully extensible. Backend translations use Laravel's lang/ short-key files organized by domain. Frontend translations use Nuxt i18n with JSON locale files. Model translations (product names, plan descriptions) use astrotomic/laravel-translatable.
Developer Experience
A complete Docker development environment with nine services, a Makefile with 30+ commands, PHPStan at level 9, ESLint in strict mode, PHPUnit for backend tests, and Vitest for frontend tests. CI-ready with GitHub Actions.
Notifications
Web push notifications via VAPID keys, with a service worker for browser delivery. Real-time broadcasting through Laravel Reverb (WebSocket) for instant in-app updates. Backend dispatches notifications; the frontend handles permission requests, display, and live event listening.
Who Is It For
- Freelance developers building SaaS products who need a reusable, professional-grade skeleton.
- Web agencies delivering repeatable client projects on a consistent technical foundation.
- Indie hackers who want to launch an MVP in days, not months.
- Internal dev teams building tools and platforms on a proven stack.
The boilerplate assumes you are proficient with Laravel and Nuxt. It is not a tutorial — it is a foundation for professionals.
Tech Stack
| Layer | Technology | Version |
|---|---|---|
| Backend framework | Laravel | 12 |
| PHP | PHP | 8.3+ |
| Frontend framework | Nuxt | 4 |
| Language | TypeScript | Strict mode |
| State management | Pinia | Composition API |
| Validation | Zod | Runtime schema validation |
| UI components | Nuxt UI | TailwindCSS v4 |
| Database | PostgreSQL | 16 |
| Cache / Queue / Sessions | Redis | 7 |
| Containerization | Docker Compose | Multi-service setup |
| Authentication | Laravel Sanctum | v4 |
| Authorization | Spatie Laravel Permission | Role + permission based |
| Billing | Stripe | Checkout, webhooks, invoicing |
| OAuth | Laravel Socialite | Google, GitHub |
| Backend analysis | PHPStan (Larastan) | Level 9 |
| Backend formatting | Laravel Pint | PSR-12 |
| Backend tests | PHPUnit | v12 |
| Frontend linting | ESLint | Strict |
| Frontend tests | Vitest | Component + composable tests |
Architecture at a Glance
Backend: DDD-Inspired Layers
The Laravel backend follows a domain-driven directory structure with four layers:
backend/app/
├── Domain/ # Pure business logic: Enums, ValueObjects, Contracts, Rules
├── Application/ # Use cases: Actions (mutations), Queries (reads), Input DTOs
├── Infrastructure/ # External integrations: Stripe provider, mappers
├── Http/ # API surface: Controllers, FormRequests, Resources
├── Models/ # Eloquent models
├── Policies/ # Authorization policies
├── Support/ # Cross-cutting helpers and traits
└── ... # Providers, Jobs, Mail, Events, etc.
Every request follows a predictable flow:
HTTP Request → FormRequest (validate + toDto()) → Action or Query → Eloquent Model → Resource → JSON Response
Controllers are thin — they delegate to Actions (for mutations) or Queries (for reads). Business logic lives in the Domain and Application layers, never in controllers.
Frontend: Vertical Slices
The Nuxt frontend organizes code by feature, not by file type:
frontend/
├── common/ # Shared UI components and utilities
└── features/
├── foundation/ # Auth, tenancy, layout — framework-level features
├── core/ # Billing, teams, settings — business features
└── product/ # Your custom product features go here
Each feature module contains its own types, schemas, API client, composables, components, stores, and pages. This vertical slice architecture keeps related code together and makes features independently understandable.
API Contracts
The API follows strict conventions enforced across the codebase:
- All JSON keys use snake_case
- Dates use ISO-8601 format
- Money values use amount_cents (integer) + currency (string)
- Endpoints are versioned under
/api/v1/ - Authentication uses Bearer tokens (Sanctum)
- Error responses follow a consistent
{ message, code, errors }structure
Backend Resources are the source of truth for response shapes. Frontend Zod schemas provide runtime validation of API responses.
The contract system ensures that backend and frontend stay in sync. When you add a new endpoint, the flow is always: define a Laravel Resource (snake_case output) → create a Zod schema (camelCase, auto-transformed) → derive TypeScript types with z.infer → build the API client composable → consume in components.
AI-First Developer Experience
SaaS4Builders is designed to work with AI coding agents. The codebase includes structured context that helps tools like Claude Code understand and extend the project:
- CLAUDE.md files — Always-loaded context at the project root and in
backend/that describes architecture, conventions, and commands. - Skills system — On-demand context files in
.claude/skills/for specific domains (billing, frontend, multi-tenancy). Skills are loaded when relevant, keeping the AI's context lean. - Workplans — Structured feature specifications that AI agents can follow step by step, with objectives, file lists, and acceptance criteria.
- Convention files —
CONTRACTS.md,TEMPLATES.md, andDOMAIN-GLOSSARY.mdprovide the rules that keep AI-generated code consistent with the project's architecture.
This means you can use Claude Code (or similar agents) to add features, fix bugs, and extend the boilerplate — and the AI will follow the same conventions a human developer would.
What's Included
Here is a summary of everything you get with SaaS4Builders:
| Category | What You Get |
|---|---|
| Backend | Laravel 13 API with DDD-inspired architecture, PHPStan level 9, Pint formatting, PHPUnit tests |
| Frontend | Nuxt 4 app with TypeScript, Pinia stores, Zod validation, Nuxt UI components, Vitest tests |
| Authentication | Sanctum SPA auth, access + refresh tokens, OAuth (Google, GitHub), impersonation |
| Authorization | Spatie roles and permissions, tenant-scoped and platform-level roles |
| Billing | Stripe Checkout, flat/seat/usage pricing, subscription lifecycle, invoices, webhooks, multi-currency |
| Multi-tenancy | Single-DB isolation with global scopes, middleware resolution, tenant-aware models |
| Teams | Invitations, role assignment, custom roles, ownership transfer, seat quota enforcement |
| Usage tracking | Named meters, usage events, quota entitlements, billing reconciliation |
| Settings | Three-level cascade (platform → tenant → user), cached resolution |
| Notifications | Web push via VAPID, service worker, backend dispatch |
| i18n | 4 locales (EN/FR/ES/IT), backend lang files, frontend JSON, model translations |
| Content | Nuxt Content v3 integration, Nuxt Studio visual editor support |
| DevOps | Docker Compose (9 services), Makefile (30+ commands), GitHub Actions CI |
| AI DX | CLAUDE.md context files, skills system, workplan templates, convention documents |
What's Next
You are ready to set up SaaS4Builders on your machine:
- Installation — Extract the archive, install dependencies, and start the stack.
- Docker Setup — Understand the services, ports, and volumes.
- Environment Configuration — Configure database, Stripe, mail, and more.
- Running the Demo — Explore the seeded demo data and walk through the application.
- Deployment Guide — Go to production with confidence.
SaaS4Builders Documentation
Complete documentation for the SaaS4Builders boilerplate — a production-ready Laravel 13 + Nuxt 4 multi-tenant SaaS starter with Stripe billing, team management, and AI-first developer experience.
Installation
Set up SaaS4Builders locally in under 5 minutes with Docker and a single make command.