Scope
File: src/components/spatial/Provisioner.tsx
Problem
Field engineers currently have no guided UI for pairing new hardware meters with on-chain Soroban records. The manual process is error-prone and lacks QR-based device pairing that field teams expect from modern IoT deployments.
Requirements
- Build a 4-step wizard in
Provisioner.tsx:
- Step 0: Form — Hardware ID, Meter Type dropdown, Lat/Lng, Install Date
- Step 1: Confirmation — Review entered details
- Step 2: QR Generation — Display a scannable QR code encoding the provisioning payload
- Step 3: Success — Show confirmation with on-chain transaction hash
- Each step must be independently testable (extract sub-components if needed).
- QR code should be generated client-side using a library like
qrcode or @ngneat/qrcode.
- On step 2, call
src/services/api.ts to submit the provisioning transaction.
- Handle loading, error, and success states per step.
Resolution Strategy
- Use
useState for step index and form payload.
- QR data: JSON string of
{ hw, type, lat, lng, ts }.
- On submit, POST to
/api/provision then poll for confirmation.
- Full keyboard navigation (Enter to advance, Escape to go back).
Tags
spatial, provisioning, qr, hardware
Scope
File:
src/components/spatial/Provisioner.tsxProblem
Field engineers currently have no guided UI for pairing new hardware meters with on-chain Soroban records. The manual process is error-prone and lacks QR-based device pairing that field teams expect from modern IoT deployments.
Requirements
Provisioner.tsx:qrcodeor@ngneat/qrcode.src/services/api.tsto submit the provisioning transaction.Resolution Strategy
useStatefor step index and form payload.{ hw, type, lat, lng, ts }./api/provisionthen poll for confirmation.Tags
spatial, provisioning, qr, hardware