# miguelpaschoal8/projeto_helio_3bi---atualizado architecture

> Architecture diagram of the GitHub repository miguelpaschoal8/projeto_helio_3bi---atualizado, 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/miguelpaschoal8/projeto_helio_3bi---atualizado
- Repository: https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado

## Overview

This repository implements a restaurant-management HTTP API for clients, staff, tables, orders, and payments. The principal workflow is an HTTP request entering the PHP/Slim application, being routed to a resource controller, and having business operations handled by a service; sampled order and payment services also access DAOs and MySQL. The README provides no feature detail, and several resource services and DAOs were not excerpted, so their internal calls are not inferred. The public JavaScript is included as a separate client component; its runtime relationship to the API is not established by the available evidence.

Main entry points: [`src/api/server/Server.php`](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/server/Server.php) (HTTP server), [`src/api/services/PagamentoService.php`](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/services/PagamentoService.php) (Payment service), [`src/api/dao/PedidoDAO.php`](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/dao/PedidoDAO.php) (Order DAO), [`src/api/database/MysqlDatabase.php`](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/database/MysqlDatabase.php) (MySQL connection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["API entry and routing"]
  node_php_entry["PHP entry point<br/>[index.php]"]
  node_server["HTTP server<br/>[Server.php]"]
  node_client_js["JavaScript client<br/>[Apiservice.js]"]
  node_client_routes["Client routes<br/>[ClienteRouter.php]"]
  node_staff_routes["Staff routes"]
  node_table_routes["Table routes<br/>[MesaRouter.php]"]
  node_order_routes["Order routes<br/>[PedidoRouter.php]"]
  node_payment_routes["Payment routes"]
end

subgraph group_resources["Restaurant resources"]
  node_client_controller["Client controller"]
  node_staff_controller["Staff controller"]
  node_table_controller["Table controller<br/>[MesaController.php]"]
  node_order_controller["Order controller"]
  node_payment_controller["Payment controller"]
end

subgraph group_domain["Business services"]
  node_client_service["Client service<br/>[ClienteService.php]"]
  node_staff_service["Staff service"]
  node_table_service["Table service<br/>[MesaService.php]"]
  node_order_service["Order service<br/>[PedidoService.php]"]
  node_payment_service["Payment service"]
end

subgraph group_persistence["Persistence and models"]
  node_client_dao["Client DAO<br/>[ClienteDao.php]"]
  node_staff_dao["Staff DAO<br/>[FuncionarioDao.php]"]
  node_table_dao["Table DAO<br/>[MesaDao.php]"]
  node_order_dao["Order DAO<br/>[PedidoDAO.php]"]
  node_payment_dao["Payment DAO<br/>[PagamentoDAO.php]"]
  node_mysql[("MySQL connection<br/>[MysqlDatabase.php]")]
  node_client_model["Client model<br/>[cliente.php]"]
  node_staff_model["Staff model<br/>[Funcionario.php]"]
  node_table_model["Table model<br/>[Mesa.php]"]
  node_order_model["Order model<br/>[Pedido.php]"]
  node_payment_model["Payment model<br/>[Pagamento.php]"]
end

subgraph group_shared["Shared infrastructure"]
  node_errors["Error responses<br/>[ErrorResponse.php]"]
end

node_user(("API consumer"))

node_user -->|"sends HTTP"| node_php_entry
node_php_entry -->|"starts"| node_server
node_server -->|"registers routes"| node_client_routes
node_server -->|"registers routes"| node_staff_routes
node_server -->|"registers routes"| node_table_routes
node_server -->|"registers routes"| node_order_routes
node_server -->|"registers routes"| node_payment_routes
node_client_routes -->|"dispatches to"| node_client_controller
node_staff_routes -->|"dispatches to"| node_staff_controller
node_table_routes -->|"dispatches to"| node_table_controller
node_order_routes -->|"dispatches to"| node_order_controller
node_payment_routes -->|"dispatches to"| node_payment_controller
node_client_controller -->|"calls"| node_client_service
node_staff_controller -->|"calls"| node_staff_service
node_table_controller -->|"calls"| node_table_service
node_order_controller -->|"calls"| node_order_service
node_payment_controller -->|"calls"| node_payment_service
node_order_service -->|"uses"| node_order_dao
node_payment_service -->|"checks order"| node_order_dao
node_payment_service -->|"uses"| node_payment_dao
node_order_dao -->|"queries"| node_mysql
node_payment_dao -->|"queries"| node_mysql
node_client_dao -->|"uses connection"| node_mysql
node_server -->|"formats errors"| node_errors

click node_php_entry "https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/public/index.php"
click node_server "https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/server/Server.php"
click node_client_js "https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/public/Apiservice.js"
click node_client_routes "https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/routes/ClienteRouter.php"
click node_staff_routes "https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/routes/FuncionarioRouter.php"
click node_table_routes "https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/routes/MesaRouter.php"
click node_order_routes "https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/routes/PedidoRouter.php"
click node_payment_routes "https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/routes/PagamentoRouter.php"
click node_client_controller "https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/controllers/ClienteController.php"
click node_staff_controller "https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/controllers/FuncionarioController.php"
click node_table_controller "https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/controllers/MesaController.php"
click node_order_controller "https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/controllers/PedidoController.php"
click node_payment_controller "https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/controllers/PagamentoController.php"
click node_client_service "https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/services/ClienteService.php"
click node_staff_service "https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/services/FuncionarioService.php"
click node_table_service "https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/services/MesaService.php"
click node_order_service "https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/services/PedidoService.php"
click node_payment_service "https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/services/PagamentoService.php"
click node_client_dao "https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/dao/ClienteDao.php"
click node_staff_dao "https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/dao/FuncionarioDao.php"
click node_table_dao "https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/dao/MesaDao.php"
click node_order_dao "https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/dao/PedidoDAO.php"
click node_payment_dao "https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/dao/PagamentoDAO.php"
click node_mysql "https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/database/MysqlDatabase.php"
click node_client_model "https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/models/cliente.php"
click node_staff_model "https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/models/Funcionario.php"
click node_table_model "https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/models/Mesa.php"
click node_order_model "https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/models/Pedido.php"
click node_payment_model "https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/models/Pagamento.php"
click node_errors "https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/http/ErrorResponse.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_php_entry,node_server,node_client_js,node_client_routes,node_staff_routes,node_table_routes,node_order_routes,node_payment_routes toneBlue
class node_client_controller,node_staff_controller,node_table_controller,node_order_controller,node_payment_controller toneAmber
class node_client_service,node_staff_service,node_table_service,node_order_service,node_payment_service,node_user toneMint
class node_client_dao,node_staff_dao,node_table_dao,node_order_dao,node_payment_dao,node_mysql,node_client_model,node_staff_model,node_table_model,node_order_model,node_payment_model toneRose
class node_errors toneIndigo
```

## Components

### API entry and routing

- [PHP entry point](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/public/index.php): `public/index.php`
- [HTTP server](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/server/Server.php): `src/api/server/Server.php`
- [JavaScript client](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/public/Apiservice.js): `public/Apiservice.js`
- [Client routes](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/routes/ClienteRouter.php): `src/api/routes/ClienteRouter.php`
- [Staff routes](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/routes/FuncionarioRouter.php): `src/api/routes/FuncionarioRouter.php`
- [Table routes](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/routes/MesaRouter.php): `src/api/routes/MesaRouter.php`
- [Order routes](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/routes/PedidoRouter.php): `src/api/routes/PedidoRouter.php`
- [Payment routes](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/routes/PagamentoRouter.php): `src/api/routes/PagamentoRouter.php`

### Restaurant resources

- [Client controller](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/controllers/ClienteController.php): `src/api/controllers/ClienteController.php`
- [Staff controller](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/controllers/FuncionarioController.php): `src/api/controllers/FuncionarioController.php`
- [Table controller](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/controllers/MesaController.php): `src/api/controllers/MesaController.php`
- [Order controller](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/controllers/PedidoController.php): `src/api/controllers/PedidoController.php`
- [Payment controller](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/controllers/PagamentoController.php): `src/api/controllers/PagamentoController.php`

### Business services

- [Client service](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/services/ClienteService.php): `src/api/services/ClienteService.php`
- [Staff service](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/services/FuncionarioService.php): `src/api/services/FuncionarioService.php`
- [Table service](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/services/MesaService.php): `src/api/services/MesaService.php`
- [Order service](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/services/PedidoService.php): `src/api/services/PedidoService.php`
- [Payment service](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/services/PagamentoService.php): `src/api/services/PagamentoService.php`

### Persistence and models

- [Client DAO](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/dao/ClienteDao.php): `src/api/dao/ClienteDao.php`
- [Staff DAO](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/dao/FuncionarioDao.php): `src/api/dao/FuncionarioDao.php`
- [Table DAO](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/dao/MesaDao.php): `src/api/dao/MesaDao.php`
- [Order DAO](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/dao/PedidoDAO.php): `src/api/dao/PedidoDAO.php`
- [Payment DAO](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/dao/PagamentoDAO.php): `src/api/dao/PagamentoDAO.php`
- [MySQL connection](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/database/MysqlDatabase.php): `src/api/database/MysqlDatabase.php`
- [Client model](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/models/cliente.php): `src/api/models/cliente.php`
- [Staff model](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/models/Funcionario.php): `src/api/models/Funcionario.php`
- [Table model](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/models/Mesa.php): `src/api/models/Mesa.php`
- [Order model](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/models/Pedido.php): `src/api/models/Pedido.php`
- [Payment model](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/models/Pagamento.php): `src/api/models/Pagamento.php`

### Shared infrastructure

- [Error responses](https://github.com/miguelpaschoal8/projeto_helio_3bi---atualizado/blob/main/src/api/http/ErrorResponse.php): `src/api/http/ErrorResponse.php`

### Other components

- **API consumer**

## Connections

- API consumer → PHP entry point: sends HTTP (evidence: `public/index.php`)
- PHP entry point → HTTP server: starts (evidence: `public/index.php`)
- HTTP server → Client routes: registers routes (evidence: `src/api/server/Server.php`)
- HTTP server → Staff routes: registers routes (evidence: `src/api/server/Server.php`)
- HTTP server → Table routes: registers routes (evidence: `src/api/server/Server.php`)
- HTTP server → Order routes: registers routes (evidence: `src/api/server/Server.php`)
- HTTP server → Payment routes: registers routes (evidence: `src/api/server/Server.php`)
- Client routes → Client controller: dispatches to (evidence: `src/api/routes/ClienteRouter.php`)
- Staff routes → Staff controller: dispatches to (evidence: `src/api/routes/FuncionarioRouter.php`)
- Table routes → Table controller: dispatches to (evidence: `src/api/routes/MesaRouter.php`)
- Order routes → Order controller: dispatches to (evidence: `src/api/routes/PedidoRouter.php`)
- Payment routes → Payment controller: dispatches to (evidence: `src/api/routes/PagamentoRouter.php`)
- Client controller → Client service: calls (evidence: `src/api/controllers/ClienteController.php`)
- Staff controller → Staff service: calls (evidence: `src/api/controllers/FuncionarioController.php`)
- Table controller → Table service: calls (evidence: `src/api/controllers/MesaController.php`)
- Order controller → Order service: calls (evidence: `src/api/controllers/PedidoController.php`)
- Payment controller → Payment service: calls (evidence: `src/api/controllers/PagamentoController.php`)
- Order service → Order DAO: uses (evidence: `src/api/services/PedidoService.php`)
- Payment service → Order DAO: checks order (evidence: `src/api/services/PagamentoService.php`)
- Payment service → Payment DAO: uses (evidence: `src/api/services/PagamentoService.php`)
- Order DAO → MySQL connection: queries (evidence: `src/api/dao/PedidoDAO.php`)
- Payment DAO → MySQL connection: queries (evidence: `src/api/dao/PagamentoDAO.php`)
- Client DAO → MySQL connection: uses connection (evidence: `src/api/dao/ClienteDao.php`)
- HTTP server → Error responses: formats errors (evidence: `src/api/server/Server.php`)
