Photo Management (per specs/photo-management.md): - Sharp integration for 3-size compression (thumb/medium/full) - WebP output with 80-90% quality - Client-side compression with browser-image-compression - PhotoUpload component with camera/drag-drop support - Upload API with bulk support and stats endpoint Testing: - Backend: Jest tests for all major API endpoints - Frontend: Vitest tests for utilities and API clients - CI: Updated Forgejo workflow for test execution Specs (100% coverage): - visitor-management.md (Phase 8) - messaging.md (Phase 9) - audit-and-documents.md (Phase 10) - accessibility-i18n.md (Phase 11) - hardware-integration.md (Phase 12) - advanced-features.md (Phase 13) Documentation: - OpenAPI 3.0 spec (docs/openapi.yaml) - All endpoints documented with schemas
3.1 KiB
3.1 KiB
Feature Spec: QR Codes & Hardware Integration
Priority: 🟡 Medium
Phase: 12
Status: 🟡 Partial (QR done, NFC/E-ink TODO)
Overview
Enable quick plant/batch lookup via QR codes. Support for thermal label printing, RFID/NFC tags, and e-ink displays for room status.
QR Code System
Implementation Status: ✅ Complete
QR Data Format
{
"type": "batch" | "plant" | "room" | "visitor",
"id": "uuid",
"name": "Display Name",
"meta": { /* additional data */ }
}
Features
- Generate QR codes for batches, plants, rooms, visitors
- Print labels with QR codes
- Scan to navigate to entity
- Bulk label generation
API
generateBatchQRData(id, name, strain)- Create batch QRgeneratePlantQRData(id, batchId, position)- Create plant QRgenerateVisitorQRData(id, name, badge)- Create visitor QRparseQRData(data)- Parse scanned QR
Components
QRCodeGenerator- Display/download QRVisitorBadge- Printable badge with QR
Label Printing
Supported Printers
- Zebra thermal printers (ZPL)
- DYMO LabelWriter
- Standard inkjet (PDF fallback)
Label Sizes
- 2" x 1" - Plant tags
- 4" x 6" - Batch labels
- 3" x 2" - Visitor badges
Print Features
- Batch print queue
- Print preview
- Template selection
- Auto-scaling
NFC/RFID Tags (TODO)
Use Cases
- Plant tag scanning
- Room access logging
- Equipment tracking
- Staff badge check-in
Implementation Plan
- Web NFC API for compatible devices
- USB RFID reader support
- Tag write capability for provisioning
E-Ink Displays (TODO)
Use Cases
- Room status displays (temp, humidity, stage)
- Batch status boards
- Task queue displays
Hardware Options
- Waveshare e-paper HAT
- InkPlate displays
- Custom ESP32-based
Data Protocol
- MQTT for real-time updates
- HTTP polling fallback
- Low-power mode support
Integration Architecture
┌─────────────────┐ ┌─────────────────┐
│ Mobile App │────▶│ Backend API │
│ (Scanner/NFC) │ │ │
└─────────────────┘ └────────┬────────┘
│
┌────────────────────────┼────────────────────────┐
│ │ │
▼ ▼ ▼
┌───────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Label Printer │ │ E-Ink Display │ │ RFID Reader │
│ (ZPL/PDF) │ │ (MQTT) │ │ (USB/BLE) │
└───────────────┘ └─────────────────┘ └─────────────────┘