# cirqlar/scamps architecture

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

- Interactive diagram: https://gitdiagram.com/cirqlar/scamps
- Repository: https://github.com/cirqlar/scamps

## Overview

This is a desktop clinic-management application. A user works through the root menu to patient management or the appointment queue: patient records can be added, edited, sorted, paged, and deleted; appointments can be created, finished, or cancelled. The app also loads and saves JSON data and exports appointment and patient reports. The graph reflects the shown app, controller, database, and view relationships; unsampled implementation details are represented only where the source index or explicit calls support them.

Main entry points: [`src/App.cpp`](https://github.com/cirqlar/scamps/blob/master/src/App.cpp) (App and routing), [`src/models/ClinicDatabase.cpp`](https://github.com/cirqlar/scamps/blob/master/src/models/ClinicDatabase.cpp) (Clinic database), [`src/views/appointments/AppointmentsView.cpp`](https://github.com/cirqlar/scamps/blob/master/src/views/appointments/AppointmentsView.cpp) (Appointment view), [`src/views/patients/PatientsView.cpp`](https://github.com/cirqlar/scamps/blob/master/src/views/patients/PatientsView.cpp) (Patient view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_application["App and routing<br/>[App.cpp]"]
  node_root["Root window<br/>[RootView.cpp]"]
  node_menu["Navigation and actions<br/>[MenuBar.cpp]"]
end

subgraph group_patients["Patient management"]
  node_patient_controller["Patient controller"]
  node_patient_view["Patient view<br/>[PatientsView.cpp]"]
  node_patient_list["Patient list<br/>[PatientsList.cpp]"]
  node_patient_editor["Patient editor<br/>[EditPatient.cpp]"]
  node_patient_input["Form inputs<br/>[Input.h]"]
end

subgraph group_appointments["Appointment management"]
  node_appointment_controller["Appointment controller"]
  node_appointment_view["Appointment view"]
  node_appointment_list["Appointment list"]
  node_appointment_details["Appointment details"]
  node_appointment_create["Create appointment"]
end

subgraph group_domain["Clinic data"]
  node_clinic_database[("Clinic database<br/>[ClinicDatabase.cpp]")]
  node_patient_records["Patient record types<br/>[PatientRecord.h]"]
  node_appointment_model["Appointment model<br/>[Appointment.h]"]
  node_serialization["JSON serializers"]
end

node_user(("Clinic user"))
node_file["JSON data file"]
node_report["Text report file"]

node_user -->|"uses"| node_root
node_application -->|"creates"| node_root
node_root -->|"renders"| node_menu
node_menu -->|"invokes actions"| node_application
node_application -->|"routes to"| node_patient_controller
node_application -->|"routes to"| node_appointment_controller
node_patient_controller -->|"reads and updates"| node_clinic_database
node_patient_controller -->|"creates and refreshes"| node_patient_view
node_patient_view -->|"dispatches actions"| node_patient_controller
node_patient_view -->|"renders"| node_patient_list
node_patient_view -->|"renders"| node_patient_editor
node_patient_editor -->|"uses"| node_patient_input
node_appointment_controller -->|"reads and updates"| node_clinic_database
node_appointment_controller -->|"creates"| node_appointment_view
node_appointment_view -->|"dispatches actions"| node_appointment_controller
node_appointment_view -->|"renders"| node_appointment_list
node_appointment_view -->|"renders"| node_appointment_details
node_appointment_view -->|"renders"| node_appointment_create
node_clinic_database -->|"stores and searches"| node_patient_records
node_clinic_database -->|"stores and updates"| node_appointment_model
node_clinic_database -->|"serializes data"| node_serialization
node_application -->|"loads and saves"| node_clinic_database
node_application -->|"chooses file for data"| node_file
node_clinic_database -->|"reads and writes JSON"| node_file
node_application -->|"exports reports"| node_report

click node_application "https://github.com/cirqlar/scamps/blob/master/src/App.cpp"
click node_root "https://github.com/cirqlar/scamps/blob/master/src/views/root/RootView.cpp"
click node_menu "https://github.com/cirqlar/scamps/blob/master/src/views/components/menu_bar/MenuBar.cpp"
click node_patient_controller "https://github.com/cirqlar/scamps/blob/master/src/controllers/patients/PatientsController.cpp"
click node_patient_view "https://github.com/cirqlar/scamps/blob/master/src/views/patients/PatientsView.cpp"
click node_patient_list "https://github.com/cirqlar/scamps/blob/master/src/views/components/patients_list/PatientsList.cpp"
click node_patient_editor "https://github.com/cirqlar/scamps/blob/master/src/views/components/edit_patient/EditPatient.cpp"
click node_patient_input "https://github.com/cirqlar/scamps/blob/master/src/views/components/input/Input.h"
click node_appointment_controller "https://github.com/cirqlar/scamps/blob/master/src/controllers/appointments/AppointmentsController.cpp"
click node_appointment_view "https://github.com/cirqlar/scamps/blob/master/src/views/appointments/AppointmentsView.cpp"
click node_appointment_list "https://github.com/cirqlar/scamps/blob/master/src/views/components/appointments_list/AppointmentsList.cpp"
click node_appointment_details "https://github.com/cirqlar/scamps/blob/master/src/views/components/appointment_details/AppointmentDetails.cpp"
click node_appointment_create "https://github.com/cirqlar/scamps/blob/master/src/views/components/create_appointment/CreateAppointment.cpp"
click node_clinic_database "https://github.com/cirqlar/scamps/blob/master/src/models/ClinicDatabase.cpp"
click node_patient_records "https://github.com/cirqlar/scamps/blob/master/src/models/patient/PatientRecord.h"
click node_appointment_model "https://github.com/cirqlar/scamps/blob/master/src/models/appointment/Appointment.h"
click node_serialization "https://github.com/cirqlar/scamps/tree/master/src/utils/serializers"

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_application,node_root,node_menu,node_user toneBlue
class node_patient_controller,node_patient_view,node_patient_list,node_patient_editor,node_patient_input toneAmber
class node_appointment_controller,node_appointment_view,node_appointment_list,node_appointment_details,node_appointment_create toneMint
class node_clinic_database,node_patient_records,node_appointment_model,node_serialization toneRose
class node_file,node_report toneIndigo
```

## Components

### Application shell

- [App and routing](https://github.com/cirqlar/scamps/blob/master/src/App.cpp): `src/App.cpp`
- [Root window](https://github.com/cirqlar/scamps/blob/master/src/views/root/RootView.cpp): `src/views/root/RootView.cpp`
- [Navigation and actions](https://github.com/cirqlar/scamps/blob/master/src/views/components/menu_bar/MenuBar.cpp): `src/views/components/menu_bar/MenuBar.cpp`

### Patient management

- [Patient controller](https://github.com/cirqlar/scamps/blob/master/src/controllers/patients/PatientsController.cpp): `src/controllers/patients/PatientsController.cpp`
- [Patient view](https://github.com/cirqlar/scamps/blob/master/src/views/patients/PatientsView.cpp): `src/views/patients/PatientsView.cpp`
- [Patient list](https://github.com/cirqlar/scamps/blob/master/src/views/components/patients_list/PatientsList.cpp): `src/views/components/patients_list/PatientsList.cpp`
- [Patient editor](https://github.com/cirqlar/scamps/blob/master/src/views/components/edit_patient/EditPatient.cpp): `src/views/components/edit_patient/EditPatient.cpp`
- [Form inputs](https://github.com/cirqlar/scamps/blob/master/src/views/components/input/Input.h): `src/views/components/input/Input.h`

### Appointment management

- [Appointment controller](https://github.com/cirqlar/scamps/blob/master/src/controllers/appointments/AppointmentsController.cpp): `src/controllers/appointments/AppointmentsController.cpp`
- [Appointment view](https://github.com/cirqlar/scamps/blob/master/src/views/appointments/AppointmentsView.cpp): `src/views/appointments/AppointmentsView.cpp`
- [Appointment list](https://github.com/cirqlar/scamps/blob/master/src/views/components/appointments_list/AppointmentsList.cpp): `src/views/components/appointments_list/AppointmentsList.cpp`
- [Appointment details](https://github.com/cirqlar/scamps/blob/master/src/views/components/appointment_details/AppointmentDetails.cpp): `src/views/components/appointment_details/AppointmentDetails.cpp`
- [Create appointment](https://github.com/cirqlar/scamps/blob/master/src/views/components/create_appointment/CreateAppointment.cpp): `src/views/components/create_appointment/CreateAppointment.cpp`

### Clinic data

- [Clinic database](https://github.com/cirqlar/scamps/blob/master/src/models/ClinicDatabase.cpp): `src/models/ClinicDatabase.cpp`
- [Patient record types](https://github.com/cirqlar/scamps/blob/master/src/models/patient/PatientRecord.h): `src/models/patient/PatientRecord.h`
- [Appointment model](https://github.com/cirqlar/scamps/blob/master/src/models/appointment/Appointment.h): `src/models/appointment/Appointment.h`
- [JSON serializers](https://github.com/cirqlar/scamps/tree/master/src/utils/serializers): `src/utils/serializers`

### Other components

- **Clinic user**
- **JSON data file**
- **Text report file**

## Connections

- Clinic user → Root window: uses
- App and routing → Root window: creates (evidence: `src/App.cpp`)
- Root window → Navigation and actions: renders (evidence: `src/views/root/RootView.cpp`)
- Navigation and actions → App and routing: invokes actions
- App and routing → Patient controller: routes to (evidence: `src/App.cpp`)
- App and routing → Appointment controller: routes to (evidence: `src/App.cpp`)
- Patient controller → Clinic database: reads and updates (evidence: `src/controllers/patients/PatientsController.cpp`)
- Patient controller → Patient view: creates and refreshes (evidence: `src/controllers/patients/PatientsController.cpp`)
- Patient view → Patient controller: dispatches actions (evidence: `src/views/patients/PatientsView.cpp`)
- Patient view → Patient list: renders (evidence: `src/views/patients/PatientsView.cpp`)
- Patient view → Patient editor: renders (evidence: `src/views/patients/PatientsView.cpp`)
- Patient editor → Form inputs: uses (evidence: `src/views/components/edit_patient/EditPatient.cpp`)
- Appointment controller → Clinic database: reads and updates (evidence: `src/controllers/appointments/AppointmentsController.cpp`)
- Appointment controller → Appointment view: creates (evidence: `src/controllers/appointments/AppointmentsController.cpp`)
- Appointment view → Appointment controller: dispatches actions (evidence: `src/views/appointments/AppointmentsView.cpp`)
- Appointment view → Appointment list: renders (evidence: `src/views/appointments/AppointmentsView.cpp`)
- Appointment view → Appointment details: renders (evidence: `src/views/appointments/AppointmentsView.cpp`)
- Appointment view → Create appointment: renders (evidence: `src/views/appointments/AppointmentsView.cpp`)
- Clinic database → Patient record types: stores and searches (evidence: `src/models/ClinicDatabase.cpp`)
- Clinic database → Appointment model: stores and updates (evidence: `src/models/ClinicDatabase.cpp`)
- Clinic database → JSON serializers: serializes data (evidence: `src/models/ClinicDatabase.cpp`)
- App and routing → Clinic database: loads and saves (evidence: `src/App.cpp`)
- App and routing → JSON data file: chooses file for data (evidence: `src/App.cpp`)
- Clinic database → JSON data file: reads and writes JSON (evidence: `src/models/ClinicDatabase.cpp`)
- App and routing → Text report file: exports reports (evidence: `src/App.cpp`)
