# brendanboedy/clinic architecture

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

- Interactive diagram: https://gitdiagram.com/brendanboedy/clinic
- Repository: https://github.com/brendanboedy/clinic

## Overview

Clinic is a patient, physician, and appointment management system. Users interact through a terminal CLI or a .NET MAUI app; both use shared service proxies to retrieve and change data through an HTTP API. The API delegates domain operations to enterprise components and keeps data in in-memory lists or appointment file storage. The sampled code supports these client and server layers, but does not show the complete MAUI startup/navigation wiring or prove how HTTP requests are routed to API controllers; those links are omitted or marked unverified.

Main entry points: [`Clinic.Maui/ViewModels`](https://github.com/brendanboedy/clinic/tree/main/Clinic.Maui/ViewModels) (MAUI view models), [`Clinic.CLI/Program.cs`](https://github.com/brendanboedy/clinic/blob/main/Clinic.CLI/Program.cs) (Terminal client), [`Clinic.API/Clinic.API/Enterprise/AppointmentEC.cs`](https://github.com/brendanboedy/clinic/blob/main/Clinic.API/Clinic.API/Enterprise/AppointmentEC.cs) (Appointment operations), [`Clinic.Library/Services/AppointmentServiceProxy.cs`](https://github.com/brendanboedy/clinic/blob/main/Clinic.Library/Services/AppointmentServiceProxy.cs) (Appointment service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User clients"]
  node_maui_views["MAUI views<br/>[Views]"]
  node_maui_vm["MAUI view models<br/>[ViewModels]"]
  node_cli["Terminal client<br/>[Program.cs]"]
end

subgraph group_shared["Shared client library"]
  node_patient_model["Patient model<br/>[Patient.cs]"]
  node_physician_model["Physician model<br/>[Physician.cs]"]
  node_appointment_model["Appointment model<br/>[Appointment.cs]"]
  node_appointment_dto["Appointment DTO<br/>[AppointmentDTO.cs]"]
  node_patient_proxy["Patient service"]
  node_physician_proxy["Physician service"]
  node_appointment_proxy["Appointment service"]
  node_web_handler["HTTP request handler"]
end

subgraph group_api["Clinic API"]
  node_api_service["Clinic HTTP API"]
  node_patient_controller["Patient endpoints"]
  node_physician_controller["Physician endpoints"]
  node_appointment_controller["Appointment endpoints"]
  node_patient_ec["Patient operations<br/>[PatientEC.cs]"]
  node_physician_ec["Physician operations<br/>[PhysicianEC.cs]"]
  node_appointment_ec["Appointment operations<br/>[AppointmentEC.cs]"]
end

subgraph group_data["Data storage"]
  node_fake_db[("In-memory records<br/>[FakeDatabase.cs]")]
  node_filebase[("Appointment file store<br/>[Filebase.cs]")]
end

node_user(("Clinic user"))

node_user -->|"uses app"| node_maui_views
node_user -->|"uses terminal"| node_cli
node_maui_views -->|"binds to"| node_maui_vm
node_maui_vm -->|"calls"| node_patient_proxy
node_maui_vm -->|"calls"| node_physician_proxy
node_maui_vm -->|"calls"| node_appointment_proxy
node_maui_vm -->|"uses"| node_patient_model
node_maui_vm -->|"uses"| node_physician_model
node_maui_vm -->|"edits"| node_appointment_dto
node_maui_vm -->|"opens appointment form"| node_maui_vm
node_cli -->|"calls"| node_patient_proxy
node_cli -->|"calls"| node_physician_proxy
node_cli -->|"calls"| node_appointment_proxy
node_patient_proxy -->|"sends requests"| node_web_handler
node_physician_proxy -->|"sends requests"| node_web_handler
node_appointment_proxy -->|"sends requests"| node_web_handler
node_appointment_proxy -->|"serializes"| node_appointment_dto
node_web_handler -.->|"HTTP requests"| node_api_service
node_api_service -.->|"routes to"| node_patient_controller
node_api_service -.->|"routes to"| node_physician_controller
node_api_service -.->|"routes to"| node_appointment_controller
node_patient_controller -->|"delegates to"| node_patient_ec
node_physician_controller -->|"delegates to"| node_physician_ec
node_appointment_controller -->|"delegates to"| node_appointment_ec
node_patient_ec -->|"accesses records"| node_fake_db
node_physician_ec -->|"accesses records"| node_fake_db
node_appointment_ec -->|"reads and writes"| node_filebase
node_patient_controller -->|"uses"| node_patient_model
node_physician_controller -->|"uses"| node_physician_model
node_appointment_controller -->|"uses"| node_appointment_dto
node_appointment_ec -->|"converts"| node_appointment_dto
node_appointment_ec -->|"uses"| node_appointment_model

click node_maui_views "https://github.com/brendanboedy/clinic/tree/main/Clinic.Maui/Views"
click node_maui_vm "https://github.com/brendanboedy/clinic/tree/main/Clinic.Maui/ViewModels"
click node_cli "https://github.com/brendanboedy/clinic/blob/main/Clinic.CLI/Program.cs"
click node_patient_model "https://github.com/brendanboedy/clinic/blob/main/Clinic.Library/Models/Patient.cs"
click node_physician_model "https://github.com/brendanboedy/clinic/blob/main/Clinic.Library/Models/Physician.cs"
click node_appointment_model "https://github.com/brendanboedy/clinic/blob/main/Clinic.Library/Models/Appointment.cs"
click node_appointment_dto "https://github.com/brendanboedy/clinic/blob/main/Clinic.Library/DTO/AppointmentDTO.cs"
click node_patient_proxy "https://github.com/brendanboedy/clinic/blob/main/Clinic.Library/Services/PatientServiceProxy.cs"
click node_physician_proxy "https://github.com/brendanboedy/clinic/blob/main/Clinic.Library/Services/PhysicianServiceProxy.cs"
click node_appointment_proxy "https://github.com/brendanboedy/clinic/blob/main/Clinic.Library/Services/AppointmentServiceProxy.cs"
click node_web_handler "https://github.com/brendanboedy/clinic/blob/main/Clinic.Library/Utilities/WebRequestHandler.cs"
click node_patient_controller "https://github.com/brendanboedy/clinic/blob/main/Clinic.API/Clinic.API/Controllers/PatientController.cs"
click node_physician_controller "https://github.com/brendanboedy/clinic/blob/main/Clinic.API/Clinic.API/Controllers/PhysicianController.cs"
click node_appointment_controller "https://github.com/brendanboedy/clinic/blob/main/Clinic.API/Clinic.API/Controllers/AppointmentController.cs"
click node_patient_ec "https://github.com/brendanboedy/clinic/blob/main/Clinic.API/Clinic.API/Enterprise/PatientEC.cs"
click node_physician_ec "https://github.com/brendanboedy/clinic/blob/main/Clinic.API/Clinic.API/Enterprise/PhysicianEC.cs"
click node_appointment_ec "https://github.com/brendanboedy/clinic/blob/main/Clinic.API/Clinic.API/Enterprise/AppointmentEC.cs"
click node_fake_db "https://github.com/brendanboedy/clinic/blob/main/Clinic.API/Clinic.API/Database/FakeDatabase.cs"
click node_filebase "https://github.com/brendanboedy/clinic/blob/main/Clinic.API/Clinic.API/Database/Filebase.cs"

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_maui_views,node_maui_vm,node_cli,node_user toneBlue
class node_patient_model,node_physician_model,node_appointment_model,node_appointment_dto,node_patient_proxy,node_physician_proxy,node_appointment_proxy,node_web_handler toneAmber
class node_api_service,node_patient_controller,node_physician_controller,node_appointment_controller,node_patient_ec,node_physician_ec,node_appointment_ec toneMint
class node_fake_db,node_filebase toneRose
```

## Components

### User clients

- [MAUI views](https://github.com/brendanboedy/clinic/tree/main/Clinic.Maui/Views): `Clinic.Maui/Views`
- [MAUI view models](https://github.com/brendanboedy/clinic/tree/main/Clinic.Maui/ViewModels): `Clinic.Maui/ViewModels`
- [Terminal client](https://github.com/brendanboedy/clinic/blob/main/Clinic.CLI/Program.cs): `Clinic.CLI/Program.cs`

### Shared client library

- [Patient model](https://github.com/brendanboedy/clinic/blob/main/Clinic.Library/Models/Patient.cs): `Clinic.Library/Models/Patient.cs`
- [Physician model](https://github.com/brendanboedy/clinic/blob/main/Clinic.Library/Models/Physician.cs): `Clinic.Library/Models/Physician.cs`
- [Appointment model](https://github.com/brendanboedy/clinic/blob/main/Clinic.Library/Models/Appointment.cs): `Clinic.Library/Models/Appointment.cs`
- [Appointment DTO](https://github.com/brendanboedy/clinic/blob/main/Clinic.Library/DTO/AppointmentDTO.cs): `Clinic.Library/DTO/AppointmentDTO.cs`
- [Patient service](https://github.com/brendanboedy/clinic/blob/main/Clinic.Library/Services/PatientServiceProxy.cs): `Clinic.Library/Services/PatientServiceProxy.cs`
- [Physician service](https://github.com/brendanboedy/clinic/blob/main/Clinic.Library/Services/PhysicianServiceProxy.cs): `Clinic.Library/Services/PhysicianServiceProxy.cs`
- [Appointment service](https://github.com/brendanboedy/clinic/blob/main/Clinic.Library/Services/AppointmentServiceProxy.cs): `Clinic.Library/Services/AppointmentServiceProxy.cs`
- [HTTP request handler](https://github.com/brendanboedy/clinic/blob/main/Clinic.Library/Utilities/WebRequestHandler.cs): `Clinic.Library/Utilities/WebRequestHandler.cs`

### Clinic API

- **Clinic HTTP API**
- [Patient endpoints](https://github.com/brendanboedy/clinic/blob/main/Clinic.API/Clinic.API/Controllers/PatientController.cs): `Clinic.API/Clinic.API/Controllers/PatientController.cs`
- [Physician endpoints](https://github.com/brendanboedy/clinic/blob/main/Clinic.API/Clinic.API/Controllers/PhysicianController.cs): `Clinic.API/Clinic.API/Controllers/PhysicianController.cs`
- [Appointment endpoints](https://github.com/brendanboedy/clinic/blob/main/Clinic.API/Clinic.API/Controllers/AppointmentController.cs): `Clinic.API/Clinic.API/Controllers/AppointmentController.cs`
- [Patient operations](https://github.com/brendanboedy/clinic/blob/main/Clinic.API/Clinic.API/Enterprise/PatientEC.cs): `Clinic.API/Clinic.API/Enterprise/PatientEC.cs`
- [Physician operations](https://github.com/brendanboedy/clinic/blob/main/Clinic.API/Clinic.API/Enterprise/PhysicianEC.cs): `Clinic.API/Clinic.API/Enterprise/PhysicianEC.cs`
- [Appointment operations](https://github.com/brendanboedy/clinic/blob/main/Clinic.API/Clinic.API/Enterprise/AppointmentEC.cs): `Clinic.API/Clinic.API/Enterprise/AppointmentEC.cs`

### Data storage

- [In-memory records](https://github.com/brendanboedy/clinic/blob/main/Clinic.API/Clinic.API/Database/FakeDatabase.cs): `Clinic.API/Clinic.API/Database/FakeDatabase.cs`
- [Appointment file store](https://github.com/brendanboedy/clinic/blob/main/Clinic.API/Clinic.API/Database/Filebase.cs): `Clinic.API/Clinic.API/Database/Filebase.cs`

### Other components

- **Clinic user**

## Connections

- Clinic user → MAUI views: uses app
- Clinic user → Terminal client: uses terminal
- MAUI views → MAUI view models: binds to (evidence: `Clinic.Maui/Views/AppointmentView.xaml.cs`)
- MAUI view models → Patient service: calls (evidence: `Clinic.Maui/ViewModels/AddPatientViewModel.cs`)
- MAUI view models → Physician service: calls (evidence: `Clinic.Maui/ViewModels/PhysicianViewModel.cs`)
- MAUI view models → Appointment service: calls (evidence: `Clinic.Maui/ViewModels/AddAppointmentViewModel.cs`)
- MAUI view models → Patient model: uses (evidence: `Clinic.Maui/ViewModels/AddPatientViewModel.cs`)
- MAUI view models → Physician model: uses (evidence: `Clinic.Maui/ViewModels/PhysicianViewModel.cs`)
- MAUI view models → Appointment DTO: edits (evidence: `Clinic.Maui/ViewModels/AddAppointmentViewModel.cs`)
- MAUI view models → MAUI view models: opens appointment form (evidence: `Clinic.Maui/ViewModels/AppointmentViewModel.cs`)
- Terminal client → Patient service: calls (evidence: `Clinic.CLI/Program.cs`)
- Terminal client → Physician service: calls (evidence: `Clinic.CLI/Program.cs`)
- Terminal client → Appointment service: calls (evidence: `Clinic.CLI/Program.cs`)
- Patient service → HTTP request handler: sends requests (evidence: `Clinic.Library/Services/PatientServiceProxy.cs`)
- Physician service → HTTP request handler: sends requests (evidence: `Clinic.Library/Services/PhysicianServiceProxy.cs`)
- Appointment service → HTTP request handler: sends requests (evidence: `Clinic.Library/Services/AppointmentServiceProxy.cs`)
- Appointment service → Appointment DTO: serializes (evidence: `Clinic.Library/Services/AppointmentServiceProxy.cs`)
- HTTP request handler → Clinic HTTP API: HTTP requests
- Clinic HTTP API → Patient endpoints: routes to
- Clinic HTTP API → Physician endpoints: routes to
- Clinic HTTP API → Appointment endpoints: routes to
- Patient endpoints → Patient operations: delegates to (evidence: `Clinic.API/Clinic.API/Controllers/PatientController.cs`)
- Physician endpoints → Physician operations: delegates to (evidence: `Clinic.API/Clinic.API/Controllers/PhysicianController.cs`)
- Appointment endpoints → Appointment operations: delegates to (evidence: `Clinic.API/Clinic.API/Controllers/AppointmentController.cs`)
- Patient operations → In-memory records: accesses records (evidence: `Clinic.API/Clinic.API/Enterprise/PatientEC.cs`)
- Physician operations → In-memory records: accesses records (evidence: `Clinic.API/Clinic.API/Enterprise/PhysicianEC.cs`)
- Appointment operations → Appointment file store: reads and writes (evidence: `Clinic.API/Clinic.API/Enterprise/AppointmentEC.cs`)
- Patient endpoints → Patient model: uses (evidence: `Clinic.API/Clinic.API/Controllers/PatientController.cs`)
- Physician endpoints → Physician model: uses (evidence: `Clinic.API/Clinic.API/Controllers/PhysicianController.cs`)
- Appointment endpoints → Appointment DTO: uses (evidence: `Clinic.API/Clinic.API/Controllers/AppointmentController.cs`)
- Appointment operations → Appointment DTO: converts (evidence: `Clinic.API/Clinic.API/Enterprise/AppointmentEC.cs`)
- Appointment operations → Appointment model: uses (evidence: `Clinic.API/Clinic.API/Enterprise/AppointmentEC.cs`)
