# tad-guilhermesimoes-cmd/djambagames architecture

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

- Interactive diagram: https://gitdiagram.com/tad-guilhermesimoes-cmd/djambagames
- Repository: https://github.com/tad-guilhermesimoes-cmd/djambagames

## Overview

AmparaPet is an animal-adoption API for Abrigo Toca de Assis. The main workflow is a public visitor browsing and filtering available animals, opening a detail page, and recording interest to receive a WhatsApp link; administrators manage animals, photos, status history, shelter information, and dashboard data. The map emphasizes API routes and their business, security, media, and persistence layers. Some route behavior is documented but not fully excerpted, so uncertain connections are omitted.

Main entry points: [`backend/app/main.py`](https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/main.py) (FastAPI application), [`backend/app/routers/admin.py`](https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/routers/admin.py) (Animal administration), [`backend/app/routers/publico.py`](https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/routers/publico.py) (Public routes), [`backend/app/models.py`](https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/models.py) (Relational records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and routes"]
  node_api_app["FastAPI application<br/>[main.py]"]
  node_public_routes["Public routes<br/>[publico.py]"]
  node_admin_routes["Animal administration<br/>[admin.py]"]
  node_auth_routes["Authentication routes<br/>[auth.py]"]
  node_user_routes["User administration<br/>[usuarios.py]"]
  node_validation["Request and response schemas<br/>[schemas.py]"]
end

subgraph group_adoption["Adoption domain"]
  node_business["Animal and shelter rules<br/>[servicos.py]"]
  node_animal_catalog["Animal catalog and status<br/>[admin.py]"]
  node_public_listing["Public listing and details<br/>[publico.py]"]
  node_interest["Interest and sharing links<br/>[publico.py]"]
  node_shelter_info["Shelter and adoption info<br/>[admin.py]"]
end

subgraph group_admin["Administration and identity"]
  node_dashboard["Adoption dashboard<br/>[admin.py]"]
  node_login["Login and sessions<br/>[auth.py]"]
  node_access_control["Password and access control<br/>[security.py]"]
  node_user_accounts["Administrator accounts<br/>[usuarios.py]"]
end

subgraph group_data["Persistence and media"]
  node_db_access["Database sessions<br/>[database.py]"]
  node_records[("Relational records<br/>[models.py]")]
  node_photo_processing["Photo processing<br/>[imagens.py]"]
  node_uploads["Uploaded photo files"]
  node_config["Runtime configuration<br/>[config.py]"]
  node_setup["Database initialization<br/>[init_db.py]"]
end

node_visitor(("Visitor or frontend"))
node_mysql[("MySQL database")]

node_visitor -->|"calls API"| node_api_app
node_api_app -->|"registers routes"| node_public_routes
node_api_app -->|"registers routes"| node_admin_routes
node_api_app -->|"registers routes"| node_auth_routes
node_api_app -->|"registers routes"| node_user_routes
node_api_app -->|"initializes database"| node_setup
node_api_app -->|"reads settings"| node_config
node_public_routes -->|"formats results"| node_business
node_public_routes -->|"queries animals"| node_records
node_admin_routes -->|"applies status rules"| node_business
node_admin_routes -->|"processes photos"| node_photo_processing
node_admin_routes -->|"updates records"| node_records
node_public_routes -->|"records interest"| node_interest
node_public_routes -->|"filters and paginates"| node_public_listing
node_business -->|"builds shelter links"| node_shelter_info
node_admin_routes -->|"aggregates counts"| node_dashboard
node_admin_routes -->|"saves shelter settings"| node_shelter_info
node_auth_routes -->|"checks credentials"| node_access_control
node_user_routes -->|"uses access control"| node_access_control
node_auth_routes -->|"reads accounts"| node_records
node_user_routes -->|"manages accounts"| node_records
node_admin_routes -->|"protects admin routes"| node_access_control
node_public_routes -->|"validates API data"| node_validation
node_admin_routes -->|"validates API data"| node_validation
node_auth_routes -->|"validates credentials"| node_validation
node_db_access -->|"uses database URL"| node_config
node_records -->|"declares ORM base"| node_db_access
node_db_access -->|"opens connection"| node_mysql
node_setup -->|"creates tables"| node_db_access
node_setup -->|"loads default settings"| node_business
node_setup -->|"creates sample photos"| node_photo_processing
node_photo_processing -->|"reads image limits"| node_config
node_photo_processing -->|"writes image files"| node_uploads
node_api_app -->|"serves static files"| node_uploads

click node_api_app "https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/main.py"
click node_public_routes "https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/routers/publico.py"
click node_admin_routes "https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/routers/admin.py"
click node_auth_routes "https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/routers/auth.py"
click node_user_routes "https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/routers/usuarios.py"
click node_validation "https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/schemas.py"
click node_business "https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/servicos.py"
click node_animal_catalog "https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/routers/admin.py"
click node_public_listing "https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/routers/publico.py"
click node_interest "https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/routers/publico.py"
click node_shelter_info "https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/routers/admin.py"
click node_dashboard "https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/routers/admin.py"
click node_login "https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/routers/auth.py"
click node_access_control "https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/security.py"
click node_user_accounts "https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/routers/usuarios.py"
click node_db_access "https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/database.py"
click node_records "https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/models.py"
click node_photo_processing "https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/imagens.py"
click node_config "https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/config.py"
click node_setup "https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/init_db.py"

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_api_app,node_public_routes,node_admin_routes,node_auth_routes,node_user_routes,node_validation,node_visitor toneBlue
class node_business,node_animal_catalog,node_public_listing,node_interest,node_shelter_info,node_mysql toneAmber
class node_dashboard,node_login,node_access_control,node_user_accounts toneMint
class node_db_access,node_records,node_photo_processing,node_uploads,node_config,node_setup toneRose
```

## Components

### API and routes

- [FastAPI application](https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/main.py): `backend/app/main.py`
- [Public routes](https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/routers/publico.py): `backend/app/routers/publico.py`
- [Animal administration](https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/routers/admin.py): `backend/app/routers/admin.py`
- [Authentication routes](https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/routers/auth.py): `backend/app/routers/auth.py`
- [User administration](https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/routers/usuarios.py): `backend/app/routers/usuarios.py`
- [Request and response schemas](https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/schemas.py): `backend/app/schemas.py`

### Adoption domain

- [Animal and shelter rules](https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/servicos.py): `backend/app/servicos.py`
- [Animal catalog and status](https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/routers/admin.py): `backend/app/routers/admin.py`
- [Public listing and details](https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/routers/publico.py): `backend/app/routers/publico.py`
- [Interest and sharing links](https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/routers/publico.py): `backend/app/routers/publico.py`
- [Shelter and adoption info](https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/routers/admin.py): `backend/app/routers/admin.py`

### Administration and identity

- [Adoption dashboard](https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/routers/admin.py): `backend/app/routers/admin.py`
- [Login and sessions](https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/routers/auth.py): `backend/app/routers/auth.py`
- [Password and access control](https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/security.py): `backend/app/security.py`
- [Administrator accounts](https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/routers/usuarios.py): `backend/app/routers/usuarios.py`

### Persistence and media

- [Database sessions](https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/database.py): `backend/app/database.py`
- [Relational records](https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/models.py): `backend/app/models.py`
- [Photo processing](https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/imagens.py): `backend/app/imagens.py`
- **Uploaded photo files**
- [Runtime configuration](https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/config.py): `backend/app/config.py`
- [Database initialization](https://github.com/tad-guilhermesimoes-cmd/djambagames/blob/main/backend/app/init_db.py): `backend/app/init_db.py`

### Other components

- **Visitor or frontend**
- **MySQL database**

## Connections

- Visitor or frontend → FastAPI application: calls API (evidence: `README.md`)
- FastAPI application → Public routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → Animal administration: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → Authentication routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → User administration: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → Database initialization: initializes database (evidence: `backend/app/main.py`)
- FastAPI application → Runtime configuration: reads settings (evidence: `backend/app/main.py`)
- Public routes → Animal and shelter rules: formats results (evidence: `backend/app/routers/publico.py`)
- Public routes → Relational records: queries animals (evidence: `backend/app/routers/publico.py`)
- Animal administration → Animal and shelter rules: applies status rules (evidence: `backend/app/routers/admin.py`)
- Animal administration → Photo processing: processes photos (evidence: `backend/app/routers/admin.py`)
- Animal administration → Relational records: updates records (evidence: `backend/app/routers/admin.py`)
- Public routes → Interest and sharing links: records interest (evidence: `backend/app/routers/publico.py`)
- Public routes → Public listing and details: filters and paginates (evidence: `backend/app/routers/publico.py`)
- Animal and shelter rules → Shelter and adoption info: builds shelter links (evidence: `backend/app/servicos.py`)
- Animal administration → Adoption dashboard: aggregates counts (evidence: `backend/app/routers/admin.py`)
- Animal administration → Shelter and adoption info: saves shelter settings (evidence: `backend/app/routers/admin.py`)
- Authentication routes → Password and access control: checks credentials (evidence: `backend/app/routers/auth.py`)
- User administration → Password and access control: uses access control (evidence: `backend/app/routers/usuarios.py`)
- Authentication routes → Relational records: reads accounts (evidence: `backend/app/routers/auth.py`)
- User administration → Relational records: manages accounts (evidence: `backend/app/routers/usuarios.py`)
- Animal administration → Password and access control: protects admin routes (evidence: `backend/app/routers/admin.py`)
- Public routes → Request and response schemas: validates API data (evidence: `backend/app/routers/publico.py`)
- Animal administration → Request and response schemas: validates API data (evidence: `backend/app/routers/admin.py`)
- Authentication routes → Request and response schemas: validates credentials (evidence: `backend/app/routers/auth.py`)
- Database sessions → Runtime configuration: uses database URL (evidence: `backend/app/database.py`)
- Relational records → Database sessions: declares ORM base (evidence: `backend/app/models.py`)
- Database sessions → MySQL database: opens connection (evidence: `backend/app/database.py`)
- Database initialization → Database sessions: creates tables (evidence: `backend/app/init_db.py`)
- Database initialization → Animal and shelter rules: loads default settings (evidence: `backend/app/init_db.py`)
- Database initialization → Photo processing: creates sample photos (evidence: `backend/app/init_db.py`)
- Photo processing → Runtime configuration: reads image limits (evidence: `backend/app/imagens.py`)
- Photo processing → Uploaded photo files: writes image files (evidence: `backend/app/imagens.py`)
- FastAPI application → Uploaded photo files: serves static files (evidence: `backend/app/main.py`)
