# rmbinformatica/controle-estoque architecture

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

- Interactive diagram: https://gitdiagram.com/rmbinformatica/controle-estoque
- Repository: https://github.com/rmbinformatica/controle-estoque

## Overview

This is a PHP/MySQL inventory-control application. Users register products, record stock receipts and issues, and inspect current stock, below-minimum items, and a product’s movement history. The sampled home page builds an inventory-composition chart from the current-stock table; shared PHP functions provide database access and page utilities. The README establishes the product capabilities, but most operation pages were not sampled, so their implementation links are shown as unverified rather than inferred call chains.

Main entry points: [`funcoes.php`](https://github.com/rmbinformatica/controle-estoque/blob/main/funcoes.php) (Database utilities), [`index.php`](https://github.com/rmbinformatica/controle-estoque/blob/main/index.php) (Stock overview), [`produto.php`](https://github.com/rmbinformatica/controle-estoque/blob/main/produto.php) (Product catalog), [`entrada.php`](https://github.com/rmbinformatica/controle-estoque/blob/main/entrada.php) (Stock receipts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Inventory workflows"]
  node_home["Stock overview<br/>[index.php]"]
  node_products["Product catalog<br/>[produto.php]"]
  node_receipts["Stock receipts<br/>[entrada.php]"]
  node_issues["Stock issues<br/>[saida.php]"]
  node_current["Current stock<br/>[estoque_atual.php]"]
  node_minimum["Minimum stock<br/>[estoque_minimo.php]"]
  node_movements["Product movements"]
end

subgraph group_shared["Shared PHP layer"]
  node_functions["Database utilities<br/>[funcoes.php]"]
  node_dbconfig["DB credentials template<br/>[modelo.banco.php]"]
  node_database[("MySQL inventory data")]
end

subgraph group_presentation["Page presentation"]
  node_layout["Shared page layout<br/>[head.php]"]
  node_footer["Page footer<br/>[footer-bar.php]"]
end

node_user(("Inventory user"))

node_user -.->|"opens"| node_home
node_user -.->|"manages"| node_products
node_user -.->|"records"| node_receipts
node_user -.->|"records"| node_issues
node_user -.->|"views"| node_current
node_user -.->|"views"| node_minimum
node_user -.->|"inspects"| node_movements
node_home -->|"queries stock"| node_database
node_home -->|"requires"| node_layout
node_home -->|"requires"| node_footer
node_layout -->|"requires"| node_functions
node_functions -->|"queries"| node_database
node_functions -.->|"loads credentials"| node_dbconfig
node_products -.->|"uses utilities"| node_functions
node_receipts -.->|"uses utilities"| node_functions
node_issues -.->|"uses utilities"| node_functions
node_current -.->|"uses utilities"| node_functions
node_minimum -.->|"uses utilities"| node_functions
node_movements -.->|"uses utilities"| node_functions

click node_home "https://github.com/rmbinformatica/controle-estoque/blob/main/index.php"
click node_products "https://github.com/rmbinformatica/controle-estoque/blob/main/produto.php"
click node_receipts "https://github.com/rmbinformatica/controle-estoque/blob/main/entrada.php"
click node_issues "https://github.com/rmbinformatica/controle-estoque/blob/main/saida.php"
click node_current "https://github.com/rmbinformatica/controle-estoque/blob/main/estoque_atual.php"
click node_minimum "https://github.com/rmbinformatica/controle-estoque/blob/main/estoque_minimo.php"
click node_movements "https://github.com/rmbinformatica/controle-estoque/blob/main/movimentacao_produto.php"
click node_functions "https://github.com/rmbinformatica/controle-estoque/blob/main/funcoes.php"
click node_dbconfig "https://github.com/rmbinformatica/controle-estoque/blob/main/modelo.banco.php"
click node_layout "https://github.com/rmbinformatica/controle-estoque/blob/main/head.php"
click node_footer "https://github.com/rmbinformatica/controle-estoque/blob/main/footer-bar.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_home,node_products,node_receipts,node_issues,node_current,node_minimum,node_movements,node_user toneBlue
class node_functions,node_dbconfig,node_database toneAmber
class node_layout,node_footer toneMint
```

## Components

### Inventory workflows

- [Stock overview](https://github.com/rmbinformatica/controle-estoque/blob/main/index.php): `index.php`
- [Product catalog](https://github.com/rmbinformatica/controle-estoque/blob/main/produto.php): `produto.php`
- [Stock receipts](https://github.com/rmbinformatica/controle-estoque/blob/main/entrada.php): `entrada.php`
- [Stock issues](https://github.com/rmbinformatica/controle-estoque/blob/main/saida.php): `saida.php`
- [Current stock](https://github.com/rmbinformatica/controle-estoque/blob/main/estoque_atual.php): `estoque_atual.php`
- [Minimum stock](https://github.com/rmbinformatica/controle-estoque/blob/main/estoque_minimo.php): `estoque_minimo.php`
- [Product movements](https://github.com/rmbinformatica/controle-estoque/blob/main/movimentacao_produto.php): `movimentacao_produto.php`

### Shared PHP layer

- [Database utilities](https://github.com/rmbinformatica/controle-estoque/blob/main/funcoes.php): `funcoes.php`
- [DB credentials template](https://github.com/rmbinformatica/controle-estoque/blob/main/modelo.banco.php): `modelo.banco.php`
- **MySQL inventory data**

### Page presentation

- [Shared page layout](https://github.com/rmbinformatica/controle-estoque/blob/main/head.php): `head.php`
- [Page footer](https://github.com/rmbinformatica/controle-estoque/blob/main/footer-bar.php): `footer-bar.php`

### Other components

- **Inventory user**

## Connections

- Inventory user → Stock overview: opens
- Inventory user → Product catalog: manages
- Inventory user → Stock receipts: records
- Inventory user → Stock issues: records
- Inventory user → Current stock: views
- Inventory user → Minimum stock: views
- Inventory user → Product movements: inspects
- Stock overview → MySQL inventory data: queries stock (evidence: `index.php`)
- Stock overview → Shared page layout: requires (evidence: `index.php`)
- Stock overview → Page footer: requires (evidence: `index.php`)
- Shared page layout → Database utilities: requires (evidence: `head.php`)
- Database utilities → MySQL inventory data: queries (evidence: `funcoes.php`)
- Database utilities → DB credentials template: loads credentials
- Product catalog → Database utilities: uses utilities
- Stock receipts → Database utilities: uses utilities
- Stock issues → Database utilities: uses utilities
- Current stock → Database utilities: uses utilities
- Minimum stock → Database utilities: uses utilities
- Product movements → Database utilities: uses utilities
