# alicepandaree/petappointment_project architecture

> Architecture diagram of the GitHub repository alicepandaree/petappointment_project, 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/alicepandaree/petappointment_project
- Repository: https://github.com/alicepandaree/petappointment_project

## Overview

PetAppointment is a command-line pet-clinic record manager. A user selects owners, pets, or appointments, then adds, edits, deletes, searches, or views records; startup loads all three CSV datasets and checks cross-record validity before opening the menus. Domain managers validate and convert records, while a shared manager layer handles common CRUD and persistence through CSV handlers. Optional scripts seed sample records through the same managers. The graph follows the clinic package used by main.py; root-level duplicate modules are not part of that runtime path. Unsampled manager details are represented only where README or excerpts support them.

Main entry points: [`main.py`](https://github.com/alicepandaree/petappointment_project/blob/main/main.py) (Startup loading), [`clinic/managers.py`](https://github.com/alicepandaree/petappointment_project/blob/main/clinic/managers.py) (Pet manager), [`sample_data.py`](https://github.com/alicepandaree/petappointment_project/blob/main/sample_data.py) (Sample data seeder), [`clinic/csv_handler.py`](https://github.com/alicepandaree/petappointment_project/blob/main/clinic/csv_handler.py) (CSV handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI workflow"]
  node_app["Menus and workflow<br/>[main.py]"]
  node_load["Startup loading<br/>[main.py]"]
end

subgraph group_domain["Record management"]
  node_owners["Owner manager<br/>[managers.py]"]
  node_pets["Pet manager<br/>[managers.py]"]
  node_appointments["Appointment manager<br/>[managers.py]"]
  node_base["Shared CRUD manager<br/>[managers.py]"]
  node_models["Record models<br/>[models.py]"]
end

subgraph group_storage["CSV persistence"]
  node_csv["CSV handler<br/>[csv_handler.py]"]
  node_ownerdata[("Owner CSV")]
  node_petdata[("Pet CSV")]
  node_appointmentdata[("Appointment CSV")]
end

subgraph group_seeding["Sample data"]
  node_sampleall["Sample data seeder<br/>[sample_data.py]"]
  node_sampleappts["Appointment seeder"]
end

node_user(("Clinic staff"))

node_user -->|"uses menus"| node_app
node_app -->|"loads at startup"| node_load
node_app -->|"dispatches owner actions"| node_owners
node_app -->|"dispatches pet actions"| node_pets
node_app -->|"dispatches appointment actions"| node_appointments
node_load -->|"loads and checks"| node_owners
node_load -->|"loads and checks"| node_pets
node_load -->|"loads and checks"| node_appointments
node_owners -->|"inherits CRUD"| node_base
node_pets -->|"inherits CRUD"| node_base
node_appointments -->|"inherits CRUD"| node_base
node_base -->|"reads and writes"| node_csv
node_base -->|"builds records"| node_models
node_csv -->|"reads and writes"| node_ownerdata
node_csv -->|"reads and writes"| node_petdata
node_csv -->|"reads and writes"| node_appointmentdata
node_pets -->|"checks owner references"| node_owners
node_appointments -->|"checks pet references"| node_pets
node_sampleall -->|"loads existing records"| node_load
node_sampleall -->|"creates sample owners"| node_owners
node_sampleall -->|"creates sample pets"| node_pets
node_sampleall -->|"creates sample appointments"| node_appointments
node_sampleappts -->|"loads existing records"| node_load
node_sampleappts -->|"creates sample records"| node_appointments

click node_app "https://github.com/alicepandaree/petappointment_project/blob/main/main.py"
click node_load "https://github.com/alicepandaree/petappointment_project/blob/main/main.py"
click node_owners "https://github.com/alicepandaree/petappointment_project/blob/main/clinic/managers.py"
click node_pets "https://github.com/alicepandaree/petappointment_project/blob/main/clinic/managers.py"
click node_appointments "https://github.com/alicepandaree/petappointment_project/blob/main/clinic/managers.py"
click node_base "https://github.com/alicepandaree/petappointment_project/blob/main/clinic/managers.py"
click node_models "https://github.com/alicepandaree/petappointment_project/blob/main/clinic/models.py"
click node_csv "https://github.com/alicepandaree/petappointment_project/blob/main/clinic/csv_handler.py"
click node_sampleall "https://github.com/alicepandaree/petappointment_project/blob/main/sample_data.py"
click node_sampleappts "https://github.com/alicepandaree/petappointment_project/blob/main/sample_appointments.py"

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_app,node_load toneBlue
class node_owners,node_pets,node_appointments,node_base,node_models toneAmber
class node_csv,node_ownerdata,node_petdata,node_appointmentdata toneMint
class node_sampleall,node_sampleappts toneRose
class node_user toneIndigo
```

## Components

### CLI workflow

- [Menus and workflow](https://github.com/alicepandaree/petappointment_project/blob/main/main.py): `main.py`
- [Startup loading](https://github.com/alicepandaree/petappointment_project/blob/main/main.py): `main.py`

### Record management

- [Owner manager](https://github.com/alicepandaree/petappointment_project/blob/main/clinic/managers.py): `clinic/managers.py`
- [Pet manager](https://github.com/alicepandaree/petappointment_project/blob/main/clinic/managers.py): `clinic/managers.py`
- [Appointment manager](https://github.com/alicepandaree/petappointment_project/blob/main/clinic/managers.py): `clinic/managers.py`
- [Shared CRUD manager](https://github.com/alicepandaree/petappointment_project/blob/main/clinic/managers.py): `clinic/managers.py`
- [Record models](https://github.com/alicepandaree/petappointment_project/blob/main/clinic/models.py): `clinic/models.py`

### CSV persistence

- [CSV handler](https://github.com/alicepandaree/petappointment_project/blob/main/clinic/csv_handler.py): `clinic/csv_handler.py`
- **Owner CSV**
- **Pet CSV**
- **Appointment CSV**

### Sample data

- [Sample data seeder](https://github.com/alicepandaree/petappointment_project/blob/main/sample_data.py): `sample_data.py`
- [Appointment seeder](https://github.com/alicepandaree/petappointment_project/blob/main/sample_appointments.py): `sample_appointments.py`

### Other components

- **Clinic staff**

## Connections

- Clinic staff → Menus and workflow: uses menus (evidence: `README.md`)
- Menus and workflow → Startup loading: loads at startup (evidence: `main.py`)
- Menus and workflow → Owner manager: dispatches owner actions (evidence: `main.py`)
- Menus and workflow → Pet manager: dispatches pet actions (evidence: `main.py`)
- Menus and workflow → Appointment manager: dispatches appointment actions (evidence: `main.py`)
- Startup loading → Owner manager: loads and checks (evidence: `main.py`)
- Startup loading → Pet manager: loads and checks (evidence: `main.py`)
- Startup loading → Appointment manager: loads and checks (evidence: `main.py`)
- Owner manager → Shared CRUD manager: inherits CRUD (evidence: `clinic/managers.py`)
- Pet manager → Shared CRUD manager: inherits CRUD (evidence: `clinic/managers.py`)
- Appointment manager → Shared CRUD manager: inherits CRUD (evidence: `clinic/managers.py`)
- Shared CRUD manager → CSV handler: reads and writes (evidence: `clinic/managers.py`)
- Shared CRUD manager → Record models: builds records (evidence: `clinic/managers.py`)
- CSV handler → Owner CSV: reads and writes (evidence: `README.md`)
- CSV handler → Pet CSV: reads and writes (evidence: `README.md`)
- CSV handler → Appointment CSV: reads and writes (evidence: `README.md`)
- Pet manager → Owner manager: checks owner references (evidence: `clinic/managers.py`)
- Appointment manager → Pet manager: checks pet references (evidence: `clinic/managers.py`)
- Sample data seeder → Startup loading: loads existing records (evidence: `sample_data.py`)
- Sample data seeder → Owner manager: creates sample owners (evidence: `sample_data.py`)
- Sample data seeder → Pet manager: creates sample pets (evidence: `sample_data.py`)
- Sample data seeder → Appointment manager: creates sample appointments (evidence: `sample_data.py`)
- Appointment seeder → Startup loading: loads existing records (evidence: `sample_appointments.py`)
- Appointment seeder → Appointment manager: creates sample records (evidence: `sample_appointments.py`)
