# uditkrpathak/onemedicalfullstack architecture

> Architecture diagram of the GitHub repository uditkrpathak/onemedicalfullstack, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/uditkrpathak/onemedicalfullstack
- Repository: https://github.com/uditkrpathak/onemedicalfullstack

## Overview

OneMedical is a physiotherapy and clinical-recovery ecosystem spanning a mobile patient/therapist app, an administration portal, and backend services. Users access care through the gateway: identity and billing support account setup, therapist discovery and appointment payment; the clinical service supports scheduling, consultations, recovery programs, records, telehealth, reviews and notifications. The README documents the service boundaries and integrations; source evidence here is partial, so internal links are limited to shown imports, routes and calls.

Main entry points: [`Server/clinical-service/src/routes/clinical.routes.js`](https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/clinical-service/src/routes/clinical.routes.js) (Clinical routes), [`Server/identity-service/src/routes/user.routes.js`](https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/identity-service/src/routes/user.routes.js) (Identity routes), [`Server/identity-service/src/payment/controllers/paymentController.js`](https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/identity-service/src/payment/controllers/paymentController.js) (Payment processing), [`Server/clinical-service/src/notifications/notificationManager.js`](https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/clinical-service/src/notifications/notificationManager.js) (Notification dispatch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User applications"]
  node_mobile_app["Mobile app<br/>[App.jsx]"]
  node_mobile_flows["Care workflows<br/>[AppNavigator.jsx]"]
  node_admin_app["Admin portal<br/>[App.jsx]"]
end

subgraph group_identity["Identity and billing"]
  node_identity_routes["Identity routes<br/>[user.routes.js]"]
  node_auth["Authentication<br/>[authController.js]"]
  node_user_profiles["User profiles<br/>[userController.js]"]
  node_user_store[("Identity records<br/>[User.js]")]
  node_payment_routes["Payment routes<br/>[payment.routes.js]"]
  node_payments["Payment processing"]
  node_appointment_confirm["Appointment confirmation"]
  node_razorpay["Razorpay integration<br/>[razorpayService.js]"]
end

subgraph group_clinical["Clinical recovery"]
  node_clinical_routes["Clinical routes<br/>[clinical.routes.js]"]
  node_appointments[("Appointments<br/>[Appointment.js]")]
  node_availability["Schedule availability"]
  node_programs["Recovery programs"]
  node_recovery_engine["Recovery tracking<br/>[recoveryEngine.js]"]
  node_records_vault["Records and telehealth"]
  node_clinical_store[("Clinical records<br/>[MedicalRecord.js]")]
  node_reviews["Reviews and ratings"]
  node_rating_service["Rating calculation"]
end

subgraph group_platform["Backend platform"]
  node_gateway["API gateway<br/>[server.js]"]
  node_identity_db[("Identity database")]
  node_clinical_db[("Clinical database")]
  node_rabbitmq["RabbitMQ"]
  node_storage_providers["Cloud storage"]
  node_notification_services["Push, email, SMS"]
  node_payment_provider["Razorpay"]
end

subgraph group_messaging["Notifications"]
  node_notification_manager["Notification dispatch"]
  node_notification_worker["Notification worker"]
  node_notification_store[("Notification records<br/>[Notification.js]")]
  node_notification_providers["Delivery providers<br/>[pushProvider.js]"]
end

node_patient_therapist(("Patient / therapist"))
node_admin_users(("Clinic staff"))

node_patient_therapist -->|"uses"| node_mobile_app
node_mobile_app -->|"opens navigation"| node_mobile_flows
node_admin_users -->|"uses"| node_admin_app
node_admin_app -->|"requests services"| node_gateway
node_mobile_app -->|"requests services"| node_gateway
node_gateway -->|"routes identity"| node_identity_routes
node_gateway -->|"routes clinical"| node_clinical_routes
node_identity_routes -->|"routes to"| node_user_profiles
node_identity_routes -.->|"routes auth"| node_auth
node_payment_routes -->|"routes to"| node_payments
node_payments -->|"confirms appointment"| node_appointment_confirm
node_payments -->|"uses gateway service"| node_razorpay
node_identity_routes -.->|"routes payments"| node_payment_routes
node_user_profiles -->|"reads and writes"| node_user_store
node_auth -->|"authenticates accounts"| node_user_store
node_user_profiles -->|"publishes events"| node_rabbitmq
node_payments -->|"publishes events"| node_rabbitmq
node_clinical_routes -->|"routes programs"| node_programs
node_clinical_routes -.->|"routes appointments"| node_appointments
node_availability -->|"checks bookings"| node_appointments
node_programs -.->|"coordinates recovery"| node_recovery_engine
node_clinical_routes -->|"routes records"| node_records_vault
node_records_vault -.->|"stores records"| node_clinical_store
node_reviews -->|"recalculates ratings"| node_rating_service
node_notification_worker -.->|"dispatches events"| node_notification_manager
node_notification_manager -->|"records delivery"| node_notification_store
node_notification_manager -->|"sends push"| node_notification_providers
node_notification_manager -->|"delivers channels"| node_notification_services
node_identity_routes -->|"persists identity"| node_identity_db
node_clinical_routes -->|"persists clinical data"| node_clinical_db
node_payments -->|"charges payments"| node_payment_provider
node_clinical_routes -->|"stores vault files"| node_storage_providers
node_identity_routes -.->|"emits events"| node_rabbitmq
node_clinical_routes -.->|"emits events"| node_rabbitmq

click node_mobile_app "https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Client/App.jsx"
click node_mobile_flows "https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Client/src/app/navigation/AppNavigator.jsx"
click node_admin_app "https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Admin/src/App.jsx"
click node_gateway "https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/gateway/server.js"
click node_identity_routes "https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/identity-service/src/routes/user.routes.js"
click node_auth "https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/identity-service/src/controllers/authController.js"
click node_user_profiles "https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/identity-service/src/controllers/userController.js"
click node_user_store "https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/identity-service/src/models/User.js"
click node_payment_routes "https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/identity-service/src/payment/routes/payment.routes.js"
click node_payments "https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/identity-service/src/payment/controllers/paymentController.js"
click node_appointment_confirm "https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/identity-service/src/payment/services/appointmentConfirm.js"
click node_razorpay "https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/identity-service/src/payment/services/razorpayService.js"
click node_clinical_routes "https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/clinical-service/src/routes/clinical.routes.js"
click node_appointments "https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/clinical-service/src/models/Appointment.js"
click node_availability "https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/clinical-service/src/utils/availabilityEngine.js"
click node_programs "https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/clinical-service/src/controllers/programController.js"
click node_recovery_engine "https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/clinical-service/src/utils/recoveryEngine.js"
click node_records_vault "https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/clinical-service/src/controllers/medicalRecordController.js"
click node_clinical_store "https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/clinical-service/src/models/MedicalRecord.js"
click node_reviews "https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/clinical-service/src/controllers/reviewController.js"
click node_rating_service "https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/clinical-service/src/services/reviewRatingService.js"
click node_notification_manager "https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/clinical-service/src/notifications/notificationManager.js"
click node_notification_worker "https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/clinical-service/src/notifications/notificationWorker.js"
click node_notification_store "https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/clinical-service/src/models/Notification.js"
click node_notification_providers "https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/clinical-service/src/notifications/providers/pushProvider.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_mobile_app,node_mobile_flows,node_admin_app toneBlue
class node_identity_routes,node_auth,node_user_profiles,node_user_store,node_payment_routes,node_payments,node_appointment_confirm,node_razorpay toneAmber
class node_clinical_routes,node_appointments,node_availability,node_programs,node_recovery_engine,node_records_vault,node_clinical_store,node_reviews,node_rating_service,node_patient_therapist toneMint
class node_gateway,node_identity_db,node_clinical_db,node_rabbitmq,node_storage_providers,node_notification_services,node_payment_provider toneRose
class node_notification_manager,node_notification_worker,node_notification_store,node_notification_providers,node_admin_users toneIndigo
```

## Components

### User applications

- [Mobile app](https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Client/App.jsx): `Client/App.jsx`
- [Care workflows](https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Client/src/app/navigation/AppNavigator.jsx): `Client/src/app/navigation/AppNavigator.jsx`
- [Admin portal](https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Admin/src/App.jsx): `Admin/src/App.jsx`

### Identity and billing

- [Identity routes](https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/identity-service/src/routes/user.routes.js): `Server/identity-service/src/routes/user.routes.js`
- [Authentication](https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/identity-service/src/controllers/authController.js): `Server/identity-service/src/controllers/authController.js`
- [User profiles](https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/identity-service/src/controllers/userController.js): `Server/identity-service/src/controllers/userController.js`
- [Identity records](https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/identity-service/src/models/User.js): `Server/identity-service/src/models/User.js`
- [Payment routes](https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/identity-service/src/payment/routes/payment.routes.js): `Server/identity-service/src/payment/routes/payment.routes.js`
- [Payment processing](https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/identity-service/src/payment/controllers/paymentController.js): `Server/identity-service/src/payment/controllers/paymentController.js`
- [Appointment confirmation](https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/identity-service/src/payment/services/appointmentConfirm.js): `Server/identity-service/src/payment/services/appointmentConfirm.js`
- [Razorpay integration](https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/identity-service/src/payment/services/razorpayService.js): `Server/identity-service/src/payment/services/razorpayService.js`

### Clinical recovery

- [Clinical routes](https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/clinical-service/src/routes/clinical.routes.js): `Server/clinical-service/src/routes/clinical.routes.js`
- [Appointments](https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/clinical-service/src/models/Appointment.js): `Server/clinical-service/src/models/Appointment.js`
- [Schedule availability](https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/clinical-service/src/utils/availabilityEngine.js): `Server/clinical-service/src/utils/availabilityEngine.js`
- [Recovery programs](https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/clinical-service/src/controllers/programController.js): `Server/clinical-service/src/controllers/programController.js`
- [Recovery tracking](https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/clinical-service/src/utils/recoveryEngine.js): `Server/clinical-service/src/utils/recoveryEngine.js`
- [Records and telehealth](https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/clinical-service/src/controllers/medicalRecordController.js): `Server/clinical-service/src/controllers/medicalRecordController.js`
- [Clinical records](https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/clinical-service/src/models/MedicalRecord.js): `Server/clinical-service/src/models/MedicalRecord.js`
- [Reviews and ratings](https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/clinical-service/src/controllers/reviewController.js): `Server/clinical-service/src/controllers/reviewController.js`
- [Rating calculation](https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/clinical-service/src/services/reviewRatingService.js): `Server/clinical-service/src/services/reviewRatingService.js`

### Backend platform

- [API gateway](https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/gateway/server.js): `Server/gateway/server.js`
- **Identity database**
- **Clinical database**
- **RabbitMQ**
- **Cloud storage**
- **Push, email, SMS**
- **Razorpay**

### Notifications

- [Notification dispatch](https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/clinical-service/src/notifications/notificationManager.js): `Server/clinical-service/src/notifications/notificationManager.js`
- [Notification worker](https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/clinical-service/src/notifications/notificationWorker.js): `Server/clinical-service/src/notifications/notificationWorker.js`
- [Notification records](https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/clinical-service/src/models/Notification.js): `Server/clinical-service/src/models/Notification.js`
- [Delivery providers](https://github.com/uditkrpathak/onemedicalfullstack/blob/main/Server/clinical-service/src/notifications/providers/pushProvider.js): `Server/clinical-service/src/notifications/providers/pushProvider.js`

### Other components

- **Patient / therapist**
- **Clinic staff**

## Connections

- Patient / therapist → Mobile app: uses (evidence: `README.md`)
- Mobile app → Care workflows: opens navigation (evidence: `Client/App.jsx`)
- Clinic staff → Admin portal: uses (evidence: `README.md`)
- Admin portal → API gateway: requests services (evidence: `README.md`)
- Mobile app → API gateway: requests services (evidence: `README.md`)
- API gateway → Identity routes: routes identity (evidence: `README.md`)
- API gateway → Clinical routes: routes clinical (evidence: `README.md`)
- Identity routes → User profiles: routes to (evidence: `Server/identity-service/src/routes/user.routes.js`)
- Identity routes → Authentication: routes auth
- Payment routes → Payment processing: routes to (evidence: `Server/identity-service/src/payment/routes/payment.routes.js`)
- Payment processing → Appointment confirmation: confirms appointment (evidence: `Server/identity-service/src/payment/controllers/paymentController.js`)
- Payment processing → Razorpay integration: uses gateway service (evidence: `Server/identity-service/src/payment/controllers/paymentController.js`)
- Identity routes → Payment routes: routes payments
- User profiles → Identity records: reads and writes (evidence: `Server/identity-service/src/controllers/userController.js`)
- Authentication → Identity records: authenticates accounts (evidence: `Server/identity-service/src/controllers/authController.js`)
- User profiles → RabbitMQ: publishes events (evidence: `Server/identity-service/src/controllers/userController.js`)
- Payment processing → RabbitMQ: publishes events (evidence: `Server/identity-service/src/payment/controllers/paymentController.js`)
- Clinical routes → Recovery programs: routes programs (evidence: `Server/clinical-service/src/routes/clinical.routes.js`)
- Clinical routes → Appointments: routes appointments
- Schedule availability → Appointments: checks bookings (evidence: `Server/clinical-service/src/utils/availabilityEngine.js`)
- Recovery programs → Recovery tracking: coordinates recovery
- Clinical routes → Records and telehealth: routes records (evidence: `Server/clinical-service/src/routes/clinical.routes.js`)
- Records and telehealth → Clinical records: stores records
- Reviews and ratings → Rating calculation: recalculates ratings (evidence: `Server/clinical-service/src/controllers/reviewController.js`)
- Notification worker → Notification dispatch: dispatches events
- Notification dispatch → Notification records: records delivery (evidence: `Server/clinical-service/src/notifications/notificationManager.js`)
- Notification dispatch → Delivery providers: sends push (evidence: `Server/clinical-service/src/notifications/notificationManager.js`)
- Notification dispatch → Push, email, SMS: delivers channels (evidence: `README.md`)
- Identity routes → Identity database: persists identity (evidence: `README.md`)
- Clinical routes → Clinical database: persists clinical data (evidence: `README.md`)
- Payment processing → Razorpay: charges payments (evidence: `README.md`)
- Clinical routes → Cloud storage: stores vault files (evidence: `README.md`)
- Identity routes → RabbitMQ: emits events (evidence: `README.md`)
- Clinical routes → RabbitMQ: emits events (evidence: `README.md`)
