Parivar — Module Index
A one-line directory of the 17 NestJS modules. Each row links to its full endpoint specification in the Module Reference, and to the tables it owns in the Data Model.
| # | Module | Responsibility | Primary roles |
|---|---|---|---|
| 1 | AuthModule | OTP login, sessions, 2FA, OAuth/identity linking, account deletion/deactivation/reactivation | All |
| 2 | UsersModule | Profiles, user_roles, admin invites/suspension | Admin |
| 3 | ParentsModule | Parent (patient) CRUD + admission forms | Customer (write), Nurse/Doctor (read), Admin |
| 4 | VisitsModule | Booking wizard, scheduling/assignment, reschedule, visit lifecycle, event timeline | Customer, Nurse, Admin, Doctor (read) |
| 5 | ClinicalModule | Assessments/vitals (draft→submit→approve), wound photos, clinical report PDFs | Nurse (write), Admin/Doctor (review), Customer (read) |
| 6 | EscalationsModule | Escalations + responses, doctor routing | Nurse (create), Doctor/Admin (respond) |
| 7 | IncidentsModule ⚠️ | Risk/safety log — no incidents table in live schema; fold into EscalationsModule | Nurse (write), Admin |
| 8 | NurseModule | Onboarding/application, KYC (Didit), document signing, availability, working hours, leave, location/SOS, earnings, bank details | Nurse, Admin |
| 9 | DoctorModule | Case-review queue, claim/respond/close, teleconsultations, read-only records | Doctor |
| 10 | AdminModule | Staff lifecycle, customer/subscription oversight, app config, monitoring | Admin / Super Admin |
| 11 | HospitalModule | Hospital requests + escort tasks | Customer (create), Admin |
| 12 | PariAIModule | Streaming clinical-guidance chat + voice transcription | Customer (chat), all (transcribe) |
| 13 | BillingModule | Stripe checkout, customer portal, subscription lifecycle, on-demand payments, webhook | Customer, Admin (read), system |
| 14 | ReferralsModule | Referral accounts, referrals, commission | Customer (read), Admin |
| 15 | NotificationsModule | In-app notifications + transactional email dispatch | All (read own), system |
| 16 | AlertsModule | Admin operations alerts, SOS alerts, monitoring sweeps | Admin, system |
| 17 | ConfigModule | app_config, version gating, maps key | All (read), Admin (write) |
Shared providers (not domain modules)
These cut across every module and are implemented once.
| Provider | Responsibility |
|---|---|
| RealtimeGateway | Socket.IO gateway; rooms for visits, escalations, alerts, SOS, locations, notifications, conversations |
| StorageService | S3-compatible object storage + pre-signed URLs (reports, wound-photos, staff-documents) |
| MailService | Resend email dispatch via a BullMQ queue |
| AiService | PariAI chat + Whisper transcription behind a provider SDK |
| Auth guards | JwtAuthGuard, RolesGuard, DisabledUserGuard applied globally |
Looking for endpoint-level detail (routes, request/response fields, guards, side effects, errors)? See the Module Reference. For the tables each module owns, see the Data Model.