hsa-app/README.md

36 lines
1.9 KiB
Markdown
Raw Normal View History

# HSA Receipt Tracker
A small, mobile-first web app for two household users to capture and archive
HSA-eligible receipts (photo or PDF) for future reimbursement and tax
substantiation, with optional AI auto-fill of the amount/date/category/patient.
- **What it does (current behavior):** [SPEC.md](SPEC.md) — the source of truth.
- **Why it's built this way (history & rationale):** [DESIGN.md](DESIGN.md).
- **Version log:** [CHANGELOG.md](CHANGELOG.md).
## Running
It's a single static Go binary (`CGO_ENABLED=0`, pure-Go SQLite). Configure via
environment (see [.env.example](.env.example)); `./scripts/build.sh` builds it and
`./scripts/run.sh` runs it locally. Deployment notes: [deploy/INSTALL.md](deploy/INSTALL.md).
## AI classifier correction notes
When an API key is configured, each upload is read by the model to pre-fill the
form. You can steer it with **correction notes** — free-text rules appended to the
classifier prompt — managed under the **AI** tab. When the model misreads a
receipt, that upload is recorded; the AI tab lets you review misreads one by one
and attribute which note fixed each.
Notes live only in the database (private, never committed, included in `/export/db`
backups). On first run the table is seeded once with these **default notes** (no
PII), which you can edit or delete:
1. Amounts that use a comma as the decimal separator (e.g. "12,50") mean 12.50, not 1250.
2. When both a service/visit date and a separate statement, print, or due date appear, use the service date.
3. "Patient Pay", "You Paid", "Amount Due", and "Patient Responsibility" are the amount actually paid — prefer them over subtotals or insurance-covered amounts.
These defaults are defined in code (`internal/storage/ai_notes.go`); this list is
the human-readable copy. They are only seeded when the notes table is empty, so a
deleted default does not come back on restart.