XHealtXperience is a multi-tenant healthcare clinic management platform built with Laravel 12 and React 18. This guide walks you through every step required to get the full stack — PHP backend, Inertia/React frontend, queue worker, and log viewer — running locally from a fresh clone.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.
Prerequisites
Before you begin, ensure the following tools are installed and available in yourPATH:
| Tool | Minimum version | Notes |
|---|---|---|
| PHP | 8.2+ | Required by composer.json |
| Composer | 2.x | PHP dependency manager |
| Node.js | 18+ | Required by Vite 7 |
| npm | 9+ | Bundled with Node.js |
| SQLite | 3.x | Default database driver (no server needed) |
| MySQL | 8.0+ | Optional — swap in .env if preferred |
Setup Steps
Install all Composer packages, including Laravel 12, stancl/tenancy, spatie/laravel-permission, and the dev toolchain (PHPUnit, Pail, Sail, Pint).
The
.env.example file contains safe defaults for local development. Copy it and generate a unique APP_KEY:The default driver is SQLite, which requires no running server. Open
.env and confirm (or adjust) the following values:# SQLite (default — no server needed)
DB_CONNECTION=sqlite
# The database file is created automatically at database/database.sqlite
# MySQL alternative — uncomment and fill in your credentials
# DB_CONNECTION=mysql
# DB_HOST=127.0.0.1
# DB_PORT=3306
# DB_DATABASE=xhealthxperience
# DB_USERNAME=root
# DB_PASSWORD=
This creates the central schema: users, tenants, domains, jobs, cache, permissions, personal access tokens, 2FA columns, and more. See Database Migrations for the full schema inventory.
The
DatabaseSeeder creates one central Super Admin role and one superadmin user account. This account logs in at the central URL (/login), not at any tenant’s subdomain.The seed creates a default superadmin with the email
superadmin@xhealthxperience.com and the password SuperAdmin2024!. Change both before deploying to production.serverphp artisan servequeuephp artisan queue:listen --tries=1 --timeout=0logsphp artisan pail --timeout=0vitenpm run devThe application will be available at http://127.0.0.1:8000.
One-shot setup script
composer.json also ships a setup script that chains all bootstrap steps in one command:
composer run setup for CI pre-flight checks or when onboarding a new team member who wants to get to a built state quickly. For day-to-day development, prefer composer run dev (which starts the Vite dev server instead of a production build).
Environment variables reference
All variables below come directly from.env.example. Copy them into your .env and adjust as needed.
Human-readable name of the application. Surfaced in emails (
MAIL_FROM_NAME) and the Vite build (VITE_APP_NAME). Change to something like "Clínica".The root URL of the central (non-tenant) application. The tenancy package also uses this to determine central domains. Must match the host used by
php artisan serve.Database driver. Accepted values:
sqlite, mysql, pgsql. Defaults to sqlite for zero-config local development.Where PHP sessions are stored. The
.env.example default is database (stored in the sessions table). In tests, phpunit.xml overrides this to array.Queue backend.
database uses the jobs table created by migrations. Change to redis or sync as needed.Mail transport used in local development.
log writes all outgoing mail to the Laravel log — no SMTP server is needed. Change to smtp for real delivery.SMTP host. Only relevant when
MAIL_MAILER is smtp.SMTP port. The default
2525 is compatible with local tools like Mailpit/Mailtrap.The
From: address on all outgoing mail. Set to a real clinic address in production.Queue worker requirement
Several features dispatch queued jobs. Thecomposer run dev script starts a queue worker automatically, but if you run processes separately you must keep this command alive in its own terminal:
--tries=1means a failing job is marked as failed immediately rather than retried, which keeps local logs clean.--timeout=0disables the per-job time limit, which prevents long-running tenant operations from being killed mid-flight.
GitHub Codespaces support
The repository ships a
.env_CODESPACES file with pre-configured values for running inside GitHub Codespaces. It sets APP_URL and VITE_URL to the dynamic Codespace hostname, configures SESSION_DRIVER=cookie with SESSION_SECURE_COOKIE=true and SESSION_SAME_SITE=none (required for cross-origin cookie auth), and adds SANCTUM_STATEFUL_DOMAINS and TRUSTED_PROXIES="*". To use it in a Codespace, copy it over the standard env file: cp .env_CODESPACES .env.