# orebenson/nhs_project architecture

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

- Interactive diagram: https://gitdiagram.com/orebenson/nhs_project
- Repository: https://github.com/orebenson/nhs_project

## Overview

This is a Spring-based lymphoedema service application for patients and nurses. Patients record diary entries and measurements, review progress, manage appointments, and submit pre-appointment and quality-of-life questionnaires; nurses manage patient records and treatment plans. The README also describes notifications and lymphoedema information. The graph emphasizes these product workflows and their controller/service boundaries. Source excerpts are incomplete, so storage internals and some unsampled subsystem connections are not expanded.

Main entry points: [`src/main/java/nhs/uhdb/NHS_project/admin/controllers/AdminAccountController.java`](https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/admin/controllers/AdminAccountController.java) (Patient administration), [`src/main/java/nhs/uhdb/NHS_project/diary/controllers/DiaryEntryController.java`](https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/diary/controllers/DiaryEntryController.java) (Diary entry), [`src/main/java/nhs/uhdb/NHS_project/questionnaire/controller/QuestionnairesController.java`](https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/questionnaire/controller/QuestionnairesController.java) (Questionnaire history), [`src/main/java/nhs/uhdb/NHS_project/diary/services/DiaryEntryService.java`](https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/diary/services/DiaryEntryService.java) (Diary service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_accounts["Accounts"]
  node_account_service["User service<br/>[UserService.java]"]
  node_user_record["User record<br/>[User.java]"]
end

subgraph group_patient["Patient tools"]
  node_diary_controller["Diary entry"]
  node_diary_service["Diary service"]
  node_diary_data["Diary and progress<br/>[DiaryEntry.java]"]
  node_appointment_service["Appointments"]
end

subgraph group_clinical["Clinical management"]
  node_exercise_service["Plan exercises"]
  node_exercise_record["Exercise catalog<br/>[Exercise.java]"]
  node_admin_controller["Patient administration"]
  node_treatment_service["Treatment plans"]
  node_treatment_record["Treatment plan<br/>[TreatmentPlan.java]"]
end

subgraph group_questionnaires["Questionnaires"]
  node_questionnaire_controller["Questionnaire history"]
  node_preappointment_service["Pre-appointment responses"]
  node_qol_service["Quality-of-life responses"]
  node_preappointment_record["Pre-appointment response"]
  node_qol_record["Quality-of-life responses<br/>[QolResponse.java]"]
end

subgraph group_information["Information and reminders"]
  node_information["Lymphoedema information"]
  node_notification_controller["Reminder settings"]
  node_notification_service["Email reminders"]
end

node_patient(("Patient"))
node_nurse(("Nurse"))
node_mail_service["Email delivery"]

node_patient -->|"records entries"| node_diary_controller
node_diary_controller -->|"resolves patient"| node_account_service
node_diary_controller -->|"saves and retrieves"| node_diary_service
node_diary_controller -->|"loads exercises"| node_exercise_service
node_diary_service -->|"handles entries"| node_diary_data
node_exercise_service -->|"uses exercises"| node_exercise_record
node_patient -->|"reviews submissions"| node_questionnaire_controller
node_questionnaire_controller -->|"resolves patient"| node_account_service
node_questionnaire_controller -->|"loads history"| node_preappointment_service
node_questionnaire_controller -->|"loads history"| node_qol_service
node_preappointment_service -->|"handles responses"| node_preappointment_record
node_qol_service -->|"handles responses"| node_qol_record
node_nurse -->|"manages patients"| node_admin_controller
node_admin_controller -->|"looks up users"| node_account_service
node_admin_controller -->|"loads patient plan"| node_treatment_service
node_treatment_service -->|"handles plans"| node_treatment_record
node_admin_controller -->|"loads diary history"| node_diary_service
node_admin_controller -->|"loads questionnaire history"| node_preappointment_service
node_patient -->|"views guidance"| node_information
node_patient -->|"sets reminders"| node_notification_controller
node_notification_controller -->|"dispatches reminders"| node_notification_service
node_notification_service -->|"sends email"| node_mail_service

click node_account_service "https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/accounts/service/UserService.java"
click node_user_record "https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/accounts/model/User.java"
click node_diary_controller "https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/diary/controllers/DiaryEntryController.java"
click node_diary_service "https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/diary/services/DiaryEntryService.java"
click node_diary_data "https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/diary/model/DiaryEntry.java"
click node_appointment_service "https://github.com/orebenson/nhs_project/tree/main/src/main/java/nhs/uhdb/NHS_project/diary/services"
click node_exercise_service "https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/admin/service/ExerciseService.java"
click node_exercise_record "https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/admin/model/Exercise.java"
click node_admin_controller "https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/admin/controllers/AdminAccountController.java"
click node_treatment_service "https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/admin/service/TreatmentPlanService.java"
click node_treatment_record "https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/admin/model/TreatmentPlan.java"
click node_questionnaire_controller "https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/questionnaire/controller/QuestionnairesController.java"
click node_preappointment_service "https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/questionnaire/service/PreappointmentResponseService.java"
click node_qol_service "https://github.com/orebenson/nhs_project/tree/main/src/main/java/nhs/uhdb/NHS_project/questionnaire/service"
click node_preappointment_record "https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/questionnaire/model/PreappointmentResponse.java"
click node_qol_record "https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/questionnaire/model/QolResponse.java"
click node_information "https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/information/InformationController.java"
click node_notification_controller "https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/notifications/controller/NotificationController.java"
click node_notification_service "https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/notifications/service/NotificationService.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_account_service,node_user_record toneBlue
class node_diary_controller,node_diary_service,node_diary_data,node_appointment_service toneAmber
class node_exercise_service,node_exercise_record,node_admin_controller,node_treatment_service,node_treatment_record toneMint
class node_questionnaire_controller,node_preappointment_service,node_qol_service,node_preappointment_record,node_qol_record toneRose
class node_information,node_notification_controller,node_notification_service,node_patient,node_nurse,node_mail_service toneIndigo
```

## Components

### Accounts

- [User service](https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/accounts/service/UserService.java): `src/main/java/nhs/uhdb/NHS_project/accounts/service/UserService.java`
- [User record](https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/accounts/model/User.java): `src/main/java/nhs/uhdb/NHS_project/accounts/model/User.java`

### Patient tools

- [Diary entry](https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/diary/controllers/DiaryEntryController.java): `src/main/java/nhs/uhdb/NHS_project/diary/controllers/DiaryEntryController.java`
- [Diary service](https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/diary/services/DiaryEntryService.java): `src/main/java/nhs/uhdb/NHS_project/diary/services/DiaryEntryService.java`
- [Diary and progress](https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/diary/model/DiaryEntry.java): `src/main/java/nhs/uhdb/NHS_project/diary/model/DiaryEntry.java`
- [Appointments](https://github.com/orebenson/nhs_project/tree/main/src/main/java/nhs/uhdb/NHS_project/diary/services): `src/main/java/nhs/uhdb/NHS_project/diary/services`

### Clinical management

- [Plan exercises](https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/admin/service/ExerciseService.java): `src/main/java/nhs/uhdb/NHS_project/admin/service/ExerciseService.java`
- [Exercise catalog](https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/admin/model/Exercise.java): `src/main/java/nhs/uhdb/NHS_project/admin/model/Exercise.java`
- [Patient administration](https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/admin/controllers/AdminAccountController.java): `src/main/java/nhs/uhdb/NHS_project/admin/controllers/AdminAccountController.java`
- [Treatment plans](https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/admin/service/TreatmentPlanService.java): `src/main/java/nhs/uhdb/NHS_project/admin/service/TreatmentPlanService.java`
- [Treatment plan](https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/admin/model/TreatmentPlan.java): `src/main/java/nhs/uhdb/NHS_project/admin/model/TreatmentPlan.java`

### Questionnaires

- [Questionnaire history](https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/questionnaire/controller/QuestionnairesController.java): `src/main/java/nhs/uhdb/NHS_project/questionnaire/controller/QuestionnairesController.java`
- [Pre-appointment responses](https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/questionnaire/service/PreappointmentResponseService.java): `src/main/java/nhs/uhdb/NHS_project/questionnaire/service/PreappointmentResponseService.java`
- [Quality-of-life responses](https://github.com/orebenson/nhs_project/tree/main/src/main/java/nhs/uhdb/NHS_project/questionnaire/service): `src/main/java/nhs/uhdb/NHS_project/questionnaire/service`
- [Pre-appointment response](https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/questionnaire/model/PreappointmentResponse.java): `src/main/java/nhs/uhdb/NHS_project/questionnaire/model/PreappointmentResponse.java`
- [Quality-of-life responses](https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/questionnaire/model/QolResponse.java): `src/main/java/nhs/uhdb/NHS_project/questionnaire/model/QolResponse.java`

### Information and reminders

- [Lymphoedema information](https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/information/InformationController.java): `src/main/java/nhs/uhdb/NHS_project/information/InformationController.java`
- [Reminder settings](https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/notifications/controller/NotificationController.java): `src/main/java/nhs/uhdb/NHS_project/notifications/controller/NotificationController.java`
- [Email reminders](https://github.com/orebenson/nhs_project/blob/main/src/main/java/nhs/uhdb/NHS_project/notifications/service/NotificationService.java): `src/main/java/nhs/uhdb/NHS_project/notifications/service/NotificationService.java`

### Other components

- **Patient**
- **Nurse**
- **Email delivery**

## Connections

- Patient → Diary entry: records entries
- Diary entry → User service: resolves patient (evidence: `src/main/java/nhs/uhdb/NHS_project/diary/controllers/DiaryEntryController.java`)
- Diary entry → Diary service: saves and retrieves (evidence: `src/main/java/nhs/uhdb/NHS_project/diary/controllers/DiaryEntryController.java`)
- Diary entry → Plan exercises: loads exercises (evidence: `src/main/java/nhs/uhdb/NHS_project/diary/controllers/DiaryEntryController.java`)
- Diary service → Diary and progress: handles entries (evidence: `src/main/java/nhs/uhdb/NHS_project/diary/services/DiaryEntryService.java`)
- Plan exercises → Exercise catalog: uses exercises (evidence: `src/main/java/nhs/uhdb/NHS_project/admin/service/ExerciseService.java`)
- Patient → Questionnaire history: reviews submissions
- Questionnaire history → User service: resolves patient (evidence: `src/main/java/nhs/uhdb/NHS_project/questionnaire/controller/QuestionnairesController.java`)
- Questionnaire history → Pre-appointment responses: loads history (evidence: `src/main/java/nhs/uhdb/NHS_project/questionnaire/controller/QuestionnairesController.java`)
- Questionnaire history → Quality-of-life responses: loads history (evidence: `src/main/java/nhs/uhdb/NHS_project/questionnaire/controller/QuestionnairesController.java`)
- Pre-appointment responses → Pre-appointment response: handles responses (evidence: `src/main/java/nhs/uhdb/NHS_project/questionnaire/service/PreappointmentResponseService.java`)
- Quality-of-life responses → Quality-of-life responses: handles responses (evidence: `src/main/java/nhs/uhdb/NHS_project/questionnaire/service/QolResponseBreastService.java`)
- Nurse → Patient administration: manages patients
- Patient administration → User service: looks up users (evidence: `src/main/java/nhs/uhdb/NHS_project/admin/controllers/AdminAccountController.java`)
- Patient administration → Treatment plans: loads patient plan (evidence: `src/main/java/nhs/uhdb/NHS_project/admin/controllers/AdminAccountController.java`)
- Treatment plans → Treatment plan: handles plans (evidence: `src/main/java/nhs/uhdb/NHS_project/admin/service/TreatmentPlanService.java`)
- Patient administration → Diary service: loads diary history (evidence: `src/main/java/nhs/uhdb/NHS_project/admin/controllers/AdminAccountController.java`)
- Patient administration → Pre-appointment responses: loads questionnaire history (evidence: `src/main/java/nhs/uhdb/NHS_project/admin/controllers/AdminAccountController.java`)
- Patient → Lymphoedema information: views guidance
- Patient → Reminder settings: sets reminders
- Reminder settings → Email reminders: dispatches reminders (evidence: `src/main/java/nhs/uhdb/NHS_project/notifications/controller/NotificationController.java`)
- Email reminders → Email delivery: sends email (evidence: `src/main/java/nhs/uhdb/NHS_project/notifications/service/NotificationService.java`)
