Here’s the updated README with PostgreSQL multi-schema support explicitly mentioned:
This starter kit streamlines the development of multi-tenant web applications using Laravel, React, Inertia.js, and Tailwind CSS. It provides authentication and multi-tenancy out of the box, leveraging the Tenancy for Laravel package with a PostgreSQL multi-schema setup for tenant database isolation.
✅ Multi-Tenancy (PostgreSQL Multi-Schema Setup) – Each tenant has its own isolated database schema for enhanced
security and scalability.
✅ Authentication Included – Pre-configured authentication system for tenants.
✅ Actions-Based Architecture – Business logic is encapsulated in action classes, ensuring clean and maintainable
controllers.
✅ Full-Stack SPA Experience – Powered by React & Inertia.js for smooth, client-server interactions.
✅ Modern UI – Styled with Tailwind CSS & Mantine UI for fast and responsive UI development.
✅ Scalable & Extensible – Easily add new features without breaking core functionality.
Technology | Description |
---|---|
React | Component-based UI library for dynamic interfaces. |
Inertia.js | Enables Laravel to serve SPAs without requiring an API. |
Laravel | Robust PHP framework with elegant syntax. |
Tailwind CSS | Utility-first CSS framework for responsive styling. |
Mantine UI | Pre-built React components for fast UI development. |
Tenancy for Laravel | Multi-tenancy package for Laravel, supporting multi-database architecture. |
PostgreSQL | Used for multi-schema tenant database separation. |
Follow these steps to set up the project locally:
git clone https://github.com/IsaacHatilima/multi-tenancy.git
cd multi-tenancy
composer install
npm install
Copy .env.example
to .env
and update your database credentials:
cp .env.example .env
php artisan migrate --seed
php artisan serve
npm run dev
Visit http://localhost:8000 to access the application.
All business logic is encapsulated in action classes, ensuring clean, single-responsibility controllers.
Combines Laravel's power with React's reactivity while keeping server-side routing and controller integration intuitive.
- Tailwind CSS: Utility-first styling approach for easy customization.
- Mantine UI: Pre-styled, accessible React components for seamless UI design.
This project uses PostgreSQL's multi-schema capability to isolate tenant data while maintaining a single database instance. The Tenancy for Laravel package:
- Automatically switches to the correct tenant schema based on the domain (e.g.,
ten1.app.com
). - Prevents unauthorized tenant access using middleware.
- Simplifies data management and backups while maintaining strong isolation.
🔹 Improve documentation with screenshots and a demo link.
🔹 Add testing strategies to ensure tenant isolation works as expected.
🔹 Consider adding optional API support for tenant-based API access.
This project is open-source and licensed under the MIT License.
Found a bug or have suggestions? Feel free to submit a PR or open an issue on GitHub.
📌 GitHub: IsaacHatilima