How chrisguzman77/irin works
Irin is a bedside diabetes-safety system: it reads live or replayed CGM data, forecasts lows, escalates alarms through room outputs and human support, and gives patients, clinicians, and family separate views. The README also documents clinical cards, buddy matching, family stories, dashboards, and retrospective ML. Edges reflect documented product flows; sampled excerpts are partial, so uncertain internal wiring is omitted.
Main entry points: app/main.py Device API · relay/main.py Blind relay · relay_client.py Relay client · App.tsx Phone app
Components 26
Bedside safety
- Phone app
frontend/app/src/App.tsx - Device API
backend/app/main.py - CGM source
backend/app/datasource/nightscout.py - Low forecast
backend/app/forecast.py - Alarm ladder
backend/app/alarm.py - Room outputs
hardware/hal.py - Presence radar
backend/app/presence.py - Night report
backend/app/reports.py
Clinical rounds
- Rounds engine
backend/app/rounds/evaluate.py - Cards and steps
backend/app/rounds/standing.py - Noise budget
backend/app/rounds/noise.py - Card encryption
backend/app/rounds/crypto.py - Relay client
backend/app/rounds/relay_client.py - Blind relay
relay/main.py - Doctor inbox
frontend/clinician/session.js
Buddy and family
- Buddy matching
relay/directory.py - Volunteer hub
relay/hub.py - Family story
backend/app/family_story.py - Family page
frontend/family/family.js
Data and ML
- Device forwarder
backend/app/forward.py - Cloud API
cloud/main.py - Cloud data store
cloud/ingest.py - Dashboards
cloud/dash.py - Forecast model
ml/models/predict.py - Replay source
backend/app/datasource/replay.py
Other components
- Sleeper
Connections 29
- Sleeper → Phone app: views and acknowledges
- Phone app → Device API: requests device data
- CGM source → Device API: supplies readings
- Replay source → Device API: supplies demo readings
- Device API → Low forecast: requests prediction
- Forecast model → Low forecast: provides model
- Device API → Alarm ladder: evaluates alarm state
- Device API → Presence radar: updates presence
- Alarm ladder → Room outputs: dispatches tones and lights
- Presence radar → Room outputs: gates room outputs
- Device API → Night report: builds morning report
- Rounds engine → Cards and steps: evaluates night records
- Cards and steps → Noise budget: applies send limits
- Noise budget → Card encryption: passes eligible cards
- Card encryption → Relay client: seals cards
- Relay client → Blind relay: sends ciphertext
- Blind relay → Doctor inbox: delivers inbox cards
- Doctor inbox → Blind relay: sends doctor reply
- Blind relay → Relay client: polls messages
- Device API → Buddy matching: uses matching service
- Device API → Volunteer hub: posts hub updates
- Buddy matching → Blind relay: serves buddy directory
- Volunteer hub → Blind relay: serves volunteer hub
- Device API → Family story: creates night story
- Family story → Family page: shares approved story
- Device API → Device forwarder: provides device records
- Device forwarder → Cloud API: posts data batches
- Cloud API → Cloud data store: upserts records
- Dashboards → Cloud data store: queries records