# hemanthkumar-181020/distributed-telemedicine architecture

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

- Interactive diagram: https://gitdiagram.com/hemanthkumar-181020/distributed-telemedicine
- Repository: https://github.com/hemanthkumar-181020/distributed-telemedicine

## Overview

Nidaan Pro is a distributed telemedicine platform. Patients discover doctors, book and pay for appointments, complete AI-assisted pre-consultation, then consult by video or chat; doctors manage profiles, schedules, appointments, notes, and reviews. Notifications and emergency matching are additional product branches. The README documents the service-level architecture and capabilities; sampled code confirms several internal calls, but many service integrations and frontend request paths were not shown, so those links are omitted or marked unverified.

Main entry points: [`backend/consultation-service/src/main/java/com/nidaanpro/consultationservice/service/ConsultationService.java`](https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/consultation-service/src/main/java/com/nidaanpro/consultationservice/service/ConsultationService.java) (Appointments and emergencies), [`backend/api-gateway/src/main/java/com/nidaanpro/api_gateway/controller/AIController.java`](https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/api-gateway/src/main/java/com/nidaanpro/api_gateway/controller/AIController.java) (API gateway), [`backend/payment-service/src/main/java/com/nidaanpro/payment_service/service/PaymentService.java`](https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/payment-service/src/main/java/com/nidaanpro/payment_service/service/PaymentService.java) (Payment processing), [`frontend/src/app`](https://github.com/hemanthkumar-181020/distributed-telemedicine/tree/main/frontend/src/app) (Web application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Patient experience"]
  node_webapp["Web application"]
end

subgraph group_identity["Identity and profiles"]
  node_auth["Authentication<br/>[AuthService.java]"]
  node_userstore[("User records<br/>[User.java]")]
  node_profiles["Doctor and patient profiles"]
  node_reviews["Reviews and ratings"]
end

subgraph group_care["Consultation workflow"]
  node_consultation["Appointments and emergencies"]
  node_appointmentstore[("Appointment records<br/>[Appointment.java]")]
  node_preconsult["AI pre-consultation<br/>[GeminiService.java]"]
end

subgraph group_realtime["Live communication"]
  node_chat["Real-time chat"]
  node_chatstore[("Chat messages<br/>[ChatMessage.java]")]
  node_video["Video consultations"]
end

subgraph group_platform["Platform services"]
  node_gateway["API gateway<br/>[AIController.java]"]
  node_registry["Service discovery"]
  node_payment["Payment processing"]
  node_paymentstore[("Payment records<br/>[Payment.java]")]
  node_notifications["Notifications and email"]
  node_notificationstore[("Notification records<br/>[Notification.java]")]
  node_rabbitmq["Event messaging"]
end

node_patient(("Patient"))
node_doctor(("Doctor"))
node_razorpay["Razorpay"]

node_patient -->|"uses"| node_webapp
node_doctor -->|"uses"| node_webapp
node_webapp -->|"sends requests"| node_gateway
node_gateway -->|"routes requests"| node_auth
node_gateway -->|"routes requests"| node_profiles
node_gateway -->|"routes requests"| node_consultation
node_gateway -->|"routes requests"| node_payment
node_gateway -->|"routes requests"| node_chat
node_auth -->|"reads and writes"| node_userstore
node_profiles -->|"fetches user details"| node_auth
node_reviews -->|"delegates review"| node_profiles
node_consultation -->|"stores appointments"| node_appointmentstore
node_consultation -->|"requests available doctors"| node_profiles
node_consultation -->|"creates payment order"| node_payment
node_payment -->|"stores payment"| node_paymentstore
node_payment -->|"creates order"| node_razorpay
node_payment -->|"confirms payment"| node_consultation
node_consultation -->|"publishes events"| node_rabbitmq
node_chat -->|"validates chat pairing"| node_consultation
node_chat -->|"saves messages"| node_chatstore
node_preconsult -.->|"supports preparation"| node_consultation
node_webapp -.->|"joins consultation"| node_video
node_rabbitmq -.->|"delivers events"| node_notifications
node_notifications -->|"stores notifications"| node_notificationstore
node_registry -.->|"supports discovery"| node_gateway

click node_webapp "https://github.com/hemanthkumar-181020/distributed-telemedicine/tree/main/frontend/src/app"
click node_gateway "https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/api-gateway/src/main/java/com/nidaanpro/api_gateway/controller/AIController.java"
click node_registry "https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/service-registry/src/main/java/com/nidaanpro/service_registry/ServiceRegistryApplication.java"
click node_auth "https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/auth-service/src/main/java/com/nidaanpro/auth_service/service/AuthService.java"
click node_userstore "https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/auth-service/src/main/java/com/nidaanpro/auth_service/model/User.java"
click node_profiles "https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/user-profile-service/src/main/java/com/nidaanpro/user_profile_service/service/UserProfileService.java"
click node_reviews "https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/user-profile-service/src/main/java/com/nidaanpro/user_profile_service/controller/ReviewController.java"
click node_consultation "https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/consultation-service/src/main/java/com/nidaanpro/consultationservice/service/ConsultationService.java"
click node_appointmentstore "https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/consultation-service/src/main/java/com/nidaanpro/consultationservice/model/Appointment.java"
click node_preconsult "https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/consultation-service/src/main/java/com/nidaanpro/consultationservice/service/GeminiService.java"
click node_payment "https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/payment-service/src/main/java/com/nidaanpro/payment_service/service/PaymentService.java"
click node_paymentstore "https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/payment-service/src/main/java/com/nidaanpro/payment_service/model/Payment.java"
click node_chat "https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/chat-service/src/main/java/com/nidaanpro/chat_service/controller/ChatController.java"
click node_chatstore "https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/chat-service/src/main/java/com/nidaanpro/chat_service/model/ChatMessage.java"
click node_video "https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/consultation-service/src/main/java/com/nidaanpro/consultationservice/service/VideoCallService.java"
click node_notifications "https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/notification-service/src/main/java/com/nidaanpro/notification_service/service/NotificationService.java"
click node_notificationstore "https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/notification-service/src/main/java/com/nidaanpro/notification_service/model/Notification.java"
click node_rabbitmq "https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/consultation-service/src/main/java/com/nidaanpro/consultationservice/config/RabbitMQConfig.java"

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_webapp toneBlue
class node_auth,node_userstore,node_profiles,node_reviews toneAmber
class node_consultation,node_appointmentstore,node_preconsult toneMint
class node_chat,node_chatstore,node_video toneRose
class node_gateway,node_registry,node_payment,node_paymentstore,node_notifications,node_notificationstore,node_rabbitmq,node_patient,node_doctor,node_razorpay toneIndigo
```

## Components

### Patient experience

- [Web application](https://github.com/hemanthkumar-181020/distributed-telemedicine/tree/main/frontend/src/app): `frontend/src/app`

### Identity and profiles

- [Authentication](https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/auth-service/src/main/java/com/nidaanpro/auth_service/service/AuthService.java): `backend/auth-service/src/main/java/com/nidaanpro/auth_service/service/AuthService.java`
- [User records](https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/auth-service/src/main/java/com/nidaanpro/auth_service/model/User.java): `backend/auth-service/src/main/java/com/nidaanpro/auth_service/model/User.java`
- [Doctor and patient profiles](https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/user-profile-service/src/main/java/com/nidaanpro/user_profile_service/service/UserProfileService.java): `backend/user-profile-service/src/main/java/com/nidaanpro/user_profile_service/service/UserProfileService.java`
- [Reviews and ratings](https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/user-profile-service/src/main/java/com/nidaanpro/user_profile_service/controller/ReviewController.java): `backend/user-profile-service/src/main/java/com/nidaanpro/user_profile_service/controller/ReviewController.java`

### Consultation workflow

- [Appointments and emergencies](https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/consultation-service/src/main/java/com/nidaanpro/consultationservice/service/ConsultationService.java): `backend/consultation-service/src/main/java/com/nidaanpro/consultationservice/service/ConsultationService.java`
- [Appointment records](https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/consultation-service/src/main/java/com/nidaanpro/consultationservice/model/Appointment.java): `backend/consultation-service/src/main/java/com/nidaanpro/consultationservice/model/Appointment.java`
- [AI pre-consultation](https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/consultation-service/src/main/java/com/nidaanpro/consultationservice/service/GeminiService.java): `backend/consultation-service/src/main/java/com/nidaanpro/consultationservice/service/GeminiService.java`

### Live communication

- [Real-time chat](https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/chat-service/src/main/java/com/nidaanpro/chat_service/controller/ChatController.java): `backend/chat-service/src/main/java/com/nidaanpro/chat_service/controller/ChatController.java`
- [Chat messages](https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/chat-service/src/main/java/com/nidaanpro/chat_service/model/ChatMessage.java): `backend/chat-service/src/main/java/com/nidaanpro/chat_service/model/ChatMessage.java`
- [Video consultations](https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/consultation-service/src/main/java/com/nidaanpro/consultationservice/service/VideoCallService.java): `backend/consultation-service/src/main/java/com/nidaanpro/consultationservice/service/VideoCallService.java`

### Platform services

- [API gateway](https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/api-gateway/src/main/java/com/nidaanpro/api_gateway/controller/AIController.java): `backend/api-gateway/src/main/java/com/nidaanpro/api_gateway/controller/AIController.java`
- [Service discovery](https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/service-registry/src/main/java/com/nidaanpro/service_registry/ServiceRegistryApplication.java): `backend/service-registry/src/main/java/com/nidaanpro/service_registry/ServiceRegistryApplication.java`
- [Payment processing](https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/payment-service/src/main/java/com/nidaanpro/payment_service/service/PaymentService.java): `backend/payment-service/src/main/java/com/nidaanpro/payment_service/service/PaymentService.java`
- [Payment records](https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/payment-service/src/main/java/com/nidaanpro/payment_service/model/Payment.java): `backend/payment-service/src/main/java/com/nidaanpro/payment_service/model/Payment.java`
- [Notifications and email](https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/notification-service/src/main/java/com/nidaanpro/notification_service/service/NotificationService.java): `backend/notification-service/src/main/java/com/nidaanpro/notification_service/service/NotificationService.java`
- [Notification records](https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/notification-service/src/main/java/com/nidaanpro/notification_service/model/Notification.java): `backend/notification-service/src/main/java/com/nidaanpro/notification_service/model/Notification.java`
- [Event messaging](https://github.com/hemanthkumar-181020/distributed-telemedicine/blob/main/backend/consultation-service/src/main/java/com/nidaanpro/consultationservice/config/RabbitMQConfig.java): `backend/consultation-service/src/main/java/com/nidaanpro/consultationservice/config/RabbitMQConfig.java`

### Other components

- **Patient**
- **Doctor**
- **Razorpay**

## Connections

- Patient → Web application: uses (evidence: `README.md`)
- Doctor → Web application: uses (evidence: `README.md`)
- Web application → API gateway: sends requests (evidence: `README.md`)
- API gateway → Authentication: routes requests (evidence: `README.md`)
- API gateway → Doctor and patient profiles: routes requests (evidence: `README.md`)
- API gateway → Appointments and emergencies: routes requests (evidence: `README.md`)
- API gateway → Payment processing: routes requests (evidence: `README.md`)
- API gateway → Real-time chat: routes requests (evidence: `README.md`)
- Authentication → User records: reads and writes (evidence: `backend/auth-service/src/main/java/com/nidaanpro/auth_service/service/AuthService.java`)
- Doctor and patient profiles → Authentication: fetches user details (evidence: `backend/user-profile-service/src/main/java/com/nidaanpro/user_profile_service/service/UserProfileService.java`)
- Reviews and ratings → Doctor and patient profiles: delegates review (evidence: `backend/user-profile-service/src/main/java/com/nidaanpro/user_profile_service/controller/ReviewController.java`)
- Appointments and emergencies → Appointment records: stores appointments (evidence: `backend/consultation-service/src/main/java/com/nidaanpro/consultationservice/service/ConsultationService.java`)
- Appointments and emergencies → Doctor and patient profiles: requests available doctors (evidence: `backend/consultation-service/src/main/java/com/nidaanpro/consultationservice/service/ConsultationService.java`)
- Appointments and emergencies → Payment processing: creates payment order (evidence: `backend/consultation-service/src/main/java/com/nidaanpro/consultationservice/service/ConsultationService.java`)
- Payment processing → Payment records: stores payment (evidence: `backend/payment-service/src/main/java/com/nidaanpro/payment_service/service/PaymentService.java`)
- Payment processing → Razorpay: creates order (evidence: `backend/payment-service/src/main/java/com/nidaanpro/payment_service/service/PaymentService.java`)
- Payment processing → Appointments and emergencies: confirms payment (evidence: `backend/payment-service/src/main/java/com/nidaanpro/payment_service/service/PaymentService.java`)
- Appointments and emergencies → Event messaging: publishes events (evidence: `backend/consultation-service/src/main/java/com/nidaanpro/consultationservice/service/ConsultationService.java`)
- Real-time chat → Appointments and emergencies: validates chat pairing (evidence: `backend/chat-service/src/main/java/com/nidaanpro/chat_service/controller/ChatController.java`)
- Real-time chat → Chat messages: saves messages (evidence: `backend/chat-service/src/main/java/com/nidaanpro/chat_service/controller/ChatController.java`)
- AI pre-consultation → Appointments and emergencies: supports preparation
- Web application → Video consultations: joins consultation
- Event messaging → Notifications and email: delivers events (evidence: `README.md`)
- Notifications and email → Notification records: stores notifications (evidence: `backend/notification-service/src/main/java/com/nidaanpro/notification_service/service/NotificationService.java`)
- Service discovery → API gateway: supports discovery (evidence: `README.md`)
