# JARO Ops — local development

Run the whole platform on your Mac, test changes instantly, and only upload to
Bluehost once things work.

## One-time setup

1. **Install PHP** (macOS no longer ships it):
   ```
   brew install php
   ```

2. **Create your local secrets file** (never uploaded, gitignored):
   ```
   cp private/airtable-config.php.example private/airtable-config.php
   ```
   Fill in `AIRTABLE_TOKEN` and `ANTHROPIC_API_KEY` (same values as the server's
   `/home4/msstoda1/private/airtable-config.php` — view it in cPanel).

3. **Make a DEV copy of the Airtable base** (strongly recommended):
   in Airtable, open the JCR-Operations base menu → **Duplicate base**
   (with records). Put the new base's id (`app…` from its URL) in
   `private/airtable-config.php` as `AIRTABLE_BASE_ID`. Local testing then
   can't touch live estimates. Skip this only if you're comfortable working
   against production data.

## Every day

```
./dev.sh
```
Open **http://localhost:8080/ops/** — log in as `Staff` with the
`ESTIMATING_PASSWORD` from your local secrets file.

Edit files, refresh the browser: changes are live immediately. PHP errors print
in the terminal and in the browser (display_errors is on locally).

## Deploying

Same as always — upload the changed files via cPanel. `git status` /
`git diff` show exactly which files changed since your last commit, so the
upload list writes itself:

```
git add -A && git commit -m "what changed"    # after each deployed batch
git status                                     # what's changed since
```

## Notes

- The `private/` folder and `ops/uploads/` must never be uploaded.
- Production reads its secrets from the Bluehost path automatically — the
  local `private/` folder simply doesn't exist there, so nothing changes.
- `mail()` doesn't send from the local server (client-response notification
  emails silently skip — everything else works).
