# zeckborges/php-crud-mvc architecture

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

- Interactive diagram: https://gitdiagram.com/zeckborges/php-crud-mvc
- Repository: https://github.com/zeckborges/php-crud-mvc

## Overview

This PHP product-catalog application routes browser requests to product controller actions, which load or mutate product data through a model and PostgreSQL DAO, then render catalog or product-form views. The main user flows are browsing/searching the home catalog and product list, creating or editing product records, and invoking the delete route (the DAO currently decrements quantity). The tree also documents styling and a SQL file, but their contents and runtime connections were not sampled; no README description was available.

Main entry points: [`App/Controller/ProdutoController.php`](https://github.com/zeckborges/php-crud-mvc/blob/main/App/Controller/ProdutoController.php) (Product controller), [`App/index.php`](https://github.com/zeckborges/php-crud-mvc/blob/main/App/index.php) (PHP entry point), [`App/Router/Router.php`](https://github.com/zeckborges/php-crud-mvc/blob/main/App/Router/Router.php) (Route dispatcher), [`App/Model/ProdutoModel.php`](https://github.com/zeckborges/php-crud-mvc/blob/main/App/Model/ProdutoModel.php) (Product model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web entry and routing"]
  node_entry["PHP entry point<br/>[index.php]"]
  node_router["Route dispatcher<br/>[Router.php]"]
end

subgraph group_product["Product operations"]
  node_controller["Product controller"]
  node_model["Product model<br/>[ProdutoModel.php]"]
end

subgraph group_presentation["Catalog and forms"]
  node_home["Home catalog<br/>[Home.php]"]
  node_listing["Product list<br/>[ListaProdutos.php]"]
  node_product_form["Product form<br/>[Produto.php]"]
  node_edit_form["Edit form<br/>[Editar.php]"]
end

subgraph group_persistence["Product persistence"]
  node_dao["Product DAO<br/>[ProdutoDAO.php]"]
  node_postgres[("PostgreSQL")]
end

node_browser(("Browser user"))

node_browser -->|"requests pages"| node_entry
node_entry -->|"dispatches URL"| node_router
node_entry -->|"registers handlers"| node_controller
node_router -->|"invokes matched route"| node_controller
node_controller -->|"loads product model"| node_model
node_controller -->|"renders home"| node_home
node_controller -->|"renders list"| node_listing
node_controller -->|"renders form"| node_product_form
node_controller -->|"renders edit form"| node_edit_form
node_model -->|"delegates data access"| node_dao
node_dao -->|"queries product records"| node_postgres
node_home -->|"shows searchable catalog"| node_browser
node_listing -->|"shows searchable list"| node_browser
node_product_form -->|"submits product fields"| node_browser
node_edit_form -->|"submits edited fields"| node_browser

click node_entry "https://github.com/zeckborges/php-crud-mvc/blob/main/App/index.php"
click node_router "https://github.com/zeckborges/php-crud-mvc/blob/main/App/Router/Router.php"
click node_controller "https://github.com/zeckborges/php-crud-mvc/blob/main/App/Controller/ProdutoController.php"
click node_model "https://github.com/zeckborges/php-crud-mvc/blob/main/App/Model/ProdutoModel.php"
click node_dao "https://github.com/zeckborges/php-crud-mvc/blob/main/App/DAO/ProdutoDAO.php"
click node_home "https://github.com/zeckborges/php-crud-mvc/blob/main/App/View/modules/Produtos/Home.php"
click node_listing "https://github.com/zeckborges/php-crud-mvc/blob/main/App/View/modules/Produtos/ListaProdutos.php"
click node_product_form "https://github.com/zeckborges/php-crud-mvc/blob/main/App/View/modules/Produtos/Produto.php"
click node_edit_form "https://github.com/zeckborges/php-crud-mvc/blob/main/App/View/modules/Produtos/Editar.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_entry,node_router,node_browser toneBlue
class node_controller,node_model toneAmber
class node_home,node_listing,node_product_form,node_edit_form toneMint
class node_dao,node_postgres toneRose
```

## Components

### Web entry and routing

- [PHP entry point](https://github.com/zeckborges/php-crud-mvc/blob/main/App/index.php): `App/index.php`
- [Route dispatcher](https://github.com/zeckborges/php-crud-mvc/blob/main/App/Router/Router.php): `App/Router/Router.php`

### Product operations

- [Product controller](https://github.com/zeckborges/php-crud-mvc/blob/main/App/Controller/ProdutoController.php): `App/Controller/ProdutoController.php`
- [Product model](https://github.com/zeckborges/php-crud-mvc/blob/main/App/Model/ProdutoModel.php): `App/Model/ProdutoModel.php`

### Catalog and forms

- [Home catalog](https://github.com/zeckborges/php-crud-mvc/blob/main/App/View/modules/Produtos/Home.php): `App/View/modules/Produtos/Home.php`
- [Product list](https://github.com/zeckborges/php-crud-mvc/blob/main/App/View/modules/Produtos/ListaProdutos.php): `App/View/modules/Produtos/ListaProdutos.php`
- [Product form](https://github.com/zeckborges/php-crud-mvc/blob/main/App/View/modules/Produtos/Produto.php): `App/View/modules/Produtos/Produto.php`
- [Edit form](https://github.com/zeckborges/php-crud-mvc/blob/main/App/View/modules/Produtos/Editar.php): `App/View/modules/Produtos/Editar.php`

### Product persistence

- [Product DAO](https://github.com/zeckborges/php-crud-mvc/blob/main/App/DAO/ProdutoDAO.php): `App/DAO/ProdutoDAO.php`
- **PostgreSQL**

### Other components

- **Browser user**

## Connections

- Browser user → PHP entry point: requests pages
- PHP entry point → Route dispatcher: dispatches URL (evidence: `App/index.php`)
- PHP entry point → Product controller: registers handlers (evidence: `App/index.php`)
- Route dispatcher → Product controller: invokes matched route (evidence: `App/Router/Router.php`)
- Product controller → Product model: loads product model (evidence: `App/Controller/ProdutoController.php`)
- Product controller → Home catalog: renders home (evidence: `App/Controller/ProdutoController.php`)
- Product controller → Product list: renders list (evidence: `App/Controller/ProdutoController.php`)
- Product controller → Product form: renders form (evidence: `App/Controller/ProdutoController.php`)
- Product controller → Edit form: renders edit form (evidence: `App/Controller/ProdutoController.php`)
- Product model → Product DAO: delegates data access (evidence: `App/Model/ProdutoModel.php`)
- Product DAO → PostgreSQL: queries product records (evidence: `App/DAO/ProdutoDAO.php`)
- Home catalog → Browser user: shows searchable catalog (evidence: `App/View/modules/Produtos/Home.php`)
- Product list → Browser user: shows searchable list (evidence: `App/View/modules/Produtos/ListaProdutos.php`)
- Product form → Browser user: submits product fields (evidence: `App/View/modules/Produtos/Produto.php`)
- Edit form → Browser user: submits edited fields (evidence: `App/View/modules/Produtos/Editar.php`)
