# Deploy ART Care (Stage 2)

This folder (`artcare/`) is a standalone Laravel app for the ART Services module, intended to be deployed on:

- `https://artcare.mam-app.org`

## Server / vhost

- Point the subdomain `artcare.mam-app.org` to `artcare/public`.
- Ensure PHP has write access to `artcare/storage` and `artcare/bootstrap/cache`.

## Environment

Copy `.env.example` → `.env` and set:

- `APP_URL=https://artcare.mam-app.org`
- `ART_DOMAIN=artcare.mam-app.org` (optional host lock)
- All DB connections used by ART Services (same as the main MAM app), especially:
  - `MAM_NAP`
  - `OfficeLab`
- Any clinic DB connections used by the patient search fallback (`searchID`)

## Migrations

- Run: `php artisan migrate` (required for admin roles: adds `users.role`)

## Auth (recommended)

If you want single sign-on across `mam-app.org` and `artcare.mam-app.org`:

- Use a shared session store (recommended: `SESSION_DRIVER=redis` or `database`) and same `SESSION_COOKIE`.
- Set `SESSION_DOMAIN=.mam-app.org` in both apps.
- Use the same `APP_KEY` in both apps (required for encrypted cookies).

If you don't need SSO, just keep a separate login for ART Care.

## Admin bootstrap

- Set `ADMIN_BOOTSTRAP_EMAIL` in `.env` to your email address to gain initial admin access.
- After running migrations (so `users.role` exists), set your user to `role=admin` and optionally clear `ADMIN_BOOTSTRAP_EMAIL`.
