XHealtXperience is a production-ready, multi-tenant clinic management platform designed for healthcare organisations that operate one or more independent clinics under a single deployment. Each clinic (tenant) is completely isolated in its own dedicated database, ensuring that patient records, staff accounts, appointments, and audit logs from one clinic can never be accessed by another. The platform is built on Laravel 12 (PHP 8.2+), React 18 with Inertia.js 2, and Tailwind CSS 3, and it ships with mandatory two-factor authentication (TOTP or e-mail OTP) for every user on the system.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Arthurr23/XHealtXperience/llms.txt
Use this file to discover all available pages before exploring further.
Quickstart
Clone the repo, run migrations, seed roles, and have the platform running locally in minutes.
Architecture
Learn how the two-database model, path-based tenancy, and middleware pipeline work together.
Roles & Permissions
Explore every role, what it can do, and how Spatie Laravel Permission enforces access.
Patient Management
Manage patient records, clinical files, uploaded IDs, digital signatures, and service tracking.
What is XHealtXperience?
At its core, XHealtXperience solves the problem of running multiple clinics from a single codebase without ever mixing their data. A central Super Admin creates and manages clinic accounts (tenants). The moment a clinic is provisioned, the platform automatically creates a fresh SQLite (or MySQL) database for it, runs the tenant-specific migrations, and seeds the required roles. From that point on, every HTTP request routed through that clinic’s URL prefix (/{tenantId}/...) operates entirely inside that clinic’s database context.
The platform uses stancl/tenancy v3 with path-based identification (
InitializeTenancyByPath). There is no subdomain DNS configuration required for local development — the tenant ID is simply the first path segment of every tenant URL.Key Concepts
Multi-Tenancy: One Database per Clinic
Every tenant clinic gets its own isolated database. The central database stores only the tenants registry, domain mappings, and the Super Admin account. All clinical data — patients, users, appointments, audit logs — lives exclusively in the tenant database. Databases follow the naming conventiontenant{uuid}.sqlite (SQLite) or tenant{uuid} (MySQL).
Subscription Plans & Account Limits
When a Super Admin creates a clinic, they assign a subscription plan. Each plan sets a default maximum number of staff accounts that clinic can create:| Plan | Default Account Limit |
|---|---|
basico | 5 |
pro | 20 |
premium | 50 |
personalizado | Adjustable manually |
Mandatory Two-Factor Authentication
2FA is not optional. Every user — from the Super Admin down to a receptionist — must complete 2FA setup before accessing any protected dashboard. The platform supports:- TOTP (Time-based One-Time Password) via an authenticator app, powered by
pragmarx/google2fa-laraveland QR code generation withendroid/qr-code. - E-mail OTP as an alternative method.
Role-Based Access Control
Permissions are enforced through Spatie Laravel Permission v7. Roles exist at the tenant level (inside each clinic’s database), with the sole exception ofSuper Admin, which lives in the central database.
The roles available in a tenant clinic are:
| Role | Scope |
|---|---|
| Super Admin | Central only — manages all clinics and tenant accounts |
| Administrador Clinica | Full clinic administration: users, services, settings |
| Administrador Profesionista | Professional administrator with delegated clinic management |
| Doctor | Patient care, appointments, surgery scheduling, schedule blocks |
| Recepcion | Appointment booking, patient check-in, surgery confirmation |
| Enfermero | Clinical support, service stage execution |
| Auditor | Read-only access to the audit log and auditor dashboard |
| Paciente | Patient-facing access to their own data |
| Practicante Externo | External trainee with limited clinic access |
All nine roles above are created by
RoleSeeder, which runs automatically during tenant setup via php artisan tenants:seed. The Super Admin role is created separately in the central database by DatabaseSeeder.Tech Stack
| Layer | Technology |
|---|---|
| Backend | Laravel 12, PHP 8.2+ |
| Frontend | React 18, Inertia.js 2, Tailwind CSS 3 |
| Build Tool | Vite 7 (laravel-vite-plugin, @vitejs/plugin-react) |
| Multi-Tenancy | stancl/tenancy 3.10 |
| Permissions | Spatie Laravel Permission 7.2 |
| 2FA | pragmarx/google2fa-laravel 3, endroid/qr-code 6 |
| Auth Bridge | Laravel Sanctum 4, Tightenco Ziggy 2 |
| Dev Tools | Laravel Pail, Laravel Pint, Laravel Sail, Concurrently |
Central vs. Tenant Routing at a Glance
| Route Prefix | Database | Who Accesses It |
|---|---|---|
/panel-global/* | Central | Super Admin only |
/login, / | Central | All unauthenticated users |
/{tenantId}/* | Tenant DB | Clinic staff and patients |