How yagna-gajjar/healthmate-api works
Healthmate is a TypeScript/Express backend for healthcare administration and care workflows. Users access its API to manage accounts and permissions, patient and clinician records, appointments and prescriptions, and related operational work such as billing, staffing, and notifications. The sampled authentication code shows patient registration coordinating user, address, patient, and document creation in a transaction; the sampled route files show authenticated and permission-checked endpoints for several domains. Many modules are present in the tree but were not sampled, so their internal calls and cross-domain wiring are not inferred.
Main entry points: auth.controller.ts Authentication controller · auth.service.ts Authentication service · auth.route.ts Authentication routes · index.ts HTTP API
Components 22
Access and administration
- Authentication routes
src/routes/auth.route.ts - Authentication controller
src/controllers/auth.controller.ts - Authentication service
src/services/auth.service.ts - Role permissions
src/rbac/index.ts - RBAC service
src/services/rbac.service.ts - RBAC repository
src/repository/rbac.repository.ts
Care workflows
- Patient records
src/modules/patient - Doctor records
src/modules/doctor/doctor.routes.ts - Appointments
src/modules/appointment/appointment.routes.ts - Prescriptions
src/modules/prescription/prescription.routes.ts - Prescription items
src/modules/prescription_item/prescription_item.routes.ts - Documents
src/modules/document/document.routes.ts
Operations
- Invoices and payments
src/modules/invoice - Staff and shifts
src/modules/staff - Notifications
src/modules/notification/notification.routes.ts - Dashboard
src/controllers/dashboard.controller.ts
API and persistence
- HTTP API
src/index.ts - Route registry
src/routes/index.ts - User repository
src/repository/auth.repository.ts - PostgreSQL database
src/config/data-source.ts - Gmail mail service
Other components
- Healthcare user
Connections 12
- Healthcare user → HTTP API: sends requests
- HTTP API → Route registry: dispatches routes
- Route registry → Authentication routes: mounts routes
- Authentication routes → Authentication controller: invokes handlers
- Authentication controller → Authentication service: calls
- Authentication controller → RBAC service: checks permissions
- Authentication controller → RBAC repository: creates repository
- Authentication service → User repository: queries and updates
- Authentication service → PostgreSQL database: transacts registration
- User repository → PostgreSQL database: reads and writes users
- Authentication service → Gmail mail service: sends email
- Doctor records → Appointments: invokes appointment handler