# willianmedeiros/petshop-faculdade architecture

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

- Interactive diagram: https://gitdiagram.com/willianmedeiros/petshop-faculdade
- Repository: https://github.com/willianmedeiros/petshop-faculdade

## Overview

PetCare is a PHP web application for pet-shop operations. Staff register tutors and pets, browse and edit their records, maintain a service catalog, and schedule and track appointments; the dashboard summarizes upcoming work and operational and financial metrics. Shared PHP helpers provide database-backed metrics, photo-upload handling, and service-icon resolution. The README documents these capabilities; some page-to-page and persistence links below rely on its statements and the source index, since not every implementation was sampled.

Main entry points: [`src/db.php`](https://github.com/willianmedeiros/petshop-faculdade/blob/main/src/db.php) (PDO connection), [`mysql/init.sql`](https://github.com/willianmedeiros/petshop-faculdade/blob/main/mysql/init.sql) (Pet-shop database), [`src/includes/header.php`](https://github.com/willianmedeiros/petshop-faculdade/blob/main/src/includes/header.php) (Navigation and shared layout), [`src/pets.php`](https://github.com/willianmedeiros/petshop-faculdade/blob/main/src/pets.php) (Pet and tutor records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_records["Pet Records"]
  node_registration["Tutor and pet registration<br/>[cadastro.php]"]
  node_pet_records["Pet and tutor records<br/>[pets.php]"]
  node_record_details["Record details and editing<br/>[detalhes.php]"]
  node_record_deletion["Tutor deletion<br/>[excluir.php]"]
end

subgraph group_service_ops["Service Operations"]
  node_appointments["Appointment management<br/>[agendamentos.php]"]
  node_service_catalog["Service catalog and pricing<br/>[servicos.php]"]
  node_appointment_deletion["Appointment deletion"]
  node_service_deletion["Service deletion"]
end

subgraph group_overview["Dashboard"]
  node_dashboard["Operational dashboard<br/>[dashboard.php]"]
end

subgraph group_shared["Shared Runtime"]
  node_layout["Navigation and shared layout<br/>[header.php]"]
  node_shared_ui["Shared modals and UI<br/>[footer.php]"]
  node_helpers["Metrics and helpers<br/>[functions.php]"]
  node_db_connection["PDO connection<br/>[db.php]"]
end

node_staff(("Pet-shop staff"))
node_browser["Web browser"]
node_petshop_db[("Pet-shop database<br/>[init.sql]")]

node_staff -->|"uses"| node_browser
node_browser -->|"submits records"| node_registration
node_browser -->|"browses records"| node_pet_records
node_browser -->|"manages appointments"| node_appointments
node_browser -->|"manages services"| node_service_catalog
node_browser -->|"views metrics"| node_dashboard
node_registration -->|"loads"| node_db_connection
node_pet_records -->|"loads"| node_db_connection
node_record_details -->|"loads"| node_db_connection
node_record_deletion -->|"loads"| node_db_connection
node_appointments -->|"loads"| node_db_connection
node_service_catalog -->|"loads"| node_db_connection
node_appointment_deletion -->|"loads"| node_db_connection
node_service_deletion -->|"loads"| node_db_connection
node_dashboard -->|"loads"| node_db_connection
node_layout -->|"loads"| node_db_connection
node_layout -->|"loads"| node_helpers
node_layout -->|"queries"| node_petshop_db
node_helpers -->|"queries metrics"| node_petshop_db
node_registration -->|"persists records"| node_petshop_db
node_pet_records -->|"reads and updates"| node_petshop_db
node_record_details -->|"reads and updates"| node_petshop_db
node_record_deletion -->|"deletes tutor"| node_petshop_db
node_appointments -->|"queries appointments"| node_petshop_db
node_service_catalog -->|"queries services"| node_petshop_db
node_appointment_deletion -->|"deletes appointment"| node_petshop_db
node_service_deletion -->|"deletes service"| node_petshop_db
node_dashboard -->|"loads"| node_helpers
node_registration -->|"includes layout"| node_layout
node_pet_records -->|"includes layout"| node_layout
node_appointments -->|"includes layout"| node_layout
node_service_catalog -->|"includes layout"| node_layout
node_dashboard -->|"includes layout"| node_layout
node_appointments -->|"includes UI"| node_shared_ui
node_pet_records -->|"includes UI"| node_shared_ui
node_registration -->|"loads helpers"| node_helpers
node_pet_records -->|"loads helpers"| node_helpers
node_appointments -->|"loads helpers"| node_helpers
node_service_catalog -->|"loads helpers"| node_helpers
node_record_deletion -->|"redirects to"| node_pet_records
node_service_deletion -->|"redirects to"| node_service_catalog

click node_registration "https://github.com/willianmedeiros/petshop-faculdade/blob/main/src/cadastro.php"
click node_pet_records "https://github.com/willianmedeiros/petshop-faculdade/blob/main/src/pets.php"
click node_record_details "https://github.com/willianmedeiros/petshop-faculdade/blob/main/src/detalhes.php"
click node_record_deletion "https://github.com/willianmedeiros/petshop-faculdade/blob/main/src/excluir.php"
click node_appointments "https://github.com/willianmedeiros/petshop-faculdade/blob/main/src/agendamentos.php"
click node_service_catalog "https://github.com/willianmedeiros/petshop-faculdade/blob/main/src/servicos.php"
click node_appointment_deletion "https://github.com/willianmedeiros/petshop-faculdade/blob/main/src/excluir_agendamento.php"
click node_service_deletion "https://github.com/willianmedeiros/petshop-faculdade/blob/main/src/excluir_servico.php"
click node_dashboard "https://github.com/willianmedeiros/petshop-faculdade/blob/main/src/dashboard.php"
click node_layout "https://github.com/willianmedeiros/petshop-faculdade/blob/main/src/includes/header.php"
click node_shared_ui "https://github.com/willianmedeiros/petshop-faculdade/blob/main/src/includes/footer.php"
click node_helpers "https://github.com/willianmedeiros/petshop-faculdade/blob/main/src/includes/functions.php"
click node_db_connection "https://github.com/willianmedeiros/petshop-faculdade/blob/main/src/db.php"
click node_petshop_db "https://github.com/willianmedeiros/petshop-faculdade/blob/main/mysql/init.sql"

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_registration,node_pet_records,node_record_details,node_record_deletion,node_browser toneBlue
class node_appointments,node_service_catalog,node_appointment_deletion,node_service_deletion,node_petshop_db toneAmber
class node_dashboard toneMint
class node_layout,node_shared_ui,node_helpers,node_db_connection toneRose
class node_staff toneIndigo
```

## Components

### Pet Records

- [Tutor and pet registration](https://github.com/willianmedeiros/petshop-faculdade/blob/main/src/cadastro.php): `src/cadastro.php`
- [Pet and tutor records](https://github.com/willianmedeiros/petshop-faculdade/blob/main/src/pets.php): `src/pets.php`
- [Record details and editing](https://github.com/willianmedeiros/petshop-faculdade/blob/main/src/detalhes.php): `src/detalhes.php`
- [Tutor deletion](https://github.com/willianmedeiros/petshop-faculdade/blob/main/src/excluir.php): `src/excluir.php`

### Service Operations

- [Appointment management](https://github.com/willianmedeiros/petshop-faculdade/blob/main/src/agendamentos.php): `src/agendamentos.php`
- [Service catalog and pricing](https://github.com/willianmedeiros/petshop-faculdade/blob/main/src/servicos.php): `src/servicos.php`
- [Appointment deletion](https://github.com/willianmedeiros/petshop-faculdade/blob/main/src/excluir_agendamento.php): `src/excluir_agendamento.php`
- [Service deletion](https://github.com/willianmedeiros/petshop-faculdade/blob/main/src/excluir_servico.php): `src/excluir_servico.php`

### Dashboard

- [Operational dashboard](https://github.com/willianmedeiros/petshop-faculdade/blob/main/src/dashboard.php): `src/dashboard.php`

### Shared Runtime

- [Navigation and shared layout](https://github.com/willianmedeiros/petshop-faculdade/blob/main/src/includes/header.php): `src/includes/header.php`
- [Shared modals and UI](https://github.com/willianmedeiros/petshop-faculdade/blob/main/src/includes/footer.php): `src/includes/footer.php`
- [Metrics and helpers](https://github.com/willianmedeiros/petshop-faculdade/blob/main/src/includes/functions.php): `src/includes/functions.php`
- [PDO connection](https://github.com/willianmedeiros/petshop-faculdade/blob/main/src/db.php): `src/db.php`

### Other components

- **Pet-shop staff**
- **Web browser**
- [Pet-shop database](https://github.com/willianmedeiros/petshop-faculdade/blob/main/mysql/init.sql): `mysql/init.sql`

## Connections

- Pet-shop staff → Web browser: uses (evidence: `README.md`)
- Web browser → Tutor and pet registration: submits records (evidence: `README.md`)
- Web browser → Pet and tutor records: browses records (evidence: `README.md`)
- Web browser → Appointment management: manages appointments (evidence: `README.md`)
- Web browser → Service catalog and pricing: manages services (evidence: `README.md`)
- Web browser → Operational dashboard: views metrics
- Tutor and pet registration → PDO connection: loads (evidence: `src/cadastro.php`)
- Pet and tutor records → PDO connection: loads (evidence: `src/pets.php`)
- Record details and editing → PDO connection: loads (evidence: `src/detalhes.php`)
- Tutor deletion → PDO connection: loads (evidence: `src/excluir.php`)
- Appointment management → PDO connection: loads (evidence: `src/agendamentos.php`)
- Service catalog and pricing → PDO connection: loads (evidence: `src/servicos.php`)
- Appointment deletion → PDO connection: loads (evidence: `src/excluir_agendamento.php`)
- Service deletion → PDO connection: loads (evidence: `src/excluir_servico.php`)
- Operational dashboard → PDO connection: loads (evidence: `src/dashboard.php`)
- Navigation and shared layout → PDO connection: loads (evidence: `src/includes/header.php`)
- Navigation and shared layout → Metrics and helpers: loads (evidence: `src/includes/header.php`)
- Navigation and shared layout → Pet-shop database: queries (evidence: `src/includes/header.php`)
- Metrics and helpers → Pet-shop database: queries metrics (evidence: `src/includes/functions.php`)
- Tutor and pet registration → Pet-shop database: persists records (evidence: `README.md`)
- Pet and tutor records → Pet-shop database: reads and updates (evidence: `src/pets.php`)
- Record details and editing → Pet-shop database: reads and updates (evidence: `src/detalhes.php`)
- Tutor deletion → Pet-shop database: deletes tutor (evidence: `src/excluir.php`)
- Appointment management → Pet-shop database: queries appointments (evidence: `src/agendamentos.php`)
- Service catalog and pricing → Pet-shop database: queries services (evidence: `src/servicos.php`)
- Appointment deletion → Pet-shop database: deletes appointment (evidence: `README.md`)
- Service deletion → Pet-shop database: deletes service (evidence: `src/excluir_servico.php`)
- Operational dashboard → Metrics and helpers: loads (evidence: `src/dashboard.php`)
- Tutor and pet registration → Navigation and shared layout: includes layout (evidence: `src/cadastro.php`)
- Pet and tutor records → Navigation and shared layout: includes layout (evidence: `src/pets.php`)
- Appointment management → Navigation and shared layout: includes layout (evidence: `src/agendamentos.php`)
- Service catalog and pricing → Navigation and shared layout: includes layout (evidence: `src/servicos.php`)
- Operational dashboard → Navigation and shared layout: includes layout (evidence: `src/dashboard.php`)
- Appointment management → Shared modals and UI: includes UI (evidence: `src/agendamentos.php`)
- Pet and tutor records → Shared modals and UI: includes UI (evidence: `src/pets.php`)
- Tutor and pet registration → Metrics and helpers: loads helpers (evidence: `src/cadastro.php`)
- Pet and tutor records → Metrics and helpers: loads helpers (evidence: `src/pets.php`)
- Appointment management → Metrics and helpers: loads helpers (evidence: `src/agendamentos.php`)
- Service catalog and pricing → Metrics and helpers: loads helpers (evidence: `src/servicos.php`)
- Tutor deletion → Pet and tutor records: redirects to (evidence: `src/excluir.php`)
- Service deletion → Service catalog and pricing: redirects to (evidence: `src/excluir_servico.php`)
