How rinnshanzuki/pmed-aid works
PMED-AID is a role-based patient and medication management system with browser and mobile clients backed by an Express API and relational database. Users authenticate, enter role-specific workflows, and use the API for patient records, admissions, consultations, prescriptions, medication administration and monitoring, QR workflows, billing, analytics, and notifications. The graph includes those documented capabilities, plus the backend persistence and realtime/adherence layers. Several feature modules were not excerpted, so their internal calls are omitted; dashed client-to-API links indicate the HTTP boundary is not shown in the excerpts.
Main entry points: routes/index.js API route dispatch · models/index.js Domain models · server.js HTTP server startup · consultationController.js Clinical consultations
Components 26
User clients
- Browser app
frontend/src/App.jsx - Browser authentication
frontend/src/pages/AuthPage.jsx - Browser auth state
frontend/src/contexts/AuthContext.jsx - Browser API client
frontend/src/services/api.js - Browser role workflows
frontend/src/pages - Mobile app
mobile/App.tsx - Mobile role workflows
mobile/src/navigation - Mobile authentication
mobile/src/contexts/AuthContext.tsx - Mobile API configuration
mobile/src/config/api.config.ts - Mobile API client
mobile/src/services/api.ts
API and workflows
- HTTP server startup
backend/src/server.js - HTTP application
backend/src/app.js - API route dispatch
backend/src/routes/index.js - Authentication
backend/src/controllers/authController.js - Admissions and discharge
backend/src/controllers/admissionController.js - Clinical consultations
backend/src/controllers/consultationController.js - Info desk workflows
backend/src/controllers/infoDeskController.js - Prescription workflows
backend/src/controllers/prescriptionController.js - Medication schedules
backend/src/controllers/scheduleController.js - Other API domains
backend/src/controllers
Persistence
- Domain models
backend/src/models/index.js - Relational database
backend/src/config/db.js
Realtime and monitoring
- Notification helper
backend/src/utils/notificationHelper.js - Socket service
backend/src/socket.js - Adherence monitor
backend/src/cron/adherenceMonitor.js
Other components
- Staff and patients
Connections 36
- Staff and patients → Browser app: uses
frontend/src/App.jsx - Browser app → Browser authentication: routes to
frontend/src/App.jsx - Browser app → Browser role workflows: routes to
frontend/src/App.jsx - Browser authentication → Browser auth state: uses
frontend/src/pages/AuthPage.jsx - Browser auth state → Browser API client: calls
frontend/src/contexts/AuthContext.jsx - Browser role workflows → Browser API client: calls
frontend/src/pages/AuthPage.jsx - Staff and patients → Mobile app: uses
mobile/App.tsx - Mobile app → Mobile role workflows: renders
mobile/App.tsx - Mobile role workflows → Mobile authentication: uses
- Mobile authentication → Mobile API client: calls
mobile/src/contexts/AuthContext.tsx - Mobile API client → Mobile API configuration: configures
- Mobile role workflows → Mobile API client: calls
- HTTP server startup → HTTP application: starts
backend/src/server.js - HTTP server startup → Domain models: initializes
backend/src/server.js - HTTP server startup → Adherence monitor: starts
backend/src/server.js - HTTP server startup → Socket service: initializes
backend/src/server.js - HTTP application → API route dispatch: mounts
backend/src/app.js - API route dispatch → Authentication: dispatches
backend/src/routes/index.js - API route dispatch → Admissions and discharge: dispatches
backend/src/routes/index.js - API route dispatch → Clinical consultations: dispatches
backend/src/routes/index.js - API route dispatch → Info desk workflows: dispatches
backend/src/routes/index.js - API route dispatch → Prescription workflows: dispatches
backend/src/routes/index.js - API route dispatch → Medication schedules: dispatches
backend/src/routes/index.js - API route dispatch → Other API domains: dispatches
backend/src/routes/index.js - Authentication → Domain models: queries
backend/src/controllers/authController.js - Admissions and discharge → Domain models: queries
backend/src/controllers/admissionController.js - Clinical consultations → Domain models: queries
backend/src/controllers/consultationController.js - Info desk workflows → Domain models: queries
backend/src/controllers/infoDeskController.js - Info desk workflows → Notification helper: notifies
backend/src/controllers/infoDeskController.js - Admissions and discharge → Notification helper: notifies
backend/src/controllers/admissionController.js - Clinical consultations → Notification helper: notifies
backend/src/controllers/consultationController.js - Clinical consultations → Socket service: emits
backend/src/controllers/consultationController.js - Adherence monitor → Domain models: queries
backend/src/cron/adherenceMonitor.js - Domain models → Relational database: uses
backend/src/models/index.js - Browser API client → HTTP application: requests
- Mobile API client → HTTP application: requests