# haiphong2206win-collab/phong_kham_nha_khoa architecture

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

- Interactive diagram: https://gitdiagram.com/haiphong2206win-collab/phong_kham_nha_khoa
- Repository: https://github.com/haiphong2206win-collab/phong_kham_nha_khoa

## Overview

This repository appears to be a Spring-based dental-clinic management API. Its principal workflow is appointment requests and scheduling, with separate capabilities for assigning appointments, managing patient records, and tracking treatment plans and sessions. Authentication, account administration, and notifications support those workflows. The tree shows controller, service, and repository layers, but no README or source excerpts were provided; the dashed links below are therefore architectural inferences, not verified calls.

Main entry points: [`src/main/java/com/example/clinic/demo_phongkham_nhakhoa/repository`](https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/tree/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/repository) (Clinic database), [`src/main/java/com/example/clinic/demo_phongkham_nhakhoa/controller/XacThucController.java`](https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/controller/XacThucController.java) (Authentication API), [`src/main/java/com/example/clinic/demo_phongkham_nhakhoa/service/YeuCauDatLichService.java`](https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/service/YeuCauDatLichService.java) (Appointment requests), [`src/main/java/com/example/clinic/demo_phongkham_nhakhoa/service/TaiKhoanService.java`](https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/service/TaiKhoanService.java) (Account management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and access"]
  node_appointment_api["Appointment requests API"]
  node_request_admin_api["Request management API"]
  node_schedule_api["Doctor schedule API"]
  node_auth_api["Authentication API"]
  node_jwt_filter["JWT filter"]
end

subgraph group_scheduling["Scheduling"]
  node_appointment_service["Appointment requests"]
  node_assignment_service["Schedule assignment"]
  node_assignment_api["Assignment API"]
  node_schedule_service["Doctor scheduling"]
end

subgraph group_care["Patient care"]
  node_treatment_api["Treatment plan API"]
  node_treatment_service["Treatment plans"]
  node_session_api["Treatment session API"]
  node_session_service["Treatment sessions"]
end

subgraph group_platform["Accounts and data"]
  node_account_api["Account API"]
  node_account_service["Account management"]
  node_notification_service["Notifications"]
  node_clinic_data[("Clinic database")]
end

node_patient(("Patient"))
node_staff(("Clinic staff"))

node_patient -.->|"submits requests"| node_appointment_api
node_staff -.->|"reviews requests"| node_request_admin_api
node_staff -.->|"assigns schedules"| node_assignment_api
node_appointment_api -.->|"handles requests"| node_appointment_service
node_request_admin_api -.->|"manages requests"| node_appointment_service
node_assignment_api -.->|"assigns appointments"| node_assignment_service
node_schedule_api -.->|"manages schedules"| node_schedule_service
node_staff -.->|"manages care"| node_treatment_api
node_treatment_api -.->|"manages plans"| node_treatment_service
node_staff -.->|"records treatment"| node_session_api
node_session_api -.->|"manages sessions"| node_session_service
node_patient -.->|"authenticates"| node_auth_api
node_staff -.->|"authenticates"| node_auth_api
node_auth_api -.->|"authenticates accounts"| node_account_service
node_account_api -.->|"manages accounts"| node_account_service
node_jwt_filter -.->|"protects requests"| node_auth_api
node_appointment_service -.->|"accesses records"| node_clinic_data
node_assignment_service -.->|"accesses records"| node_clinic_data
node_schedule_service -.->|"accesses records"| node_clinic_data
node_treatment_service -.->|"accesses records"| node_clinic_data
node_session_service -.->|"accesses records"| node_clinic_data
node_account_service -.->|"accesses records"| node_clinic_data

click node_appointment_api "https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/controller/YeuCauDatLichController.java"
click node_request_admin_api "https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/controller/QuanLyYeuCauDatLichController.java"
click node_schedule_api "https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/controller/BacSiLichKhamController.java"
click node_auth_api "https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/controller/XacThucController.java"
click node_jwt_filter "https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/security/JwtAuthenticationFilter.java"
click node_appointment_service "https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/service/YeuCauDatLichService.java"
click node_assignment_service "https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/service/PhanCongLichService.java"
click node_assignment_api "https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/controller/PhanCongController.java"
click node_schedule_service "https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/service/BacSiLichKhamService.java"
click node_treatment_api "https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/controller/LoTrinhDieuTriController.java"
click node_treatment_service "https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/service/LoTrinhDieuTriService.java"
click node_session_api "https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/controller/BuoiDieuTriController.java"
click node_session_service "https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/service/BuoiDieuTriService.java"
click node_account_api "https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/controller/TaiKhoanController.java"
click node_account_service "https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/service/TaiKhoanService.java"
click node_notification_service "https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/service/ThongBaoService.java"
click node_clinic_data "https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/tree/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/repository"

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_appointment_api,node_request_admin_api,node_schedule_api,node_auth_api,node_jwt_filter toneBlue
class node_appointment_service,node_assignment_service,node_assignment_api,node_schedule_service toneAmber
class node_treatment_api,node_treatment_service,node_session_api,node_session_service toneMint
class node_account_api,node_account_service,node_notification_service,node_clinic_data toneRose
class node_patient,node_staff toneIndigo
```

## Components

### API and access

- [Appointment requests API](https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/controller/YeuCauDatLichController.java): `src/main/java/com/example/clinic/demo_phongkham_nhakhoa/controller/YeuCauDatLichController.java`
- [Request management API](https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/controller/QuanLyYeuCauDatLichController.java): `src/main/java/com/example/clinic/demo_phongkham_nhakhoa/controller/QuanLyYeuCauDatLichController.java`
- [Doctor schedule API](https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/controller/BacSiLichKhamController.java): `src/main/java/com/example/clinic/demo_phongkham_nhakhoa/controller/BacSiLichKhamController.java`
- [Authentication API](https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/controller/XacThucController.java): `src/main/java/com/example/clinic/demo_phongkham_nhakhoa/controller/XacThucController.java`
- [JWT filter](https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/security/JwtAuthenticationFilter.java): `src/main/java/com/example/clinic/demo_phongkham_nhakhoa/security/JwtAuthenticationFilter.java`

### Scheduling

- [Appointment requests](https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/service/YeuCauDatLichService.java): `src/main/java/com/example/clinic/demo_phongkham_nhakhoa/service/YeuCauDatLichService.java`
- [Schedule assignment](https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/service/PhanCongLichService.java): `src/main/java/com/example/clinic/demo_phongkham_nhakhoa/service/PhanCongLichService.java`
- [Assignment API](https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/controller/PhanCongController.java): `src/main/java/com/example/clinic/demo_phongkham_nhakhoa/controller/PhanCongController.java`
- [Doctor scheduling](https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/service/BacSiLichKhamService.java): `src/main/java/com/example/clinic/demo_phongkham_nhakhoa/service/BacSiLichKhamService.java`

### Patient care

- [Treatment plan API](https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/controller/LoTrinhDieuTriController.java): `src/main/java/com/example/clinic/demo_phongkham_nhakhoa/controller/LoTrinhDieuTriController.java`
- [Treatment plans](https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/service/LoTrinhDieuTriService.java): `src/main/java/com/example/clinic/demo_phongkham_nhakhoa/service/LoTrinhDieuTriService.java`
- [Treatment session API](https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/controller/BuoiDieuTriController.java): `src/main/java/com/example/clinic/demo_phongkham_nhakhoa/controller/BuoiDieuTriController.java`
- [Treatment sessions](https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/service/BuoiDieuTriService.java): `src/main/java/com/example/clinic/demo_phongkham_nhakhoa/service/BuoiDieuTriService.java`

### Accounts and data

- [Account API](https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/controller/TaiKhoanController.java): `src/main/java/com/example/clinic/demo_phongkham_nhakhoa/controller/TaiKhoanController.java`
- [Account management](https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/service/TaiKhoanService.java): `src/main/java/com/example/clinic/demo_phongkham_nhakhoa/service/TaiKhoanService.java`
- [Notifications](https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/blob/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/service/ThongBaoService.java): `src/main/java/com/example/clinic/demo_phongkham_nhakhoa/service/ThongBaoService.java`
- [Clinic database](https://github.com/haiphong2206win-collab/phong_kham_nha_khoa/tree/main/src/main/java/com/example/clinic/demo_phongkham_nhakhoa/repository): `src/main/java/com/example/clinic/demo_phongkham_nhakhoa/repository`

### Other components

- **Patient**
- **Clinic staff**

## Connections

- Patient → Appointment requests API: submits requests
- Clinic staff → Request management API: reviews requests
- Clinic staff → Assignment API: assigns schedules
- Appointment requests API → Appointment requests: handles requests
- Request management API → Appointment requests: manages requests
- Assignment API → Schedule assignment: assigns appointments
- Doctor schedule API → Doctor scheduling: manages schedules
- Clinic staff → Treatment plan API: manages care
- Treatment plan API → Treatment plans: manages plans
- Clinic staff → Treatment session API: records treatment
- Treatment session API → Treatment sessions: manages sessions
- Patient → Authentication API: authenticates
- Clinic staff → Authentication API: authenticates
- Authentication API → Account management: authenticates accounts
- Account API → Account management: manages accounts
- JWT filter → Authentication API: protects requests
- Appointment requests → Clinic database: accesses records
- Schedule assignment → Clinic database: accesses records
- Doctor scheduling → Clinic database: accesses records
- Treatment plans → Clinic database: accesses records
- Treatment sessions → Clinic database: accesses records
- Account management → Clinic database: accesses records
