# edcel-needscoffee/petpal architecture

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

- Interactive diagram: https://gitdiagram.com/edcel-needscoffee/petpal
- Repository: https://github.com/edcel-needscoffee/petpal

## Overview

PetPal is a Java desktop application for veterinary vaccination-clinic workflows. Staff sign in, manage client and pet records, review clinic activity, record vaccinations and return visits, and print vaccination cards; administrators can maintain the vaccine catalog and account settings. The source excerpts show validation and database coordination in services, with DAO-backed persistence. Several screens and subsystems are present in the tree or README but were not sampled, so their links are marked unverified rather than asserted as observed calls.

Main entry points: [`src/main/java/com/petpal/dao`](https://github.com/edcel-needscoffee/petpal/tree/master/src/main/java/com/petpal/dao) (Database access), [`src/main/java/com/petpal/ui/WorkspacePanel.java`](https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/ui/WorkspacePanel.java) (Clinic workspace), [`src/main/java/com/petpal/ui/ClientsPetsPanel.java`](https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/ui/ClientsPetsPanel.java) (Clients and pets), [`src/main/java/com/petpal/service/VaccinationService.java`](https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/service/VaccinationService.java) (Vaccination service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop application"]
  node_app_entry["Application startup<br/>[App.java]"]
  node_login["Staff sign-in<br/>[LoginPanel.java]"]
  node_workspace["Clinic workspace"]
  node_auth_service["Authentication service<br/>[AuthService.java]"]
end

subgraph group_records["Client and pet records"]
  node_client_pet_ui["Clients and pets"]
  node_client_form["Client editor"]
  node_client_service["Client records service<br/>[ClientService.java]"]
  node_pet_service["Pet records service<br/>[PetService.java]"]
end

subgraph group_vaccination["Vaccination workflows"]
  node_vaccination_wizard["Vaccination workflow"]
  node_vaccination_service["Vaccination service"]
  node_card_print["Card printing"]
  node_catalog_ui["Vaccine catalog"]
  node_catalog_service["Catalog service"]
end

subgraph group_clinic["Clinic operations"]
  node_dashboard["Clinic dashboard"]
  node_overview_service["Clinic overview service"]
  node_appointments["Appointments and history"]
  node_return_visit["Return visit entry"]
  node_account_settings["Account settings"]
end

subgraph group_persistence["Persistence and models"]
  node_dao_layer["Database access"]
  node_db_connection["MySQL connection<br/>[DBConnection.java]"]
  node_mysql[("MySQL database")]
  node_domain_models["Domain records"]
end

node_staff(("Clinic staff"))

node_staff -.->|"starts"| node_app_entry
node_app_entry -.->|"opens"| node_login
node_login -.->|"authenticates"| node_auth_service
node_staff -.->|"signs in"| node_login
node_workspace -.->|"opens"| node_client_pet_ui
node_client_pet_ui -.->|"opens"| node_client_form
node_client_pet_ui -->|"loads and deletes"| node_client_service
node_client_form -->|"saves"| node_client_service
node_client_service -->|"accesses clients"| node_dao_layer
node_client_pet_ui -.->|"manages pets"| node_pet_service
node_pet_service -->|"accesses pets"| node_dao_layer
node_workspace -.->|"opens"| node_vaccination_wizard
node_vaccination_wizard -.->|"records doses"| node_vaccination_service
node_vaccination_service -->|"records vaccinations"| node_dao_layer
node_vaccination_wizard -.->|"prints card"| node_card_print
node_vaccination_service -->|"uses catalog"| node_catalog_service
node_catalog_ui -.->|"maintains catalog"| node_catalog_service
node_catalog_service -->|"accesses catalog"| node_dao_layer
node_workspace -.->|"opens"| node_dashboard
node_dashboard -->|"loads overview"| node_overview_service
node_overview_service -->|"loads totals"| node_dao_layer
node_workspace -.->|"opens"| node_appointments
node_appointments -.->|"records visit"| node_return_visit
node_return_visit -.->|"records next dose"| node_vaccination_service
node_account_settings -->|"records activity"| node_dao_layer
node_auth_service -->|"loads staff"| node_dao_layer
node_dao_layer -->|"opens connections"| node_db_connection
node_db_connection -->|"connects"| node_mysql

click node_app_entry "https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/App.java"
click node_login "https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/ui/LoginPanel.java"
click node_workspace "https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/ui/WorkspacePanel.java"
click node_client_pet_ui "https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/ui/ClientsPetsPanel.java"
click node_client_form "https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/ui/ClientFormDialog.java"
click node_client_service "https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/service/ClientService.java"
click node_pet_service "https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/service/PetService.java"
click node_vaccination_wizard "https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/ui/VaccinationWizard.java"
click node_vaccination_service "https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/service/VaccinationService.java"
click node_card_print "https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/ui/PrintCardDialog.java"
click node_catalog_ui "https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/ui/VaccineTypesPanel.java"
click node_catalog_service "https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/service/VaccineTypeService.java"
click node_dashboard "https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/ui/DashboardPanel.java"
click node_overview_service "https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/service/ClinicOverviewService.java"
click node_appointments "https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/ui/AppointmentsPanel.java"
click node_return_visit "https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/ui/ReturnVisitDialog.java"
click node_account_settings "https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/service/AccountSettingsService.java"
click node_auth_service "https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/service/AuthService.java"
click node_dao_layer "https://github.com/edcel-needscoffee/petpal/tree/master/src/main/java/com/petpal/dao"
click node_db_connection "https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/util/DBConnection.java"
click node_domain_models "https://github.com/edcel-needscoffee/petpal/tree/master/src/main/java/com/petpal/model"

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_entry,node_login,node_workspace,node_auth_service toneBlue
class node_client_pet_ui,node_client_form,node_client_service,node_pet_service toneAmber
class node_vaccination_wizard,node_vaccination_service,node_card_print,node_catalog_ui,node_catalog_service toneMint
class node_dashboard,node_overview_service,node_appointments,node_return_visit,node_account_settings toneRose
class node_dao_layer,node_db_connection,node_mysql,node_domain_models,node_staff toneIndigo
```

## Components

### Desktop application

- [Application startup](https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/App.java): `src/main/java/com/petpal/App.java`
- [Staff sign-in](https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/ui/LoginPanel.java): `src/main/java/com/petpal/ui/LoginPanel.java`
- [Clinic workspace](https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/ui/WorkspacePanel.java): `src/main/java/com/petpal/ui/WorkspacePanel.java`
- [Authentication service](https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/service/AuthService.java): `src/main/java/com/petpal/service/AuthService.java`

### Client and pet records

- [Clients and pets](https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/ui/ClientsPetsPanel.java): `src/main/java/com/petpal/ui/ClientsPetsPanel.java`
- [Client editor](https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/ui/ClientFormDialog.java): `src/main/java/com/petpal/ui/ClientFormDialog.java`
- [Client records service](https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/service/ClientService.java): `src/main/java/com/petpal/service/ClientService.java`
- [Pet records service](https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/service/PetService.java): `src/main/java/com/petpal/service/PetService.java`

### Vaccination workflows

- [Vaccination workflow](https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/ui/VaccinationWizard.java): `src/main/java/com/petpal/ui/VaccinationWizard.java`
- [Vaccination service](https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/service/VaccinationService.java): `src/main/java/com/petpal/service/VaccinationService.java`
- [Card printing](https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/ui/PrintCardDialog.java): `src/main/java/com/petpal/ui/PrintCardDialog.java`
- [Vaccine catalog](https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/ui/VaccineTypesPanel.java): `src/main/java/com/petpal/ui/VaccineTypesPanel.java`
- [Catalog service](https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/service/VaccineTypeService.java): `src/main/java/com/petpal/service/VaccineTypeService.java`

### Clinic operations

- [Clinic dashboard](https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/ui/DashboardPanel.java): `src/main/java/com/petpal/ui/DashboardPanel.java`
- [Clinic overview service](https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/service/ClinicOverviewService.java): `src/main/java/com/petpal/service/ClinicOverviewService.java`
- [Appointments and history](https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/ui/AppointmentsPanel.java): `src/main/java/com/petpal/ui/AppointmentsPanel.java`
- [Return visit entry](https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/ui/ReturnVisitDialog.java): `src/main/java/com/petpal/ui/ReturnVisitDialog.java`
- [Account settings](https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/service/AccountSettingsService.java): `src/main/java/com/petpal/service/AccountSettingsService.java`

### Persistence and models

- [Database access](https://github.com/edcel-needscoffee/petpal/tree/master/src/main/java/com/petpal/dao): `src/main/java/com/petpal/dao`
- [MySQL connection](https://github.com/edcel-needscoffee/petpal/blob/master/src/main/java/com/petpal/util/DBConnection.java): `src/main/java/com/petpal/util/DBConnection.java`
- **MySQL database**
- [Domain records](https://github.com/edcel-needscoffee/petpal/tree/master/src/main/java/com/petpal/model): `src/main/java/com/petpal/model`

### Other components

- **Clinic staff**

## Connections

- Clinic staff → Application startup: starts
- Application startup → Staff sign-in: opens
- Staff sign-in → Authentication service: authenticates
- Clinic staff → Staff sign-in: signs in (evidence: `README.md`)
- Clinic workspace → Clients and pets: opens
- Clients and pets → Client editor: opens (evidence: `src/main/java/com/petpal/ui/ClientsPetsPanel.java`)
- Clients and pets → Client records service: loads and deletes (evidence: `src/main/java/com/petpal/ui/ClientsPetsPanel.java`)
- Client editor → Client records service: saves (evidence: `src/main/java/com/petpal/ui/ClientFormDialog.java`)
- Client records service → Database access: accesses clients (evidence: `src/main/java/com/petpal/service/ClientService.java`)
- Clients and pets → Pet records service: manages pets (evidence: `src/main/java/com/petpal/ui/ClientsPetsPanel.java`)
- Pet records service → Database access: accesses pets (evidence: `src/main/java/com/petpal/service/PetService.java`)
- Clinic workspace → Vaccination workflow: opens
- Vaccination workflow → Vaccination service: records doses
- Vaccination service → Database access: records vaccinations (evidence: `src/main/java/com/petpal/service/VaccinationService.java`)
- Vaccination workflow → Card printing: prints card
- Vaccination service → Catalog service: uses catalog (evidence: `src/main/java/com/petpal/service/VaccinationService.java`)
- Vaccine catalog → Catalog service: maintains catalog
- Catalog service → Database access: accesses catalog (evidence: `src/main/java/com/petpal/service/VaccineTypeService.java`)
- Clinic workspace → Clinic dashboard: opens
- Clinic dashboard → Clinic overview service: loads overview (evidence: `src/main/java/com/petpal/ui/DashboardPanel.java`)
- Clinic overview service → Database access: loads totals (evidence: `src/main/java/com/petpal/service/ClinicOverviewService.java`)
- Clinic workspace → Appointments and history: opens
- Appointments and history → Return visit entry: records visit
- Return visit entry → Vaccination service: records next dose (evidence: `src/main/java/com/petpal/ui/ReturnVisitDialog.java`)
- Account settings → Database access: records activity (evidence: `src/main/java/com/petpal/service/AccountSettingsService.java`)
- Authentication service → Database access: loads staff (evidence: `src/main/java/com/petpal/service/AuthService.java`)
- Database access → MySQL connection: opens connections (evidence: `src/main/java/com/petpal/dao/ClientDAO.java`)
- MySQL connection → MySQL database: connects (evidence: `src/main/java/com/petpal/util/DBConnection.java`)
