How basilalfarooqui-cmyk/sih26118-h2s-reader works
SIH26118 captures H2S lead-acetate wristband readings, stores them centrally, and exposes them to a web dashboard. The mobile workflow offers normal and admin modes, photographs and crops the strip, derives a representative hex color, and records it; saved readings can be retried when connectivity returns. The backend accepts app and hardware readings and persists records in Supabase. The dashboard filters and manages records and exports them. Several screen and API implementations were not sampled, so those links reflect documented capabilities and exact paths, not inspected call details; ESP32 firmware is a placeholder.
Main entry points: camera.tsx Camera workflow · server.js Express server · index.tsx Mode selection · saved-records.tsx Saved readings
Components 18
Mobile reader
- Camera workflow
app/app/camera.tsx - Crop adjustment
app/src/components/CropAdjuster.tsx - Color extraction
app/src/utils/pixelColor.ts - Mode selection
app/app/index.tsx - Admin login
app/app/login.tsx - Reading record
app/app/record.tsx - Mobile API
app/src/utils/api.ts - Saved readings
app/app/saved-records.tsx - Pending storage
app/src/utils/storage.ts
Reading service
- Express server
backend/server.js - Reading routes
backend/routes/readings.js - Supabase client
backend/services/supabase.js - Readings database
backend/db/setup.sql
Records dashboard
- Dashboard UI
dashboard/app.js - Dashboard page
dashboard/index.html
Hardware source
- ESP32 sensor
esp32/README.md
Other components
- Refinery worker
- Admin user
Connections 19
- Refinery worker → Mode selection: selects mode
- Mode selection → Camera workflow: opens normal mode
- Mode selection → Admin login: opens admin mode
- Admin login → Camera workflow: continues to reading
- Camera workflow → Crop adjustment: adjusts crop
- Camera workflow → Color extraction: extracts color
- Camera workflow → Reading record: records result
- Reading record → Mobile API: submits reading
- Camera workflow → Saved readings: opens saved records
- Saved readings → Pending storage: loads and removes
- Saved readings → Mobile API: syncs pending
- Mobile API → Express server: sends readings
- ESP32 sensor → Express server: sends hardware readings
- Express server → Reading routes: dispatches requests
- Reading routes → Supabase client: queries and writes
- Supabase client → Readings database: accesses records
- Admin user → Dashboard page: views and manages
- Dashboard page → Dashboard UI: loads interface
- Dashboard UI → Express server: fetches and deletes