This guide walks you through getting a fully functional local instance of XHealtXperience running from scratch. By the end you will have the central database seeded with a Super Admin account, the dev server running all required processes concurrently, and a browser pointed at the Super Admin panel.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, make sure the following tools are installed on your machine:- PHP 8.2 or higher — required by Laravel 12 (
composer.jsondeclares"php": "^8.2") - Composer — PHP dependency manager
- Node.js 18+ and npm — for the React/Vite frontend
- SQLite (default) or MySQL 8 — SQLite is enabled out of the box via the
.env.example; no extra database server is needed for local development
git clone https://github.com/Arthurr23/XHealtXperience.git
cd XHealtXperience
composer install
npm install
The
composer install step will auto-discover all Laravel packages (including stancl/tenancy, spatie/laravel-permission, and pragmarx/google2fa-laravel).The default
.env.example is pre-configured for SQLite with a database-backed queue and session driver — no additional changes are required to get the platform running locally.# .env defaults that matter most for local dev
APP_URL=http://localhost
DB_CONNECTION=sqlite # Central database (auto-created at database/database.sqlite)
SESSION_DRIVER=database
QUEUE_CONNECTION=database # Queue worker is required — see Step 6
Tenant databases are stored as separate SQLite files (e.g.
database/tenant{uuid}.sqlite) and are created automatically by stancl/tenancy when a new clinic is provisioned through the Super Admin panel.This sets up the central tables:
users, tenants, domains, sessions, jobs, cache, and the Spatie Permission tables for the central guard.Apply the tenant-specific schema to any tenant databases that may already exist, and confirm the tenant migration path is correctly registered:
For a fresh install with no tenants yet, this command exits cleanly. It will be useful after you create your first clinic from the Super Admin panel.
Super Admin role in the central database.DatabaseSeeder.php:Change these credentials before any production or staging deployment. The default password is committed to the repository and is publicly known. Update
DatabaseSeeder.php or override the values directly in the database after seeding.To seed roles inside a specific tenant clinic (after creating one via the Super Admin panel), run:
This executes
RoleSeeder inside the tenant’s database, creating all tenant roles: Administrador Clinica, Administrador Profesionista, Doctor, Recepcion, Enfermero, Paciente, Auditor, and Practicante Externo.The
composer run dev script uses Concurrently to launch all four required processes in a single terminal session with colour-coded output:[server] php artisan serve → HTTP server on http://127.0.0.1:8000
[queue] php artisan queue:listen --tries=1 --timeout=0 → Processes async jobs (tenant provisioning, etc.)
[logs] php artisan pail --timeout=0 → Live log tail in the terminal
[vite] npm run dev → Vite HMR on http://127.0.0.1:5173
The queue worker (
[queue]) is not optional. Tenant database creation and other background tasks are dispatched to the queue. Without an active worker, provisioning a new clinic from the Super Admin panel will silently stall.Log in with the seeded credentials (
superadmin@xhealthxperience.com / SuperAdmin2024!). Because 2FA is mandatory, you will be redirected to the 2FA setup screen on your first login. Complete the setup using an authenticator app (TOTP) or e-mail OTP, then proceed to the dashboard:From here you can create your first clinic, which will automatically provision a new tenant database, apply tenant migrations, and make the clinic accessible at:
Available Composer Scripts
The following scripts are defined incomposer.json:
| Script | What it does |
|---|---|
composer run setup | Full first-time setup: install deps, copy .env, generate key, migrate, build assets |
composer run dev | Start all dev processes concurrently (serve, queue, pail, vite) |
composer run test | Clear config cache and run the PHPUnit test suite |
Next Steps
Once the platform is running locally, explore these topics:- Architecture — Understand the two-database model and middleware pipeline
- Roles & Permissions — Learn what each role can access
- Patient Management — Start working with patient records