Skip to main content
The SaaS Starter Vue project follows Laravel and Vue.js best practices with a clear separation between system-level (multi-tenant management) and tenant-level (individual customer) functionality.

Root Directory

Backend Structure (app/)

The Laravel backend is organized into logical namespaces that separate system and tenant concerns:

Key Directories

Custom action classes for specific business logic.
These handle authentication flows like user registration and password resets.
Controllers organized by domain (System vs Tenant).
Eloquent models split by system and tenant databases.
Important: System models connect to the central database, while Tenant models live in isolated tenant databases.
Business logic and complex operations.

Example: System Model

The Tenant model demonstrates the multi-tenant architecture:
app/Models/System/Tenant.php

Frontend Structure (resources/js/)

The Vue.js frontend follows a component-based architecture with Inertia.js for server-side routing:

Application Entry Point

resources/js/app.ts

Routes Structure

The application uses multiple route files to organize different domains:
Main system routes (central domain):
routes/web.php

Database Structure

The project uses a multi-database architecture:
Multi-Tenancy Pattern: Each tenant gets their own isolated database. Central database stores tenant metadata, while tenant databases store customer-specific data.

Configuration Files

Key configuration files in the config/ directory:

Key Files

composer.json

Defines PHP dependencies including Laravel 12, Inertia.js, Fortify, and Tenancy packages.

package.json

Frontend dependencies: Vue 3, Vite, Tailwind CSS 4, TypeScript, and UI libraries.

vite.config.ts

Vite build configuration with Vue, Tailwind, and Wayfinder plugins for type-safe routing.

tsconfig.json

TypeScript compiler configuration with path aliases and strict type checking.

Multi-Tenant Architecture

The project implements a database-per-tenant strategy:
  1. Central Database: Stores system users, tenants, plans, and subscriptions
  2. Tenant Databases: Isolated databases for each customer with their own users and data
  3. Domain-Based Routing: Tenants access via subdomains (e.g., customer.yoursaas.com)

Next Steps

Frontend Development

Learn about Vue 3, Inertia.js, and component development

Backend Development

Explore Laravel architecture, services, and multi-tenancy

Testing

Understand the testing strategy and running tests