# Deploy on cPanel — no database

No phpMyAdmin, no MySQL. The app reads your `master_lookup.csv` to match
wallets and writes scans to a `submissions.csv`. Four steps.

## 1. Upload the app

In cPanel -> **File Manager** -> `public_html` (or a subfolder like
`public_html/scan` to run at `yoursite.com/scan`):

- Upload `wallet-system.zip` and **Extract** it, then move everything inside
  the `app/` folder so these sit directly in `public_html`:
  `index.php`, `sheet.php`, `config.php`, `lib.php`, `query.php`,
  the `api/` folder, the `assets/` folder, and the `data/` folder
  (which contains `master_lookup.csv` and a `.htaccess`).

## 2. Configure

Edit **`config.php`** (right-click -> Edit) and set:

- `sheet_passcode` — a passcode for managers to open the sheet.

That's the only required change. (Leave the file paths and hierarchy as-is.)

## 3. Make the data folder writable

The app creates `data/submissions.csv` on the first scan, so the `data` folder
must be writable. In File Manager, right-click the `data` folder ->
**Change Permissions** -> set to **755** (or **775** if 755 doesn't allow
writing on your host).

## 4. Turn on HTTPS, then test

The camera needs HTTPS. cPanel -> **SSL/TLS Status** -> run **AutoSSL** if the
domain isn't already secured.

- **Field staff:** share `https://yoursite.com/`. Pick the DH -> scan -> check
  the number -> type the serial -> save.
- **Managers:** open `https://yoursite.com/sheet.php`, enter the passcode, then
  view, filter, and **Download CSV**.

---

## Day-to-day

- **Update your lookup data:** just replace `data/master_lookup.csv` with a new
  file of the same columns. No import, no database. (Keep the column headers:
  `wallet_number, merchant_name, present_address, serving_channel, mdo_route,
  mdo_name, tmo_route, tmo_name, tmo_day, found_status`, with wallets as 11
  digits.)
- **All scans** accumulate in `data/submissions.csv`. Managers download them
  from the sheet. To start fresh, delete that file (it's recreated on the next
  scan).
- **Your data is protected:** the `data/.htaccess` blocks the browser from
  downloading the CSVs directly — only the passcode-gated sheet/export serve
  them.

## What it does

- Reads the printed number under the QR (in-browser OCR), manual entry as a
  fallback for any card that won't read.
- Normalizes the wallet to 11 digits and matches it in `master_lookup.csv`.
- Saves every scan — found and not found (not-found rows save with blank
  details and show as NOT FOUND).
- Blocks accidental duplicates from double-taps or retries.

## Boundary (so you're not surprised later)

CSV file storage is ideal for one territory. For the full national rollout
(hundreds of people scanning at once) file-locking becomes a bottleneck and
you'd move submissions to a database — SQLite first (still no phpMyAdmin), then
MySQL if needed. The scan app and matching logic stay the same; only where the
scans are stored changes.
