ca-grow-ops-manager/specs/hardware-integration.md
fullsizemalt 558e0ac1e2
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Test / backend-test (push) Failing after 0s
Test / frontend-test (push) Failing after 0s
feat: Full Spec Kit compliance implementation
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
2025-12-11 09:53:32 -08:00

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 QR
  • generatePlantQRData(id, batchId, position) - Create plant QR
  • generateVisitorQRData(id, name, badge) - Create visitor QR
  • parseQRData(data) - Parse scanned QR

Components

  • QRCodeGenerator - Display/download QR
  • VisitorBadge - 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

  1. Plant tag scanning
  2. Room access logging
  3. Equipment tracking
  4. Staff badge check-in

Implementation Plan

  1. Web NFC API for compatible devices
  2. USB RFID reader support
  3. Tag write capability for provisioning

E-Ink Displays (TODO)

Use Cases

  1. Room status displays (temp, humidity, stage)
  2. Batch status boards
  3. 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)    │
└───────────────┘      └─────────────────┘      └─────────────────┘