How madhu240750/h2s-dispenser- works
SAFE-SENSE is a hackathon prototype for tracking H₂S exposure using passive colorimetric wristbands, browser-based scan analysis, worker/supervisor views, and a Raspberry Pi dispenser. The main user journey is band issuance, worker scan and exposure/risk recording, then history and safety alerts for workers and supervisors. The README also describes a standalone FastAPI alternative. Source excerpts are partial: the documented scan and calibration capabilities are included, but uncertain internal wiring and the claimed persistent Firestore storage are not represented as implemented components.
Main entry points: App.tsx Application Controller · server.ts Express API and Realtime Bus · Scanner.tsx Return Scanner · WorkerApp.tsx Worker App
Components 18
Band and Scan Workflow
- Passive Dosimeter
- Application Controller
src/App.tsx - Return Scanner
src/components/Scanner.tsx - Color Analysis
src/utils/colorPipeline.ts - Dispenser Kiosk
src/components/RaspberryPiKiosk.tsx
Worker and Supervisor Views
- Worker App
src/components/WorkerApp.tsx - Host Safety Station
src/components/HostSafetyStation.tsx - Admin Console
src/components/AdminSuite.tsx
API and Device Services
- Express API and Realtime Bus
server.ts - Alternative FastAPI Hub
backend/main.py - Raspberry Pi Station
raspberry_pi/main.py - Application State
src/App.tsx
Alerts and Calibration
- Risk Alert Banner
src/components/HighRiskAlertBanner.tsx - Browser Alerts and Siren
src/utils/notificationSystem.ts - Calibration and Demo Data
src/data/mockEcosystem.ts
Other components
- H₂S Environment
- Worker
- Safety Supervisor
Connections 20
- H₂S Environment → Passive Dosimeter: exposes chemically
- Worker → Worker App: uses
- Worker App → Return Scanner: starts scan
- Passive Dosimeter → Return Scanner: presents color patch
- Return Scanner → Color Analysis: submits image colors
- Color Analysis → Application Controller: returns estimate
- Application Controller → Express API and Realtime Bus: posts scan result
- Express API and Realtime Bus → Application State: updates worker records
- Application Controller → Worker App: provides worker data
- Application Controller → Host Safety Station: provides roster and risk data
- Safety Supervisor → Host Safety Station: reviews roster
- Application Controller → Admin Console: provides management data
- Application Controller → Risk Alert Banner: shows high-risk alert
- Application Controller → Browser Alerts and Siren: triggers emergency warning
- Admin Console → Calibration and Demo Data: views calibration references
- Worker → Dispenser Kiosk: requests wristband
- Dispenser Kiosk → Application Controller: requests dispense
- Raspberry Pi Station → Express API and Realtime Bus: posts dispense and heartbeat
- Express API and Realtime Bus → Application State: assigns band and shift
- Alternative FastAPI Hub → Application State: maintains separate in-memory records