# kenflor2305/ccad-midterm-exam architecture

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

- Interactive diagram: https://gitdiagram.com/kenflor2305/ccad-midterm-exam
- Repository: https://github.com/kenflor2305/ccad-midterm-exam

## Overview

This is a Laravel shelter-animal and adoption management application, with account registration, login, and email verification alongside animal records, adoption requests, approval, and payment records. The main domain flow is shelter staff recording animals, then creating and updating adoptions; approval is gated on completed spay/neuter status. Controllers coordinate validation, services, models, and rendered views. The excerpts show those domain calls, but not the web route definitions or payment workflow, so those connections are left out rather than inferred.

Main entry points: [`app/Models/Adoption.php`](https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Models/Adoption.php) (Adoptions), [`app/Http/Controllers/ShelterAnimalController.php`](https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Http/Controllers/ShelterAnimalController.php) (Animal management), [`app/Http/Controllers/AdoptionController.php`](https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Http/Controllers/AdoptionController.php) (Adoption management), [`app/Models/ShelterAnimal.php`](https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Models/ShelterAnimal.php) (Shelter animals)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_domain["Shelter and adoption"]
  node_animal_controller["Animal management"]
  node_animal_service["Animal operations"]
  node_adoption_controller["Adoption management"]
  node_adoption_service["Adoption operations"]
  node_payment_controller["Payment records"]
end

subgraph group_identity["Account access"]
  node_auth_controller["Authentication"]
  node_registration_controller["Registration"]
  node_verification_controller["Email verification"]
  node_login_request["Login validation<br/>[LoginRequest.php]"]
  node_profile_controller["Profile settings"]
  node_profile_request["Profile validation"]
end

subgraph group_persistence["Domain records"]
  node_animal_model["Shelter animals<br/>[ShelterAnimal.php]"]
  node_adoption_model["Adoptions<br/>[Adoption.php]"]
  node_adopter_model["Adopters<br/>[Adopter.php]"]
  node_payment_model["Adoption payments"]
  node_database[("Database settings<br/>[database.php]")]
end

subgraph group_presentation["Web interface"]
  node_inertia_middleware["Inertia middleware"]
  node_adoption_view["Adoption listing<br/>[index.blade.php]"]
  node_animal_view["Animal listing<br/>[index.blade.php]"]
  node_frontend["React entry<br/>[app.tsx]"]
  node_adoption_page["Adoption page<br/>[index.tsx]"]
  node_auth_pages["Authentication pages<br/>[login.tsx]"]
  node_appearance["Appearance preference<br/>[use-appearance.tsx]"]
end

node_staff(("Shelter staff"))

node_staff -.->|"manages animals"| node_animal_controller
node_animal_controller -->|"delegates updates"| node_animal_service
node_animal_service -->|"creates and updates"| node_animal_model
node_animal_controller -->|"lists animals"| node_animal_model
node_animal_controller -->|"renders listing"| node_animal_view
node_staff -.->|"manages adoptions"| node_adoption_controller
node_adoption_controller -->|"delegates changes"| node_adoption_service
node_adoption_service -->|"creates and updates"| node_adoption_model
node_adoption_service -->|"checks eligibility"| node_animal_model
node_adoption_controller -->|"loads listing"| node_adoption_model
node_adoption_controller -->|"renders listing"| node_adoption_view
node_adoption_model -->|"belongs to adopter"| node_adopter_model
node_adoption_model -->|"belongs to animal"| node_animal_model
node_adoption_model -->|"has payments"| node_payment_model
node_payment_controller -->|"uses payment records"| node_payment_model
node_auth_controller -->|"authenticates with"| node_login_request
node_registration_controller -->|"renders registration"| node_auth_pages
node_auth_controller -->|"renders login"| node_auth_pages
node_inertia_middleware -.->|"shares Inertia responses"| node_frontend
node_frontend -->|"initializes theme"| node_appearance
node_frontend -->|"resolves page modules"| node_adoption_page
node_profile_controller -->|"validates updates"| node_profile_request

click node_animal_controller "https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Http/Controllers/ShelterAnimalController.php"
click node_animal_service "https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Services/ShelterAnimalService.php"
click node_adoption_controller "https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Http/Controllers/AdoptionController.php"
click node_adoption_service "https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Services/AdoptionService.php"
click node_payment_controller "https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Http/Controllers/AdoptionPaymentController.php"
click node_animal_model "https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Models/ShelterAnimal.php"
click node_adoption_model "https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Models/Adoption.php"
click node_adopter_model "https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Models/Adopter.php"
click node_payment_model "https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Models/AdoptionPayment.php"
click node_database "https://github.com/kenflor2305/ccad-midterm-exam/blob/main/config/database.php"
click node_auth_controller "https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Http/Controllers/Auth/AuthenticatedSessionController.php"
click node_registration_controller "https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Http/Controllers/Auth/RegisteredUserController.php"
click node_verification_controller "https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Http/Controllers/Auth/VerifyEmailController.php"
click node_login_request "https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Http/Requests/Auth/LoginRequest.php"
click node_inertia_middleware "https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Http/Middleware/HandleInertiaRequests.php"
click node_adoption_view "https://github.com/kenflor2305/ccad-midterm-exam/blob/main/resources/views/adoptions/index.blade.php"
click node_animal_view "https://github.com/kenflor2305/ccad-midterm-exam/blob/main/resources/views/shelter-animals/index.blade.php"
click node_frontend "https://github.com/kenflor2305/ccad-midterm-exam/blob/main/resources/js/app.tsx"
click node_adoption_page "https://github.com/kenflor2305/ccad-midterm-exam/blob/main/resources/js/pages/adoptions/index.tsx"
click node_auth_pages "https://github.com/kenflor2305/ccad-midterm-exam/blob/main/resources/js/pages/auth/login.tsx"
click node_profile_controller "https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Http/Controllers/Settings/ProfileController.php"
click node_profile_request "https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Http/Requests/Settings/ProfileUpdateRequest.php"
click node_appearance "https://github.com/kenflor2305/ccad-midterm-exam/blob/main/resources/js/hooks/use-appearance.tsx"

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_animal_controller,node_animal_service,node_adoption_controller,node_adoption_service,node_payment_controller toneBlue
class node_auth_controller,node_registration_controller,node_verification_controller,node_login_request,node_profile_controller,node_profile_request toneAmber
class node_animal_model,node_adoption_model,node_adopter_model,node_payment_model,node_database toneMint
class node_inertia_middleware,node_adoption_view,node_animal_view,node_frontend,node_adoption_page,node_auth_pages,node_appearance toneRose
class node_staff toneIndigo
```

## Components

### Shelter and adoption

- [Animal management](https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Http/Controllers/ShelterAnimalController.php): `app/Http/Controllers/ShelterAnimalController.php`
- [Animal operations](https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Services/ShelterAnimalService.php): `app/Services/ShelterAnimalService.php`
- [Adoption management](https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Http/Controllers/AdoptionController.php): `app/Http/Controllers/AdoptionController.php`
- [Adoption operations](https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Services/AdoptionService.php): `app/Services/AdoptionService.php`
- [Payment records](https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Http/Controllers/AdoptionPaymentController.php): `app/Http/Controllers/AdoptionPaymentController.php`

### Account access

- [Authentication](https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Http/Controllers/Auth/AuthenticatedSessionController.php): `app/Http/Controllers/Auth/AuthenticatedSessionController.php`
- [Registration](https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Http/Controllers/Auth/RegisteredUserController.php): `app/Http/Controllers/Auth/RegisteredUserController.php`
- [Email verification](https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Http/Controllers/Auth/VerifyEmailController.php): `app/Http/Controllers/Auth/VerifyEmailController.php`
- [Login validation](https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Http/Requests/Auth/LoginRequest.php): `app/Http/Requests/Auth/LoginRequest.php`
- [Profile settings](https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Http/Controllers/Settings/ProfileController.php): `app/Http/Controllers/Settings/ProfileController.php`
- [Profile validation](https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Http/Requests/Settings/ProfileUpdateRequest.php): `app/Http/Requests/Settings/ProfileUpdateRequest.php`

### Domain records

- [Shelter animals](https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Models/ShelterAnimal.php): `app/Models/ShelterAnimal.php`
- [Adoptions](https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Models/Adoption.php): `app/Models/Adoption.php`
- [Adopters](https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Models/Adopter.php): `app/Models/Adopter.php`
- [Adoption payments](https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Models/AdoptionPayment.php): `app/Models/AdoptionPayment.php`
- [Database settings](https://github.com/kenflor2305/ccad-midterm-exam/blob/main/config/database.php): `config/database.php`

### Web interface

- [Inertia middleware](https://github.com/kenflor2305/ccad-midterm-exam/blob/main/app/Http/Middleware/HandleInertiaRequests.php): `app/Http/Middleware/HandleInertiaRequests.php`
- [Adoption listing](https://github.com/kenflor2305/ccad-midterm-exam/blob/main/resources/views/adoptions/index.blade.php): `resources/views/adoptions/index.blade.php`
- [Animal listing](https://github.com/kenflor2305/ccad-midterm-exam/blob/main/resources/views/shelter-animals/index.blade.php): `resources/views/shelter-animals/index.blade.php`
- [React entry](https://github.com/kenflor2305/ccad-midterm-exam/blob/main/resources/js/app.tsx): `resources/js/app.tsx`
- [Adoption page](https://github.com/kenflor2305/ccad-midterm-exam/blob/main/resources/js/pages/adoptions/index.tsx): `resources/js/pages/adoptions/index.tsx`
- [Authentication pages](https://github.com/kenflor2305/ccad-midterm-exam/blob/main/resources/js/pages/auth/login.tsx): `resources/js/pages/auth/login.tsx`
- [Appearance preference](https://github.com/kenflor2305/ccad-midterm-exam/blob/main/resources/js/hooks/use-appearance.tsx): `resources/js/hooks/use-appearance.tsx`

### Other components

- **Shelter staff**

## Connections

- Shelter staff → Animal management: manages animals
- Animal management → Animal operations: delegates updates (evidence: `app/Http/Controllers/ShelterAnimalController.php`)
- Animal operations → Shelter animals: creates and updates (evidence: `app/Services/ShelterAnimalService.php`)
- Animal management → Shelter animals: lists animals (evidence: `app/Http/Controllers/ShelterAnimalController.php`)
- Animal management → Animal listing: renders listing (evidence: `app/Http/Controllers/ShelterAnimalController.php`)
- Shelter staff → Adoption management: manages adoptions
- Adoption management → Adoption operations: delegates changes (evidence: `app/Http/Controllers/AdoptionController.php`)
- Adoption operations → Adoptions: creates and updates (evidence: `app/Services/AdoptionService.php`)
- Adoption operations → Shelter animals: checks eligibility (evidence: `app/Services/AdoptionService.php`)
- Adoption management → Adoptions: loads listing (evidence: `app/Http/Controllers/AdoptionController.php`)
- Adoption management → Adoption listing: renders listing (evidence: `app/Http/Controllers/AdoptionController.php`)
- Adoptions → Adopters: belongs to adopter (evidence: `app/Models/Adoption.php`)
- Adoptions → Shelter animals: belongs to animal (evidence: `app/Models/Adoption.php`)
- Adoptions → Adoption payments: has payments (evidence: `app/Models/Adoption.php`)
- Payment records → Adoption payments: uses payment records (evidence: `app/Http/Controllers/AdoptionPaymentController.php`)
- Authentication → Login validation: authenticates with (evidence: `app/Http/Controllers/Auth/AuthenticatedSessionController.php`)
- Registration → Authentication pages: renders registration (evidence: `app/Http/Controllers/Auth/RegisteredUserController.php`)
- Authentication → Authentication pages: renders login (evidence: `app/Http/Controllers/Auth/AuthenticatedSessionController.php`)
- Inertia middleware → React entry: shares Inertia responses
- React entry → Appearance preference: initializes theme (evidence: `resources/js/app.tsx`)
- React entry → Adoption page: resolves page modules (evidence: `resources/js/app.tsx`)
- Profile settings → Profile validation: validates updates (evidence: `app/Http/Controllers/Settings/ProfileController.php`)
