# saaait/safepaws-animal-welfare-system architecture

> Architecture diagram of the GitHub repository saaait/safepaws-animal-welfare-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/saaait/safepaws-animal-welfare-system
- Repository: https://github.com/saaait/safepaws-animal-welfare-system

## Overview

##### Project type and purpose
- Safepaws is a monolithic, full-stack PHP web application whose goal is to connect animal shelters and supporters, manage lost/found reports, adoptions, donations, user profiles, and administrative approval workflows.

##### File structure
- Top-level:
- __MAIN/ contains your entry point (`main.php`), your “model” SQL scripts (`modal/`), and a file store for uploaded pet images (`report_img/`).
- view/ holds the presentation layer:
– CSS/ (stylesheets for each page)
– HTML/ (PHP templates that double as your “controller‐view” pages plus `db_connect.php`)
– Js/ (client-side behaviors)
– Images/ (static assets)
- No separate “controller” folder—but `main.php` and the various PHP pages in view/HTML serve that role.
- `modal/` contains hand-rolled SQL definitions for `user` and `lost_pets_report` schemas.

##### README
- Confirms a user-facing web portal for shelters/resources.
- No mention of external microservices—everything runs in one PHP application talking to a MySQL-compatible database.

##### Elements
- Green for User-facing UI
- Blue for Application Logic
- Orange for Data Storage

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Layer
    subgraph "Client Browser"
        B["User/Admin"]:::frontend
    end

    %% Web Server Layer
    WS["Web Server + PHP Runtime<br/>(Apache/Nginx + PHP)"]:::app

    B -->|"HTTP Request"| WS

    %% Application Layer
    subgraph "Application Layer"
        subgraph "Controllers"
            MP["main.php"]:::app
            AU["Aboutus.php"]:::app
            AC["Acat.php"]:::app
            ADOG["Adog.php"]:::app
            EM["Emergency.php"]:::app
            VAC["Vaccination.php"]:::app
            AD["ad.php"]:::app
            ADMIN["admin.php"]:::app
            ADOPT["adopt.php"]:::app
            APPR["approve_reports.php"]:::app
            BLOG["blog.php"]:::app
            CHK["checkup.php"]:::app
            CONTACT["contact.php"]:::app
            DELR["delete_report.php"]:::app
            DELU["delete_user.php"]:::app
            DON["donate.php"]:::app
            EDITU["edit_user.php"]:::app
            FR["found_report.php"]:::app
            GROOM["grooming.php"]:::app
            LOGIN["login.php"]:::app
            LOGOUT["logout.php"]:::app
            LOST["lost.php"]:::app
            LPR["lost_pets_reports.php"]:::app
            NOTI["notification.php"]:::app
            REP["report.php"]:::app
            RINFO["report_info.php"]:::app
            SIGN["signup.php"]:::app
            TRAIN["training.php"]:::app
            TRAIN1["training1.php"]:::app
            UNAPP["unapprove_reports.php"]:::app
            UINFO["user_info.php"]:::app
            VET["vet.php"]:::app
        end
        subgraph "Models / DB Access"
            M1["user_db_sql"]:::app
            M2["lost_pets_report_db_sql"]:::app
            DC["db_connect.php"]:::app
        end
        subgraph "Views"
            subgraph "Stylesheets (CSS)"
                CSS["view/CSS/"]:::app
            end
            subgraph "Client-side Scripts (JS)"
                JS1["ad.js"]:::app
                JS2["edit_user.js"]:::app
                JS3["lost.js"]:::app
                JS4["report.js"]:::app
                JS5["signin_login.js"]:::app
            end
            subgraph "Static Images"
                IMG["view/Images/"]:::app
            end
        end
    end

    %% Data Layer
    subgraph "Data Layer"
        DB["MySQL Database"]:::storage
        FS["File Storage<br/>(report_img/)"]:::storage
    end

    %% Data Flows
    WS -->|"invokes controller"| MP
    WS -->|"invokes controller"| AU
    WS -->|"invokes controller"| AC
    %% ... other controllers omitted for brevity but implied
    MP -->|"calls SQL"| M1
    MP -->|"calls SQL"| M2
    DC -->|"connects to"| DB
    M1 -->|"SQL Queries"| DB
    M2 -->|"SQL Queries"| DB
    DB -->|"Result Sets"| M1
    DB -->|"Result Sets"| M2
    Controllers -->|"renders templates"| CSS
    Controllers -->|"renders templates"| IMG
    Controllers -->|"renders templates"| JS1
    Controllers -->|"file I/O"| FS
    FS -->|"serves images"| WS

    %% Click Events - Controllers
    click MP "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/main.php"
    click AU "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/Aboutus.php"
    click AC "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/Acat.php"
    click ADOG "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/Adog.php"
    click EM "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/Emergency.php"
    click VAC "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/Vaccination.php"
    click AD "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/ad.php"
    click ADMIN "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/admin.php"
    click ADOPT "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/adopt.php"
    click APPR "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/approve_reports.php"
    click BLOG "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/blog.php"
    click CHK "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/checkup.php"
    click CONTACT "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/contact.php"
    click DELR "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/delete_report.php"
    click DELU "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/delete_user.php"
    click DON "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/donate.php"
    click EDITU "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/edit_user.php"
    click FR "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/found_report.php"
    click GROOM "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/grooming.php"
    click LOGIN "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/login.php"
    click LOGOUT "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/logout.php"
    click LOST "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/lost.php"
    click LPR "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/lost_pets_reports.php"
    click NOTI "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/notification.php"
    click REP "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/report.php"
    click RINFO "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/report_info.php"
    click SIGN "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/signup.php"
    click TRAIN "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/training.php"
    click TRAIN1 "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/training1.php"
    click UNAPP "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/unapprove_reports.php"
    click UINFO "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/user_info.php"
    click VET "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/vet.php"

    %% Click Events - Models
    click M1 "https://github.com/saaait/safepaws-animal-welfare-system/tree/main/__MAIN/modal/user_db_sql"
    click M2 "https://github.com/saaait/safepaws-animal-welfare-system/tree/main/__MAIN/modal/lost_pets_report_db_sql"
    click DC "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/HTML/db_connect.php"

    %% Click Events - Views
    click CSS "https://github.com/saaait/safepaws-animal-welfare-system/tree/main/__MAIN/view/CSS/"
    click JS1 "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/Js/ad.js"
    click JS2 "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/Js/edit_user.js"
    click JS3 "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/Js/lost.js"
    click JS4 "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/Js/report.js"
    click JS5 "https://github.com/saaait/safepaws-animal-welfare-system/blob/main/__MAIN/view/Js/signin_login.js"
    click IMG "https://github.com/saaait/safepaws-animal-welfare-system/tree/main/__MAIN/view/Images/"

    %% Click Events - File Storage
    click FS "https://github.com/saaait/safepaws-animal-welfare-system/tree/main/__MAIN/report_img/"

    %% Styles
    classDef frontend fill:#a2f5a2,stroke:#026e02,color:#000
    classDef app fill:#c2dfff,stroke:#0349a4,color:#000
    classDef storage fill:#ffd9a2,stroke:#a45f00,color:#000
```
