# MediBook AI — Installation

This is a complete, runnable Laravel 12 application (not an overlay). It
includes the full framework skeleton: `composer.json`, `composer.lock`,
`artisan`, `bootstrap/`, `public/index.php`, `storage/`, `phpunit.xml`, etc.

## Requirements
- PHP 8.3 with extensions: `pdo`, `mbstring`, `openssl`, `tokenizer`, `xml`,
  `ctype`, `json`, `bcmath`, `curl`, `gd`, `intl`, `fileinfo`, and a DB driver
  (`pdo_mysql` for production, `pdo_sqlite` for quick local runs).
- MySQL 8 (production) or SQLite (evaluation).
- A queue worker + scheduler for WhatsApp/billing automation (see DEPLOYMENT.md).

## Option A — this package already includes `vendor/` (runs immediately)
```
cp .env.example .env
php artisan key:generate
# edit .env: DB_*, MEDIBOOK_CENTRAL_DOMAIN, MAIL_*, WHATSAPP_*, PADDLE_*
php artisan migrate --force
php artisan db:seed --class=RoleSeeder
php artisan db:seed --class=PlanSeeder
php artisan storage:link
php artisan serve   # or point a web server at public/
```
First super-admin (tinker): create a `User` with `tenant_id = null`, then
`$user->assignRole('super_admin')`. Optional demo data: `php artisan medibook:demo`.

## Option B — fetch dependencies yourself (standard Laravel flow)
If you received the source-only package (no `vendor/`), or want to refresh
dependencies on a networked machine:
```
composer install            # reads composer.lock
# then the same steps as Option A
```
`composer install` requires access to packagist.org and github.com.

## Notes on the bundled dependencies
`vendor/` was assembled and verified offline (Laravel 12.0.0, Fortify 1.25.4,
spatie/laravel-permission 6.16.0, mPDF 8.2.5, and their dependency tree).
The full migration suite (30 migrations), seeders, route registration (115
routes), and a functional smoke test (tenancy, phone normalization, soft usage
limits, subscription lifecycle) all pass against this set. On a networked
server you may instead run `composer install` / `composer update` to pull the
same versions from Packagist and regenerate the optimized autoloader.

The Spatie permission tables migration and `config/permission.php`, plus
`config/fortify.php`, are already published into the project.
