# joaocarloslima/suporte architecture

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

- Interactive diagram: https://gitdiagram.com/joaocarloslima/suporte
- Repository: https://github.com/joaocarloslima/suporte

## Overview

ETECIA’s support system lets users authenticate, open and review IT support tickets, and rate completed work; administrators manage tickets, users, locations and equipment, with ticket statistics surfaced in the admin area. PHP page handlers coordinate domain classes, which use a shared PDO connection for persistence. The excerpts show ticket creation and AJAX flows plus equipment administration; other listed capabilities are represented from the source index, so their internal links are omitted where call ownership is not shown.

Main entry points: [`chamados.php`](https://github.com/joaocarloslima/suporte/blob/master/chamados.php) (Ticket pages), [`adm/index.php`](https://github.com/joaocarloslima/suporte/blob/master/adm/index.php) (Admin router), [`classes/Conexao.php`](https://github.com/joaocarloslima/suporte/blob/master/classes/Conexao.php) (PDO connection), [`index.php`](https://github.com/joaocarloslima/suporte/blob/master/index.php) (Public router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry and auth"]
  node_router["Public router<br/>[index.php]"]
  node_login["Login<br/>[login.php]"]
  node_auth["Authenticate<br/>[logar.php]"]
  node_profile["User profile<br/>[perfil.php]"]
end

subgraph group_tickets["Ticket operations"]
  node_tickets_page["Ticket pages<br/>[chamados.php]"]
  node_ticket_views["Ticket views"]
  node_ticket_create_view["Ticket form<br/>[chamados_criar.php]"]
  node_ticket_closed_view["Closed tickets"]
  node_ticket_api["Ticket API<br/>[api_chamado.php]"]
  node_equipment_api["Equipment API"]
end

subgraph group_admin["Administration"]
  node_admin_router["Admin router<br/>[index.php]"]
  node_admin_tickets["Admin tickets<br/>[chamados.php]"]
  node_admin_equipment["Equipment management<br/>[equipamentos.php]"]
  node_admin_locations["Location management<br/>[locais.php]"]
  node_admin_users["User management<br/>[usuarios.php]"]
  node_admin_stats["Ticket statistics<br/>[estatisticas.php]"]
end

subgraph group_domain["Domain and persistence"]
  node_ticket_domain["Ticket records<br/>[Chamado.php]"]
  node_equipment_domain["Equipment records<br/>[Equipamento.php]"]
  node_location_domain["Location records<br/>[Local.php]"]
  node_user_domain["User records<br/>[Usuario.php]"]
  node_ticket_render["Ticket formatting<br/>[View.php]"]
  node_connection["PDO connection<br/>[Conexao.php]"]
end

node_user(("User"))
node_database[("Application database")]

node_user -->|"requests pages"| node_router
node_router -->|"routes to"| node_login
node_router -->|"routes to"| node_tickets_page
node_user -->|"submits credentials"| node_auth
node_auth -->|"authenticates with"| node_user_domain
node_router -->|"routes to"| node_profile
node_tickets_page -->|"creates ticket"| node_ticket_domain
node_tickets_page -->|"rates via AJAX"| node_ticket_api
node_tickets_page -->|"filters by location"| node_equipment_api
node_tickets_page -->|"includes open view"| node_ticket_views
node_tickets_page -->|"includes form"| node_ticket_create_view
node_tickets_page -->|"includes closed view"| node_ticket_closed_view
node_ticket_api -->|"updates rating"| node_ticket_domain
node_equipment_api -->|"filters equipment"| node_equipment_domain
node_admin_router -->|"routes to"| node_admin_tickets
node_admin_router -->|"routes to"| node_admin_equipment
node_admin_router -->|"routes to"| node_admin_locations
node_admin_router -->|"routes to"| node_admin_users
node_admin_router -->|"routes to"| node_admin_stats
node_admin_equipment -->|"manages equipment"| node_equipment_domain
node_admin_equipment -->|"loads locations"| node_location_domain
node_ticket_domain -->|"gets connection"| node_connection
node_equipment_domain -->|"gets connection"| node_connection
node_location_domain -->|"gets connection"| node_connection
node_user_domain -->|"gets connection"| node_connection
node_connection -->|"opens PDO"| node_database
node_ticket_domain -->|"queries tickets"| node_database
node_equipment_domain -->|"queries equipment"| node_database
node_location_domain -->|"queries locations"| node_database
node_user_domain -->|"queries users"| node_database

click node_router "https://github.com/joaocarloslima/suporte/blob/master/index.php"
click node_login "https://github.com/joaocarloslima/suporte/blob/master/login.php"
click node_auth "https://github.com/joaocarloslima/suporte/blob/master/logar.php"
click node_profile "https://github.com/joaocarloslima/suporte/blob/master/perfil.php"
click node_tickets_page "https://github.com/joaocarloslima/suporte/blob/master/chamados.php"
click node_ticket_views "https://github.com/joaocarloslima/suporte/blob/master/chamados_abertos.php"
click node_ticket_create_view "https://github.com/joaocarloslima/suporte/blob/master/chamados_criar.php"
click node_ticket_closed_view "https://github.com/joaocarloslima/suporte/blob/master/chamados_fechados.php"
click node_ticket_api "https://github.com/joaocarloslima/suporte/blob/master/api/api_chamado.php"
click node_equipment_api "https://github.com/joaocarloslima/suporte/blob/master/api/api_equipamentos.php"
click node_admin_router "https://github.com/joaocarloslima/suporte/blob/master/adm/index.php"
click node_admin_tickets "https://github.com/joaocarloslima/suporte/blob/master/adm/chamados.php"
click node_admin_equipment "https://github.com/joaocarloslima/suporte/blob/master/adm/equipamentos.php"
click node_admin_locations "https://github.com/joaocarloslima/suporte/blob/master/adm/locais.php"
click node_admin_users "https://github.com/joaocarloslima/suporte/blob/master/adm/usuarios.php"
click node_admin_stats "https://github.com/joaocarloslima/suporte/blob/master/adm/estatisticas.php"
click node_ticket_domain "https://github.com/joaocarloslima/suporte/blob/master/classes/Chamado.php"
click node_equipment_domain "https://github.com/joaocarloslima/suporte/blob/master/classes/Equipamento.php"
click node_location_domain "https://github.com/joaocarloslima/suporte/blob/master/classes/Local.php"
click node_user_domain "https://github.com/joaocarloslima/suporte/blob/master/classes/Usuario.php"
click node_ticket_render "https://github.com/joaocarloslima/suporte/blob/master/classes/View.php"
click node_connection "https://github.com/joaocarloslima/suporte/blob/master/classes/Conexao.php"

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_login,node_auth,node_profile,node_user toneBlue
class node_tickets_page,node_ticket_views,node_ticket_create_view,node_ticket_closed_view,node_ticket_api,node_equipment_api,node_database toneAmber
class node_admin_router,node_admin_tickets,node_admin_equipment,node_admin_locations,node_admin_users,node_admin_stats toneMint
class node_ticket_domain,node_equipment_domain,node_location_domain,node_user_domain,node_ticket_render,node_connection toneRose
```

## Components

### Web entry and auth

- [Public router](https://github.com/joaocarloslima/suporte/blob/master/index.php): `index.php`
- [Login](https://github.com/joaocarloslima/suporte/blob/master/login.php): `login.php`
- [Authenticate](https://github.com/joaocarloslima/suporte/blob/master/logar.php): `logar.php`
- [User profile](https://github.com/joaocarloslima/suporte/blob/master/perfil.php): `perfil.php`

### Ticket operations

- [Ticket pages](https://github.com/joaocarloslima/suporte/blob/master/chamados.php): `chamados.php`
- [Ticket views](https://github.com/joaocarloslima/suporte/blob/master/chamados_abertos.php): `chamados_abertos.php`
- [Ticket form](https://github.com/joaocarloslima/suporte/blob/master/chamados_criar.php): `chamados_criar.php`
- [Closed tickets](https://github.com/joaocarloslima/suporte/blob/master/chamados_fechados.php): `chamados_fechados.php`
- [Ticket API](https://github.com/joaocarloslima/suporte/blob/master/api/api_chamado.php): `api/api_chamado.php`
- [Equipment API](https://github.com/joaocarloslima/suporte/blob/master/api/api_equipamentos.php): `api/api_equipamentos.php`

### Administration

- [Admin router](https://github.com/joaocarloslima/suporte/blob/master/adm/index.php): `adm/index.php`
- [Admin tickets](https://github.com/joaocarloslima/suporte/blob/master/adm/chamados.php): `adm/chamados.php`
- [Equipment management](https://github.com/joaocarloslima/suporte/blob/master/adm/equipamentos.php): `adm/equipamentos.php`
- [Location management](https://github.com/joaocarloslima/suporte/blob/master/adm/locais.php): `adm/locais.php`
- [User management](https://github.com/joaocarloslima/suporte/blob/master/adm/usuarios.php): `adm/usuarios.php`
- [Ticket statistics](https://github.com/joaocarloslima/suporte/blob/master/adm/estatisticas.php): `adm/estatisticas.php`

### Domain and persistence

- [Ticket records](https://github.com/joaocarloslima/suporte/blob/master/classes/Chamado.php): `classes/Chamado.php`
- [Equipment records](https://github.com/joaocarloslima/suporte/blob/master/classes/Equipamento.php): `classes/Equipamento.php`
- [Location records](https://github.com/joaocarloslima/suporte/blob/master/classes/Local.php): `classes/Local.php`
- [User records](https://github.com/joaocarloslima/suporte/blob/master/classes/Usuario.php): `classes/Usuario.php`
- [Ticket formatting](https://github.com/joaocarloslima/suporte/blob/master/classes/View.php): `classes/View.php`
- [PDO connection](https://github.com/joaocarloslima/suporte/blob/master/classes/Conexao.php): `classes/Conexao.php`

### Other components

- **User**
- **Application database**

## Connections

- User → Public router: requests pages (evidence: `index.php`)
- Public router → Login: routes to (evidence: `index.php`)
- Public router → Ticket pages: routes to (evidence: `index.php`)
- User → Authenticate: submits credentials (evidence: `logar.php`)
- Authenticate → User records: authenticates with (evidence: `logar.php`)
- Public router → User profile: routes to (evidence: `index.php`)
- Ticket pages → Ticket records: creates ticket (evidence: `chamados.php`)
- Ticket pages → Ticket API: rates via AJAX (evidence: `chamados.php`)
- Ticket pages → Equipment API: filters by location (evidence: `chamados.php`)
- Ticket pages → Ticket views: includes open view (evidence: `chamados.php`)
- Ticket pages → Ticket form: includes form (evidence: `chamados.php`)
- Ticket pages → Closed tickets: includes closed view (evidence: `chamados.php`)
- Ticket API → Ticket records: updates rating (evidence: `api/api_chamado.php`)
- Equipment API → Equipment records: filters equipment (evidence: `api/api_equipamentos.php`)
- Admin router → Admin tickets: routes to (evidence: `adm/index.php`)
- Admin router → Equipment management: routes to (evidence: `adm/index.php`)
- Admin router → Location management: routes to (evidence: `adm/index.php`)
- Admin router → User management: routes to (evidence: `adm/index.php`)
- Admin router → Ticket statistics: routes to (evidence: `adm/index.php`)
- Equipment management → Equipment records: manages equipment (evidence: `adm/equipamentos.php`)
- Equipment management → Location records: loads locations (evidence: `adm/equipamentos.php`)
- Ticket records → PDO connection: gets connection (evidence: `classes/Chamado.php`)
- Equipment records → PDO connection: gets connection (evidence: `classes/Equipamento.php`)
- Location records → PDO connection: gets connection (evidence: `classes/Local.php`)
- User records → PDO connection: gets connection (evidence: `classes/Usuario.php`)
- PDO connection → Application database: opens PDO (evidence: `classes/Conexao.php`)
- Ticket records → Application database: queries tickets (evidence: `classes/Chamado.php`)
- Equipment records → Application database: queries equipment (evidence: `classes/Equipamento.php`)
- Location records → Application database: queries locations (evidence: `classes/Local.php`)
- User records → Application database: queries users (evidence: `classes/Usuario.php`)
