How kltsai/next-is-you works
Next is you is a private, self-hosted hospital-queue watcher: an owner drafts a visit in the browser, the Worker stores it, scheduled checks read a hospital queue, and a reminder may be sent to invited LINE recipients when the patient is near. The README says real reads and sends remain held pending the owner’s pilot. The graph preserves setup, clinic-schedule validation, hospital adapters, queue interpretation, persistence, recipient controls, and notification decisions. Some backend connections are dashed because excerpts show module roles or imports, not the actual invoking code.
Main entry points: worker.py HTTP application · main.ts Organizer UI · scheduler.py Scheduled checks · hospital_registry.py Hospital registry
Components 22
Owner experience
- Organizer UI
frontend/src/main.ts - Visit setup
frontend/src/setup-form.js - Visit projection
frontend/src/dashboard-projection.js - Visit polling
frontend/src/visits-poller.js - Recipient consent
frontend/src/recipient-consent.ts
Worker service
- Organizer API
frontend/src/organizer-api.js - HTTP application
src/worker.py - Authentication
src/next_is_you/auth.py - Scheduled checks
src/next_is_you/scheduler.py - Visit persistence
src/next_is_you/persistence.py
Hospital reading
- Hospital registry
src/next_is_you/hospital_registry.py - Schedule validation
src/next_is_you/schedule_check.py - Schedule reader Worker
src/next_is_you/schedule_reader_worker.py - Reader adapter
src/next_is_you/schedule_reader_client.py - NTUH queue reader
src/next_is_you/ntuh_reader.py - Queue domain
src/next_is_you/domain.py
Reminder delivery
- Reminder decisions
src/next_is_you/reminder_decision.py - Send gate
src/next_is_you/send_gate.py - Send hold state
src/next_is_you/paused_service.py - LINE messaging
src/next_is_you/line_messaging.py - Recipient lifecycle
src/next_is_you/recipient_lifecycle.py
Other components
- Owner
Connections 25
- Owner → Organizer UI: uses
README.md - Organizer UI → Visit setup: renders
frontend/src/main.ts - Organizer UI → Organizer API: calls
frontend/src/main.ts - Organizer API → HTTP application: requests
- HTTP application → Authentication: authenticates
src/worker.py - HTTP application → Visit persistence: stores visits
src/worker.py - HTTP application → Recipient lifecycle: manages recipients
- HTTP application → Send gate: starts monitoring
src/worker.py - Scheduled checks → Hospital registry: dispatches reads
src/next_is_you/scheduler.py - Hospital registry → NTUH queue reader: delegates reads
src/next_is_you/hospital_registry.py - Hospital registry → Schedule reader Worker: provides schedule reader
src/next_is_you/schedule_reader_worker.py - Reader adapter → Schedule reader Worker: calls RPC
src/next_is_you/schedule_reader_client.py - Schedule validation → Reader adapter: uses adapter
- NTUH queue reader → Queue domain: returns observations
src/next_is_you/ntuh_reader.py - Scheduled checks → Visit persistence: loads visit state
src/next_is_you/scheduler.py - Scheduled checks → Reminder decisions: evaluates reminders
src/next_is_you/scheduler.py - Scheduled checks → Send gate: requests sends
src/next_is_you/send_gate.py - Send gate → Send hold state: checks hold
src/next_is_you/paused_service.py - Send gate → LINE messaging: sends messages
src/next_is_you/send_gate.py - Organizer UI → Visit projection: projects visits
frontend/src/main.ts - Organizer UI → Visit polling: refreshes visits
frontend/src/main.ts - Organizer UI → Recipient consent: offers controls
- HTTP application → Scheduled checks: runs scheduled checks
- Scheduled checks → Reader adapter: requests clinic schedule
- HTTP application → Hospital registry: serves hospital capabilities
src/worker.py