# rg3915/estoque architecture

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

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

## Overview

Estoque is a Django inventory-control application. Users manage product and category records, import or export product data, record stock entries and exits, and process delivery protocols that create stock deductions. The sampled code shows the main view-to-model operations and the protocol’s stock-update logic; some routing and UI relationships are supported only by the source index or template names in the views. The README gives no further product workflow detail.

Main entry points: [`projeto/produto/views.py`](https://github.com/rg3915/estoque/blob/master/projeto/produto/views.py) (Product views), [`projeto/estoque/views.py`](https://github.com/rg3915/estoque/blob/master/projeto/estoque/views.py) (Stock views), [`projeto/estoque/models.py`](https://github.com/rg3915/estoque/blob/master/projeto/estoque/models.py) (Stock and deliveries), [`projeto/produto/models.py`](https://github.com/rg3915/estoque/blob/master/projeto/produto/models.py) (Products and categories)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_catalog["Product catalog"]
  node_product_views["Product views<br/>[views.py]"]
  node_product_forms["Product forms<br/>[forms.py]"]
  node_product_data[("Products and categories<br/>[models.py]")]
  node_xlsx_import["XLSX import<br/>[import_xlsx.py]"]
  node_xlsx_export["XLSX export<br/>[export_xlsx.py]"]
end

subgraph group_inventory["Stock operations"]
  node_stock_views["Stock views<br/>[views.py]"]
  node_stock_forms["Stock forms<br/>[forms.py]"]
  node_stock_data[("Stock and deliveries<br/>[models.py]")]
  node_stock_managers["Movement managers<br/>[managers.py]"]
end

subgraph group_shared["Shared domain"]
  node_timestamps["Timestamp base<br/>[models.py]"]
end

subgraph group_interface["Web interface"]
  node_product_templates["Product pages"]
  node_stock_templates["Stock pages"]
  node_core_views["Core views<br/>[views.py]"]
end

node_user(("User"))

node_user -->|"manages catalog"| node_product_views
node_product_views -->|"uses forms"| node_product_forms
node_product_views -->|"reads and writes"| node_product_data
node_product_views -->|"dispatches import"| node_xlsx_import
node_product_views -->|"dispatches export"| node_xlsx_export
node_xlsx_import -->|"replaces catalog"| node_product_data
node_product_views -->|"renders pages"| node_product_templates
node_user -->|"records movements"| node_stock_views
node_stock_views -->|"builds forms"| node_stock_forms
node_stock_views -->|"creates and updates"| node_stock_data
node_stock_views -->|"updates balances"| node_product_data
node_stock_views -->|"renders pages"| node_stock_templates
node_stock_data -->|"uses movement managers"| node_stock_managers
node_stock_data -->|"inherits timestamps"| node_timestamps

click node_product_views "https://github.com/rg3915/estoque/blob/master/projeto/produto/views.py"
click node_product_forms "https://github.com/rg3915/estoque/blob/master/projeto/produto/forms.py"
click node_product_data "https://github.com/rg3915/estoque/blob/master/projeto/produto/models.py"
click node_xlsx_import "https://github.com/rg3915/estoque/blob/master/projeto/produto/actions/import_xlsx.py"
click node_xlsx_export "https://github.com/rg3915/estoque/blob/master/projeto/produto/actions/export_xlsx.py"
click node_stock_views "https://github.com/rg3915/estoque/blob/master/projeto/estoque/views.py"
click node_stock_forms "https://github.com/rg3915/estoque/blob/master/projeto/estoque/forms.py"
click node_stock_data "https://github.com/rg3915/estoque/blob/master/projeto/estoque/models.py"
click node_stock_managers "https://github.com/rg3915/estoque/blob/master/projeto/estoque/managers.py"
click node_timestamps "https://github.com/rg3915/estoque/blob/master/projeto/core/models.py"
click node_product_templates "https://github.com/rg3915/estoque/tree/master/projeto/produto/templates"
click node_stock_templates "https://github.com/rg3915/estoque/tree/master/projeto/estoque/templates"
click node_core_views "https://github.com/rg3915/estoque/blob/master/projeto/core/views.py"

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_product_views,node_product_forms,node_product_data,node_xlsx_import,node_xlsx_export,node_user toneBlue
class node_stock_views,node_stock_forms,node_stock_data,node_stock_managers toneAmber
class node_timestamps toneMint
class node_product_templates,node_stock_templates,node_core_views toneRose
```

## Components

### Product catalog

- [Product views](https://github.com/rg3915/estoque/blob/master/projeto/produto/views.py): `projeto/produto/views.py`
- [Product forms](https://github.com/rg3915/estoque/blob/master/projeto/produto/forms.py): `projeto/produto/forms.py`
- [Products and categories](https://github.com/rg3915/estoque/blob/master/projeto/produto/models.py): `projeto/produto/models.py`
- [XLSX import](https://github.com/rg3915/estoque/blob/master/projeto/produto/actions/import_xlsx.py): `projeto/produto/actions/import_xlsx.py`
- [XLSX export](https://github.com/rg3915/estoque/blob/master/projeto/produto/actions/export_xlsx.py): `projeto/produto/actions/export_xlsx.py`

### Stock operations

- [Stock views](https://github.com/rg3915/estoque/blob/master/projeto/estoque/views.py): `projeto/estoque/views.py`
- [Stock forms](https://github.com/rg3915/estoque/blob/master/projeto/estoque/forms.py): `projeto/estoque/forms.py`
- [Stock and deliveries](https://github.com/rg3915/estoque/blob/master/projeto/estoque/models.py): `projeto/estoque/models.py`
- [Movement managers](https://github.com/rg3915/estoque/blob/master/projeto/estoque/managers.py): `projeto/estoque/managers.py`

### Shared domain

- [Timestamp base](https://github.com/rg3915/estoque/blob/master/projeto/core/models.py): `projeto/core/models.py`

### Web interface

- [Product pages](https://github.com/rg3915/estoque/tree/master/projeto/produto/templates): `projeto/produto/templates`
- [Stock pages](https://github.com/rg3915/estoque/tree/master/projeto/estoque/templates): `projeto/estoque/templates`
- [Core views](https://github.com/rg3915/estoque/blob/master/projeto/core/views.py): `projeto/core/views.py`

### Other components

- **User**

## Connections

- User → Product views: manages catalog (evidence: `projeto/produto/views.py`)
- Product views → Product forms: uses forms (evidence: `projeto/produto/views.py`)
- Product views → Products and categories: reads and writes (evidence: `projeto/produto/views.py`)
- Product views → XLSX import: dispatches import (evidence: `projeto/produto/views.py`)
- Product views → XLSX export: dispatches export (evidence: `projeto/produto/views.py`)
- XLSX import → Products and categories: replaces catalog (evidence: `projeto/produto/actions/import_xlsx.py`)
- Product views → Product pages: renders pages (evidence: `projeto/produto/views.py`)
- User → Stock views: records movements (evidence: `projeto/estoque/views.py`)
- Stock views → Stock forms: builds forms (evidence: `projeto/estoque/views.py`)
- Stock views → Stock and deliveries: creates and updates (evidence: `projeto/estoque/views.py`)
- Stock views → Products and categories: updates balances (evidence: `projeto/estoque/views.py`)
- Stock views → Stock pages: renders pages (evidence: `projeto/estoque/views.py`)
- Stock and deliveries → Movement managers: uses movement managers (evidence: `projeto/estoque/models.py`)
- Stock and deliveries → Timestamp base: inherits timestamps (evidence: `projeto/estoque/models.py`)
