# Running the current HMS foundation

**Current status:** Controllers, Blade screens, prototype migrations and application-level authentication have been committed. The baseline Laravel framework is intentionally scaffolded locally using Composer; this has not been executed or tested in CI yet.

## First-time installation

```bash
git clone https://github.com/mayembem34/hms-prototype.git
cd hms-prototype
bash scripts/bootstrap.sh
```

Create an empty local MySQL database, then edit `.env` for the database host, name, username and password.

```bash
php artisan migrate
php artisan hms:create-admin
php artisan serve
```

Visit http://127.0.0.1:8000 and click **Staff sign in**.

After login:
1. Visit **Organizations** and create a synthetic organization.
2. Return to **Dashboard** and select that organization using the selector.
3. Open **Facilities** to create a facility.
4. Open **Patients** to register synthetic patients and inspect their profiles.

## Testing

```bash
php artisan test --filter=HmsTenantIsolationTest
```

These tests must pass before considering tenant scoping operationally verified. The application has **not been run or deployed by the assistant**.

## Known incomplete areas

- Full Laravel scaffold still needs generating and committing.
- Multi-tenant database-per-tenant configuration is not implemented; the current schema uses organization-scoped tables.
- There is no staff invitation, user management, MFA, audit log, clinic-specific privileges or fully hardened authorization engine yet.
- Patients are create/list/view only; updates, duplicates, appointments and clinical workflows are forthcoming.
- Login uses Laravel sessions; do not expose this prototype to real healthcare data.
- UI uses the Bootstrap CDN. For stricter deployment policies, compile and serve dependencies locally.
