# WashHouse Production Deploy Notes

This checklist is for uploading the updated code to the live site without leaking local settings or breaking the production routes.

## Keep these routes unchanged

- `/manage/index.php`
- `/pages/*`
- `/m/*`
- `/pickup/*`
- `/faq.php`
- `/index.php`

## Before upload

1. Back up the live files and database.
2. Run the production preflight check:

```powershell
powershell -ExecutionPolicy Bypass -File .\scripts\preflight-production.ps1
```

3. Make sure these local-only files are **not** uploaded:

- `config/database.local.php`
- `config/mobile_access.local.php`
- anything under `temp\`
- `sms_error.log`

## Recommended production environment variables

The code now supports overriding secrets and deployment-sensitive values with environment variables.

- `WASHHOUSE_DB_HOST`
- `WASHHOUSE_DB_NAME`
- `WASHHOUSE_DB_USER`
- `WASHHOUSE_DB_PASS`
- `WASHHOUSE_DB_CHARSET`
- `WASHHOUSE_SMS_USER_ID`
- `WASHHOUSE_SMS_API_KEY`
- `WASHHOUSE_SMS_SENDER_ID`
- `WASHHOUSE_SUPPORT_PHONE`
- `WASHHOUSE_INVOICE_BASE_URL`
- `WASHHOUSE_M_PASSWORD`
- `WASHHOUSE_GOOGLE_MAPS_KEY`

## Mobile access

- `/m/.pw_config.php` now supports `WASHHOUSE_M_PASSWORD`
- local or staging can use `config/mobile_access.local.php`
- production should prefer the environment variable and avoid storing the password in a file

## Pickup flow

- `/pickup/pickup_req.php` now accepts a Google Maps key from `WASHHOUSE_GOOGLE_MAPS_KEY`
- if the variable is not set, the current fallback key is still used so the live site does not break

## Upload order

1. Upload PHP/CSS/JS/template changes first.
2. Confirm `/`, `/faq.php`, `/pickup/pickup_req.php`, `/m/`, `/manage/index.php`, and `/pages/dashboard.php` load.
3. Test one pickup request, one mobile login, one ready-SMS action, and one payment action.
4. Only then remove any old backup files if needed.

## Rollback

If anything looks wrong:

1. Restore the backed-up files for the changed routes.
2. Restore the database only if you also deployed schema changes.
3. Re-check environment variables before trying again.
