Update wiki with OCR, barcode, auto-checkin fixes (May 2026)

2026-05-20 15:35:19 -04:00
parent b50ffe316c
commit 9fd1bd8b69
+54
@@ -0,0 +1,54 @@
# Canteen Asset Tracker
Mobile-first web app for tracking physical assets via barcode scanning, OCR sticker reading, and GPS check-ins.
## Quick Links
- **URL:** https://canteen.ourpad.casa
- **Source:** ~/projects/canteen-asset-tracker/
- **Start:** `./start.sh`
- **Repo:** https://gitea.ourpad.casa/shawn/canteen-asset-tracker
## Default Login
- Username: `admin`
- Password: `Brett85!@`
## Recent Changes (May 2026)
### OCR Fix
Extracts only the last 5 digits from Connect ID stickers.
- Before: `POST /api/ocr``05912-095330`
- After: `POST /api/ocr``95330`
- Added `raw_match` field to response for debugging
### Barcode Scanner Fix
- Switched from `decodeFromVideoElement` to `decodeFromVideoDevice`
- 1D-only format hints (Code 128, Code 39, EAN/UPC, ITF, Codabar)
- Added `TRY_HARDER` hint for better low-light/angle detection
- 50ms scan interval (was ~500ms default)
- **Fixed:** `listVideoInputDevices()` — called on reader instance (not static), with try/catch fallback to default camera
### Auto Check-in on Creation
New assets automatically check in with GPS coordinates on creation via all three entry modes (barcode, OCR, manual). Best-effort — silently skips if GPS is not available yet.
## API
| Endpoint | Method | Description |
|----------|--------|-------------|
| `/api/auth/login` | POST | Login, returns Bearer token |
| `/api/assets` | CRUD | Asset management |
| `/api/assets/search?machine_id=` | GET | Lookup by machine ID |
| `/api/checkins` | POST/GET | GPS check-ins |
| `/api/ocr` | POST | Extract machine_id from sticker image |
| `/api/export/assets` | GET | CSV export |
## Environment
| Variable | Default |
|----------|---------|
| `CANTEEN_PORT` | `8901` |
| `CANTEEN_DB_PATH` | `./assets.db` |
| `CANTEEN_SKIP_AUTH` | (empty) |
## Links
- [README](https://gitea.ourpad.casa/shawn/canteen-asset-tracker/src/branch/main/README.md)
- [PROJECT.md](https://gitea.ourpad.casa/shawn/canteen-asset-tracker/src/branch/main/PROJECT.md)