How aranchaimoonkum/patient-monitoring-system works
Patient Staff Assignment is a real-time registration and monitoring app. Patients complete a validated form, confirm submission, and send it through the patient API for persistence and live notification. Staff view submitted records with filters and pagination, while Ably Presence exposes in-progress drafts. The graph includes the documented database-backed form options and shared form controls. Some UI-to-API and real-time links are documented in the README; unsampled implementation details are not inferred beyond those relationships.
Main entry points: patient-form.tsx Patient form · patient-monitor.tsx Staff monitor · api.ts Patient data access · route.ts Patient API
Components 24
Patient registration
- Registration page
app/page.tsx - Patient form
components/patient/patient-form.tsx - Form controls
components/inputs.tsx - Accessible select
components/select.tsx - Date picker
components/date-picker.tsx - Field components
components/field.tsx - Alert dialogs
components/alert-dialog.tsx
Staff monitoring
- Staff page
app/staff/page.tsx - Staff monitor
components/staff/patient-monitor.tsx - Staff patients API
app/api/staff/patients/route.ts - Pagination control
components/pagination.tsx - Search and pagination rules
types/staff-search.ts
Realtime services
- Ably publisher
lib/ably/publish.ts - Patient presence hook
lib/models/use-patient-form-presence.ts - Presence model
lib/ably/form-presence.ts - Ably client
lib/models/modelsClient.ts - Presence members hook
lib/models/use-form-presence-members.ts
Data and validation
- Patient validation
schemas/patient.ts - Patient API
app/api/patients/route.ts - Patient data access
lib/prisma/api.ts - Neon Postgres
- Event outbox
lib/prisma/api.ts
Other components
- Patient
- Staff user
Connections 30
- Patient → Registration page: opens form
README.md - Registration page → Patient form: renders
app/page.tsx - Patient form → Patient validation: validates with
components/patient/patient-form.tsx - Patient form → Form controls: renders
components/patient/patient-form.tsx - Patient form → Accessible select: renders
components/patient/patient-form.tsx - Patient form → Date picker: renders
components/patient/patient-form.tsx - Accessible select → Field components: uses
components/select.tsx - Patient form → Alert dialogs: confirms submit
README.md - Patient form → Patient API: POSTs submission
README.md - Patient API → Patient validation: parses with
app/api/patients/route.ts - Patient API → Patient data access: stores patient
app/api/patients/route.ts - Patient data access → Neon Postgres: writes and queries
lib/prisma/api.ts - Patient data access → Event outbox: records event
lib/prisma/api.ts - Patient API → Ably publisher: publishes event
app/api/patients/route.ts - Ably publisher → Ably client: sends to Ably
README.md - Patient form → Patient presence hook: tracks draft
components/patient/patient-form.tsx - Patient presence hook → Presence model: uses helpers
lib/models/use-patient-form-presence.ts - Patient presence hook → Ably client: gets connection
lib/models/use-patient-form-presence.ts - Staff user → Staff page: opens monitor
README.md - Staff page → Patient data access: loads patients and options
app/staff/page.tsx - Patient data access → Neon Postgres: reads records and options
lib/prisma/api.ts - Staff page → Staff monitor: renders
app/staff/page.tsx - Staff monitor → Staff patients API: requests filtered page
README.md - Staff patients API → Patient data access: queries patients
app/api/staff/patients/route.ts - Staff monitor → Pagination control: renders
components/staff/patient-monitor.tsx - Staff monitor → Search and pagination rules: applies URL filters
components/staff/patient-monitor.tsx - Staff monitor → Presence members hook: subscribes to drafts
components/staff/patient-monitor.tsx - Presence members hook → Presence model: parses members
lib/models/use-form-presence-members.ts - Presence members hook → Ably client: gets connection
lib/models/use-form-presence-members.ts - Ably client → Staff monitor: delivers patient events
README.md