# gabrielsilva0022/erp-de-estoque-simples architecture

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

- Interactive diagram: https://gitdiagram.com/gabrielsilva0022/erp-de-estoque-simples
- Repository: https://github.com/gabrielsilva0022/erp-de-estoque-simples

## Overview

This is a small Flask inventory-management web app. Users can register products, view and delete them, and open a report with a stock-quantity chart. The sampled app.py shows route handlers directly reading and writing SQLite, rendering templates, and generating the chart. The templates and stylesheet are listed in the tree but were not sampled, so their internal behavior and styling connections are not inferred.

Main entry points: [`app.py`](https://github.com/gabrielsilva0022/erp-de-estoque-simples/blob/main/app.py) (Stock report), [`estoque.db`](https://github.com/gabrielsilva0022/erp-de-estoque-simples/blob/main/estoque.db) (Inventory database), [`templates/cadastrar.html`](https://github.com/gabrielsilva0022/erp-de-estoque-simples/blob/main/templates/cadastrar.html) (Registration page), [`templates/listar.html`](https://github.com/gabrielsilva0022/erp-de-estoque-simples/blob/main/templates/listar.html) (Product listing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Inventory workflow"]
  node_create["Register product<br/>[app.py]"]
  node_list["List products<br/>[app.py]"]
  node_delete["Delete product<br/>[app.py]"]
  node_index["Home route<br/>[app.py]"]
end

subgraph group_storage["Persistence"]
  node_database[("Inventory database<br/>[estoque.db]")]
end

subgraph group_reporting["Reporting and views"]
  node_register_view["Registration page<br/>[cadastrar.html]"]
  node_list_view["Product listing<br/>[listar.html]"]
  node_home_view["Home page<br/>[index.html]"]
  node_report["Stock report<br/>[app.py]"]
  node_charting["Matplotlib"]
  node_chart_file["Generated chart"]
  node_report_view["Report page<br/>[relatorios.html]"]
  node_stylesheet["Stylesheet<br/>[style.css]"]
end

node_user(("Browser user"))

node_user -->|"requests home"| node_index
node_user -->|"submits product"| node_create
node_user -->|"requests listing"| node_list
node_user -->|"requests deletion"| node_delete
node_user -->|"requests report"| node_report
node_create -->|"inserts product"| node_database
node_list -->|"reads products"| node_database
node_delete -->|"deletes product"| node_database
node_report -->|"reads quantities"| node_database
node_index -->|"renders"| node_home_view
node_create -->|"renders"| node_register_view
node_list -->|"renders"| node_list_view
node_report -->|"generates chart"| node_charting
node_report -->|"saves chart"| node_chart_file
node_report -->|"renders"| node_report_view

click node_create "https://github.com/gabrielsilva0022/erp-de-estoque-simples/blob/main/app.py"
click node_list "https://github.com/gabrielsilva0022/erp-de-estoque-simples/blob/main/app.py"
click node_delete "https://github.com/gabrielsilva0022/erp-de-estoque-simples/blob/main/app.py"
click node_index "https://github.com/gabrielsilva0022/erp-de-estoque-simples/blob/main/app.py"
click node_database "https://github.com/gabrielsilva0022/erp-de-estoque-simples/blob/main/estoque.db"
click node_register_view "https://github.com/gabrielsilva0022/erp-de-estoque-simples/blob/main/templates/cadastrar.html"
click node_list_view "https://github.com/gabrielsilva0022/erp-de-estoque-simples/blob/main/templates/listar.html"
click node_home_view "https://github.com/gabrielsilva0022/erp-de-estoque-simples/blob/main/templates/index.html"
click node_report "https://github.com/gabrielsilva0022/erp-de-estoque-simples/blob/main/app.py"
click node_chart_file "https://github.com/gabrielsilva0022/erp-de-estoque-simples/tree/main/static"
click node_report_view "https://github.com/gabrielsilva0022/erp-de-estoque-simples/blob/main/templates/relatorios.html"
click node_stylesheet "https://github.com/gabrielsilva0022/erp-de-estoque-simples/blob/main/static/style.css"

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_create,node_list,node_delete,node_index,node_user toneBlue
class node_database toneAmber
class node_register_view,node_list_view,node_home_view,node_report,node_charting,node_chart_file,node_report_view,node_stylesheet toneMint
```

## Components

### Inventory workflow

- [Register product](https://github.com/gabrielsilva0022/erp-de-estoque-simples/blob/main/app.py): `app.py`
- [List products](https://github.com/gabrielsilva0022/erp-de-estoque-simples/blob/main/app.py): `app.py`
- [Delete product](https://github.com/gabrielsilva0022/erp-de-estoque-simples/blob/main/app.py): `app.py`
- [Home route](https://github.com/gabrielsilva0022/erp-de-estoque-simples/blob/main/app.py): `app.py`

### Persistence

- [Inventory database](https://github.com/gabrielsilva0022/erp-de-estoque-simples/blob/main/estoque.db): `estoque.db`

### Reporting and views

- [Registration page](https://github.com/gabrielsilva0022/erp-de-estoque-simples/blob/main/templates/cadastrar.html): `templates/cadastrar.html`
- [Product listing](https://github.com/gabrielsilva0022/erp-de-estoque-simples/blob/main/templates/listar.html): `templates/listar.html`
- [Home page](https://github.com/gabrielsilva0022/erp-de-estoque-simples/blob/main/templates/index.html): `templates/index.html`
- [Stock report](https://github.com/gabrielsilva0022/erp-de-estoque-simples/blob/main/app.py): `app.py`
- **Matplotlib**
- [Generated chart](https://github.com/gabrielsilva0022/erp-de-estoque-simples/tree/main/static): `static`
- [Report page](https://github.com/gabrielsilva0022/erp-de-estoque-simples/blob/main/templates/relatorios.html): `templates/relatorios.html`
- [Stylesheet](https://github.com/gabrielsilva0022/erp-de-estoque-simples/blob/main/static/style.css): `static/style.css`

### Other components

- **Browser user**

## Connections

- Browser user → Home route: requests home (evidence: `app.py`)
- Browser user → Register product: submits product (evidence: `app.py`)
- Browser user → List products: requests listing (evidence: `app.py`)
- Browser user → Delete product: requests deletion (evidence: `app.py`)
- Browser user → Stock report: requests report (evidence: `app.py`)
- Register product → Inventory database: inserts product (evidence: `app.py`)
- List products → Inventory database: reads products (evidence: `app.py`)
- Delete product → Inventory database: deletes product (evidence: `app.py`)
- Stock report → Inventory database: reads quantities (evidence: `app.py`)
- Home route → Home page: renders (evidence: `app.py`)
- Register product → Registration page: renders (evidence: `app.py`)
- List products → Product listing: renders (evidence: `app.py`)
- Stock report → Matplotlib: generates chart (evidence: `app.py`)
- Stock report → Generated chart: saves chart (evidence: `app.py`)
- Stock report → Report page: renders (evidence: `app.py`)
