# quancao2310/hms-backend architecture

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

- Interactive diagram: https://gitdiagram.com/quancao2310/hms-backend
- Repository: https://github.com/quancao2310/hms-backend

## Overview

This repository is a hospital-management system organized as Spring services, with appointment scheduling and medical-record management as its clearest domain areas. The tree also shows gateway, service discovery, centralized configuration, patient-facing and staff services, plus shared entities. The README contains only the product title, and no source excerpts were provided, so runtime calls, data flows, and integrations cannot be verified; the graph therefore maps components without inventing edges.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_edge["Platform Services"]
  node_gateway["API Gateway"]
  node_discovery["Service Discovery"]
  node_configuration["Central Configuration"]
end

subgraph group_appoint["Appointment Management"]
  node_appointments["Appointments"]
  node_time_slots["Time Slots"]
  node_doctor_slots["Doctor Availability"]
  node_appointment_search["Appointment Search"]
  node_media_uploads["Image Uploads"]
end

subgraph group_records["Medical Records"]
  node_medical_records["Medical Records"]
  node_medical_info["Medical Information"]
  node_allergies["Allergies"]
  node_family_history["Family History"]
  node_medication_history["Medication History"]
end

subgraph group_users["User Services"]
  node_patient_service["Patient Service"]
  node_staff_service["Staff Service"]
end

subgraph group_shared["Shared Models"]
  node_external_entities["External Entities"]
  node_internal_entities["Internal Entities"]
end

click node_gateway "https://github.com/quancao2310/hms-backend/blob/main/services/gateway/src/main/java/com/example/hms/gateway/GatewayApplication.java"
click node_discovery "https://github.com/quancao2310/hms-backend/blob/main/services/eureka-server/src/main/java/com/example/hms/eurekaserver/EurekaServerApplication.java"
click node_configuration "https://github.com/quancao2310/hms-backend/tree/main/services/config-server/src/main/resources/configuration"
click node_appointments "https://github.com/quancao2310/hms-backend/blob/main/services/appointment-service/src/main/java/com/example/hms/appointmentservice/services/impl/AppointmentServiceImpl.java"
click node_time_slots "https://github.com/quancao2310/hms-backend/blob/main/services/appointment-service/src/main/java/com/example/hms/appointmentservice/services/impl/TimeSlotServiceImpl.java"
click node_doctor_slots "https://github.com/quancao2310/hms-backend/blob/main/services/appointment-service/src/main/java/com/example/hms/appointmentservice/services/impl/DoctorTimeSlotServiceImpl.java"
click node_appointment_search "https://github.com/quancao2310/hms-backend/blob/main/services/appointment-service/src/main/java/com/example/hms/appointmentservice/services/impl/BaseSearchServiceImpl.java"
click node_media_uploads "https://github.com/quancao2310/hms-backend/blob/main/services/appointment-service/src/main/java/com/example/hms/appointmentservice/services/impl/CloudinaryServiceImpl.java"
click node_medical_records "https://github.com/quancao2310/hms-backend/tree/main/services/medical-record-service/src/main/java/com/example/hms/medicalrecordservice/medicalrecord"
click node_medical_info "https://github.com/quancao2310/hms-backend/tree/main/services/medical-record-service/src/main/java/com/example/hms/medicalrecordservice/medicalinfo"
click node_allergies "https://github.com/quancao2310/hms-backend/tree/main/services/medical-record-service/src/main/java/com/example/hms/medicalrecordservice/allergy"
click node_family_history "https://github.com/quancao2310/hms-backend/tree/main/services/medical-record-service/src/main/java/com/example/hms/medicalrecordservice/familyhistory"
click node_medication_history "https://github.com/quancao2310/hms-backend/tree/main/services/medical-record-service/src/main/java/com/example/hms/medicalrecordservice/medicationhistory"
click node_patient_service "https://github.com/quancao2310/hms-backend/tree/main/services/patient-facing-service/src/main"
click node_staff_service "https://github.com/quancao2310/hms-backend/tree/main/services/staff-service/src/main"
click node_external_entities "https://github.com/quancao2310/hms-backend/tree/main/shared-entities/external/src/main"
click node_internal_entities "https://github.com/quancao2310/hms-backend/tree/main/shared-entities/internal/src/main"

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_gateway,node_discovery,node_configuration toneBlue
class node_appointments,node_time_slots,node_doctor_slots,node_appointment_search,node_media_uploads toneAmber
class node_medical_records,node_medical_info,node_allergies,node_family_history,node_medication_history toneMint
class node_patient_service,node_staff_service toneRose
class node_external_entities,node_internal_entities toneIndigo
```

## Components

### Platform Services

- [API Gateway](https://github.com/quancao2310/hms-backend/blob/main/services/gateway/src/main/java/com/example/hms/gateway/GatewayApplication.java): `services/gateway/src/main/java/com/example/hms/gateway/GatewayApplication.java`
- [Service Discovery](https://github.com/quancao2310/hms-backend/blob/main/services/eureka-server/src/main/java/com/example/hms/eurekaserver/EurekaServerApplication.java): `services/eureka-server/src/main/java/com/example/hms/eurekaserver/EurekaServerApplication.java`
- [Central Configuration](https://github.com/quancao2310/hms-backend/tree/main/services/config-server/src/main/resources/configuration): `services/config-server/src/main/resources/configuration`

### Appointment Management

- [Appointments](https://github.com/quancao2310/hms-backend/blob/main/services/appointment-service/src/main/java/com/example/hms/appointmentservice/services/impl/AppointmentServiceImpl.java): `services/appointment-service/src/main/java/com/example/hms/appointmentservice/services/impl/AppointmentServiceImpl.java`
- [Time Slots](https://github.com/quancao2310/hms-backend/blob/main/services/appointment-service/src/main/java/com/example/hms/appointmentservice/services/impl/TimeSlotServiceImpl.java): `services/appointment-service/src/main/java/com/example/hms/appointmentservice/services/impl/TimeSlotServiceImpl.java`
- [Doctor Availability](https://github.com/quancao2310/hms-backend/blob/main/services/appointment-service/src/main/java/com/example/hms/appointmentservice/services/impl/DoctorTimeSlotServiceImpl.java): `services/appointment-service/src/main/java/com/example/hms/appointmentservice/services/impl/DoctorTimeSlotServiceImpl.java`
- [Appointment Search](https://github.com/quancao2310/hms-backend/blob/main/services/appointment-service/src/main/java/com/example/hms/appointmentservice/services/impl/BaseSearchServiceImpl.java): `services/appointment-service/src/main/java/com/example/hms/appointmentservice/services/impl/BaseSearchServiceImpl.java`
- [Image Uploads](https://github.com/quancao2310/hms-backend/blob/main/services/appointment-service/src/main/java/com/example/hms/appointmentservice/services/impl/CloudinaryServiceImpl.java): `services/appointment-service/src/main/java/com/example/hms/appointmentservice/services/impl/CloudinaryServiceImpl.java`

### Medical Records

- [Medical Records](https://github.com/quancao2310/hms-backend/tree/main/services/medical-record-service/src/main/java/com/example/hms/medicalrecordservice/medicalrecord): `services/medical-record-service/src/main/java/com/example/hms/medicalrecordservice/medicalrecord`
- [Medical Information](https://github.com/quancao2310/hms-backend/tree/main/services/medical-record-service/src/main/java/com/example/hms/medicalrecordservice/medicalinfo): `services/medical-record-service/src/main/java/com/example/hms/medicalrecordservice/medicalinfo`
- [Allergies](https://github.com/quancao2310/hms-backend/tree/main/services/medical-record-service/src/main/java/com/example/hms/medicalrecordservice/allergy): `services/medical-record-service/src/main/java/com/example/hms/medicalrecordservice/allergy`
- [Family History](https://github.com/quancao2310/hms-backend/tree/main/services/medical-record-service/src/main/java/com/example/hms/medicalrecordservice/familyhistory): `services/medical-record-service/src/main/java/com/example/hms/medicalrecordservice/familyhistory`
- [Medication History](https://github.com/quancao2310/hms-backend/tree/main/services/medical-record-service/src/main/java/com/example/hms/medicalrecordservice/medicationhistory): `services/medical-record-service/src/main/java/com/example/hms/medicalrecordservice/medicationhistory`

### User Services

- [Patient Service](https://github.com/quancao2310/hms-backend/tree/main/services/patient-facing-service/src/main): `services/patient-facing-service/src/main`
- [Staff Service](https://github.com/quancao2310/hms-backend/tree/main/services/staff-service/src/main): `services/staff-service/src/main`

### Shared Models

- [External Entities](https://github.com/quancao2310/hms-backend/tree/main/shared-entities/external/src/main): `shared-entities/external/src/main`
- [Internal Entities](https://github.com/quancao2310/hms-backend/tree/main/shared-entities/internal/src/main): `shared-entities/internal/src/main`
