# ralffxp/salvapet architecture

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

- Interactive diagram: https://gitdiagram.com/ralffxp/salvapet
- Repository: https://github.com/ralffxp/salvapet

## Overview

SalvaPet is a full-stack pet adoption and donation platform. Visitors browse and filter adoptable animals, contact tutors through WhatsApp, submit animals for adoption, and create accounts; admins manage animals and users. The site also supports ratings, institutional information, and contact. The graph follows documented routes and API capabilities; some page-to-API links are documented or evident, while unsampled page implementations are not assumed.

Main entry points: [`src/main.tsx`](https://github.com/ralffxp/salvapet/blob/main/src/main.tsx) (Route entry), [`src/Back Ends/serve.ts`](https://github.com/ralffxp/salvapet/blob/main/src/Back%20Ends/serve.ts) (REST API), [`src/App.tsx`](https://github.com/ralffxp/salvapet/blob/main/src/App.tsx) (Site shell), [`src/Componetes/pages/Animais.tsx`](https://github.com/ralffxp/salvapet/blob/main/src/Componetes/pages/Animais.tsx) (Animal catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_router["Route entry<br/>[main.tsx]"]
  node_shell["Site shell<br/>[App.tsx]"]
  node_header["Navigation<br/>[header.tsx]"]
  node_footer["Footer<br/>[footer.tsx]"]
  node_home["Home and highlights<br/>[Home.tsx]"]
  node_about["About<br/>[Sobre.tsx]"]
  node_contact["Contact<br/>[Contato.tsx]"]
end

subgraph group_adoption["Adoption services"]
  node_catalog["Animal catalog<br/>[Animais.tsx]"]
  node_donation["Donation form<br/>[Doar.tsx]"]
  node_whatsapp["WhatsApp"]
end

subgraph group_accounts["Accounts and administration"]
  node_login["Login and signup<br/>[Login.tsx]"]
  node_admin["Admin dashboard<br/>[Admin.tsx]"]
end

subgraph group_platform["Platform services"]
  node_reviews["Platform reviews<br/>[Avaliar.tsx]"]
  node_api["REST API<br/>[serve.ts]"]
  node_dbconfig["Database connection<br/>[database.ts]"]
  node_mysql[("MySQL database<br/>[schema.sql]")]
end

node_visitor(("Visitor"))

node_visitor -->|"opens site"| node_router
node_router -->|"routes through"| node_shell
node_router -->|"routes to"| node_home
node_router -->|"routes to"| node_catalog
node_router -->|"routes to"| node_donation
node_router -->|"routes to"| node_about
node_router -->|"routes to"| node_contact
node_router -->|"routes to"| node_login
node_router -->|"routes to"| node_reviews
node_router -->|"routes to"| node_admin
node_shell -->|"renders"| node_header
node_shell -->|"renders"| node_footer
node_catalog -->|"fetches animals"| node_api
node_donation -->|"submits animal"| node_api
node_login -->|"authenticates and registers"| node_api
node_reviews -->|"reads and submits reviews"| node_api
node_catalog -.->|"contacts tutor"| node_whatsapp
node_admin -.->|"manages records"| node_api
node_home -.->|"loads highlights"| node_api
node_api -->|"uses connection pool"| node_dbconfig
node_dbconfig -->|"connects to"| node_mysql
node_api -.->|"falls back to memory"| node_mysql

click node_router "https://github.com/ralffxp/salvapet/blob/main/src/main.tsx"
click node_shell "https://github.com/ralffxp/salvapet/blob/main/src/App.tsx"
click node_header "https://github.com/ralffxp/salvapet/blob/main/src/Componetes/pages/Header/header.tsx"
click node_footer "https://github.com/ralffxp/salvapet/blob/main/src/Componetes/pages/Footer/footer.tsx"
click node_home "https://github.com/ralffxp/salvapet/blob/main/src/Componetes/pages/Home.tsx"
click node_about "https://github.com/ralffxp/salvapet/blob/main/src/Componetes/pages/Sobre.tsx"
click node_contact "https://github.com/ralffxp/salvapet/blob/main/src/Componetes/pages/Contato.tsx"
click node_catalog "https://github.com/ralffxp/salvapet/blob/main/src/Componetes/pages/Animais.tsx"
click node_donation "https://github.com/ralffxp/salvapet/blob/main/src/Componetes/pages/Doar.tsx"
click node_login "https://github.com/ralffxp/salvapet/blob/main/src/Componetes/pages/Login.tsx"
click node_admin "https://github.com/ralffxp/salvapet/blob/main/src/Componetes/pages/Admin.tsx"
click node_reviews "https://github.com/ralffxp/salvapet/blob/main/src/Componetes/pages/Avaliar.tsx"
click node_api "https://github.com/ralffxp/salvapet/blob/main/src/Back%20Ends/serve.ts"
click node_dbconfig "https://github.com/ralffxp/salvapet/blob/main/src/Back%20Ends/database.ts"
click node_mysql "https://github.com/ralffxp/salvapet/blob/main/database/schema.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_router,node_shell,node_header,node_footer,node_home,node_about,node_contact toneBlue
class node_catalog,node_donation,node_whatsapp toneAmber
class node_login,node_admin toneMint
class node_reviews,node_api,node_dbconfig,node_mysql toneRose
class node_visitor toneIndigo
```

## Components

### Web application

- [Route entry](https://github.com/ralffxp/salvapet/blob/main/src/main.tsx): `src/main.tsx`
- [Site shell](https://github.com/ralffxp/salvapet/blob/main/src/App.tsx): `src/App.tsx`
- [Navigation](https://github.com/ralffxp/salvapet/blob/main/src/Componetes/pages/Header/header.tsx): `src/Componetes/pages/Header/header.tsx`
- [Footer](https://github.com/ralffxp/salvapet/blob/main/src/Componetes/pages/Footer/footer.tsx): `src/Componetes/pages/Footer/footer.tsx`
- [Home and highlights](https://github.com/ralffxp/salvapet/blob/main/src/Componetes/pages/Home.tsx): `src/Componetes/pages/Home.tsx`
- [About](https://github.com/ralffxp/salvapet/blob/main/src/Componetes/pages/Sobre.tsx): `src/Componetes/pages/Sobre.tsx`
- [Contact](https://github.com/ralffxp/salvapet/blob/main/src/Componetes/pages/Contato.tsx): `src/Componetes/pages/Contato.tsx`

### Adoption services

- [Animal catalog](https://github.com/ralffxp/salvapet/blob/main/src/Componetes/pages/Animais.tsx): `src/Componetes/pages/Animais.tsx`
- [Donation form](https://github.com/ralffxp/salvapet/blob/main/src/Componetes/pages/Doar.tsx): `src/Componetes/pages/Doar.tsx`
- **WhatsApp**

### Accounts and administration

- [Login and signup](https://github.com/ralffxp/salvapet/blob/main/src/Componetes/pages/Login.tsx): `src/Componetes/pages/Login.tsx`
- [Admin dashboard](https://github.com/ralffxp/salvapet/blob/main/src/Componetes/pages/Admin.tsx): `src/Componetes/pages/Admin.tsx`

### Platform services

- [Platform reviews](https://github.com/ralffxp/salvapet/blob/main/src/Componetes/pages/Avaliar.tsx): `src/Componetes/pages/Avaliar.tsx`
- [REST API](https://github.com/ralffxp/salvapet/blob/main/src/Back%20Ends/serve.ts): `src/Back Ends/serve.ts`
- [Database connection](https://github.com/ralffxp/salvapet/blob/main/src/Back%20Ends/database.ts): `src/Back Ends/database.ts`
- [MySQL database](https://github.com/ralffxp/salvapet/blob/main/database/schema.sql): `database/schema.sql`

### Other components

- **Visitor**

## Connections

- Visitor → Route entry: opens site (evidence: `src/main.tsx`)
- Route entry → Site shell: routes through (evidence: `src/main.tsx`)
- Route entry → Home and highlights: routes to (evidence: `src/main.tsx`)
- Route entry → Animal catalog: routes to (evidence: `src/main.tsx`)
- Route entry → Donation form: routes to (evidence: `src/main.tsx`)
- Route entry → About: routes to (evidence: `src/main.tsx`)
- Route entry → Contact: routes to (evidence: `src/main.tsx`)
- Route entry → Login and signup: routes to (evidence: `src/main.tsx`)
- Route entry → Platform reviews: routes to (evidence: `src/main.tsx`)
- Route entry → Admin dashboard: routes to (evidence: `src/main.tsx`)
- Site shell → Navigation: renders (evidence: `src/App.tsx`)
- Site shell → Footer: renders (evidence: `src/App.tsx`)
- Animal catalog → REST API: fetches animals (evidence: `src/Componetes/pages/Animais.tsx`)
- Donation form → REST API: submits animal (evidence: `src/Componetes/pages/Doar.tsx`)
- Login and signup → REST API: authenticates and registers (evidence: `src/Componetes/pages/Login.tsx`)
- Platform reviews → REST API: reads and submits reviews (evidence: `src/Componetes/pages/Avaliar.tsx`)
- Animal catalog → WhatsApp: contacts tutor (evidence: `README.md`)
- Admin dashboard → REST API: manages records (evidence: `README.md`)
- Home and highlights → REST API: loads highlights
- REST API → Database connection: uses connection pool (evidence: `src/Back Ends/serve.ts`)
- Database connection → MySQL database: connects to (evidence: `README.md`)
- REST API → MySQL database: falls back to memory (evidence: `README.md`)
