# alexporma1406-cell/bodega_inteligente architecture

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

- Interactive diagram: https://gitdiagram.com/alexporma1406-cell/bodega_inteligente
- Repository: https://github.com/alexporma1406-cell/bodega_inteligente

## Overview

Bodega Inteligente is a Flask-based warehouse inventory system used by staff over a local network. The principal workflow is to sign in, view categorized stock, and record receipts or withdrawals; movement history supports audit and consumption reporting. Separate console workflows create users, configure and verify MySQL, and prepare or activate a parallel catalog database. The excerpts show only parts of the web application, so unsampled reporting and template interactions are included only where README capabilities support them; uncertain internal links are omitted.

Main entry points: [`bodega_inteligente.sql`](https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/bodega_inteligente.sql) (MySQL database), [`app_bodega.py`](https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/app_bodega.py) (Flask application), [`configurar_bodega.py`](https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/configurar_bodega.py) (App configuration), [`recrear_base_bodega.py`](https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/recrear_base_bodega.py) (Parallel database prep)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_webapp["Flask application<br/>[app_bodega.py]"]
  node_screens["Web screens"]
end

subgraph group_inventory["Inventory workflows"]
  node_catalog["Product catalog<br/>[catalogo_bodega.py]"]
  node_movements["Stock movements<br/>[app_bodega.py]"]
  node_audit["Audit and consumption<br/>[app_bodega.py]"]
end

subgraph group_storage["Persistence"]
  node_mysql[("MySQL database")]
  node_stocktrigger["Stock trigger"]
end

subgraph group_operations["Administration"]
  node_settings["Database settings"]
  node_configure["App configuration"]
  node_createuser["User creation<br/>[crear_usuario.py]"]
  node_verify["Database verification"]
  node_repair["Trigger repair<br/>[reparar_trigger.py]"]
  node_migrate["Reference migration"]
  node_permissions["Permission repair"]
  node_recreate["Parallel database prep"]
  node_activate["Database activation"]
end

node_staff(("Warehouse staff"))

node_staff -->|"uses"| node_webapp
node_webapp -->|"renders"| node_screens
node_webapp -->|"uses categories"| node_catalog
node_webapp -->|"records"| node_movements
node_webapp -->|"shows reports"| node_audit
node_webapp -->|"reads and writes"| node_mysql
node_movements -->|"stores history"| node_mysql
node_stocktrigger -->|"updates stock"| node_mysql
node_configure -->|"uses database name"| node_settings
node_configure -->|"creates app account"| node_mysql
node_createuser -->|"inserts account"| node_mysql
node_verify -->|"checks schema and data"| node_mysql
node_repair -->|"installs trigger"| node_mysql
node_migrate -->|"adds reference field"| node_mysql
node_permissions -->|"grants permissions"| node_mysql
node_recreate -->|"builds catalog"| node_catalog
node_recreate -->|"creates parallel database"| node_mysql
node_activate -->|"runs verification"| node_verify
node_activate -->|"promotes database"| node_mysql

click node_webapp "https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/app_bodega.py"
click node_screens "https://github.com/alexporma1406-cell/bodega_inteligente/tree/main/templates"
click node_catalog "https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/catalogo_bodega.py"
click node_movements "https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/app_bodega.py"
click node_audit "https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/app_bodega.py"
click node_mysql "https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/bodega_inteligente.sql"
click node_stocktrigger "https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/bodega_inteligente.sql"
click node_settings "https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/database_settings.py"
click node_configure "https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/configurar_bodega.py"
click node_createuser "https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/crear_usuario.py"
click node_verify "https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/verificar_bodega.py"
click node_repair "https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/reparar_trigger.py"
click node_migrate "https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/migrar_consumo_referencia.py"
click node_permissions "https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/reparar_permisos.py"
click node_recreate "https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/recrear_base_bodega.py"
click node_activate "https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/activar_base_paralela.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_webapp,node_screens toneBlue
class node_catalog,node_movements,node_audit toneAmber
class node_mysql,node_stocktrigger toneMint
class node_settings,node_configure,node_createuser,node_verify,node_repair,node_migrate,node_permissions,node_recreate,node_activate toneRose
class node_staff toneIndigo
```

## Components

### Web application

- [Flask application](https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/app_bodega.py): `app_bodega.py`
- [Web screens](https://github.com/alexporma1406-cell/bodega_inteligente/tree/main/templates): `templates`

### Inventory workflows

- [Product catalog](https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/catalogo_bodega.py): `catalogo_bodega.py`
- [Stock movements](https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/app_bodega.py): `app_bodega.py`
- [Audit and consumption](https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/app_bodega.py): `app_bodega.py`

### Persistence

- [MySQL database](https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/bodega_inteligente.sql): `bodega_inteligente.sql`
- [Stock trigger](https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/bodega_inteligente.sql): `bodega_inteligente.sql`

### Administration

- [Database settings](https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/database_settings.py): `database_settings.py`
- [App configuration](https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/configurar_bodega.py): `configurar_bodega.py`
- [User creation](https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/crear_usuario.py): `crear_usuario.py`
- [Database verification](https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/verificar_bodega.py): `verificar_bodega.py`
- [Trigger repair](https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/reparar_trigger.py): `reparar_trigger.py`
- [Reference migration](https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/migrar_consumo_referencia.py): `migrar_consumo_referencia.py`
- [Permission repair](https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/reparar_permisos.py): `reparar_permisos.py`
- [Parallel database prep](https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/recrear_base_bodega.py): `recrear_base_bodega.py`
- [Database activation](https://github.com/alexporma1406-cell/bodega_inteligente/blob/main/activar_base_paralela.py): `activar_base_paralela.py`

### Other components

- **Warehouse staff**

## Connections

- Warehouse staff → Flask application: uses (evidence: `README.md`)
- Flask application → Web screens: renders (evidence: `app_bodega.py`)
- Flask application → Product catalog: uses categories (evidence: `app_bodega.py`)
- Flask application → Stock movements: records (evidence: `README.md`)
- Flask application → Audit and consumption: shows reports (evidence: `README.md`)
- Flask application → MySQL database: reads and writes (evidence: `README.md`)
- Stock movements → MySQL database: stores history (evidence: `README.md`)
- Stock trigger → MySQL database: updates stock (evidence: `README.md`)
- App configuration → Database settings: uses database name (evidence: `configurar_bodega.py`)
- App configuration → MySQL database: creates app account (evidence: `configurar_bodega.py`)
- User creation → MySQL database: inserts account (evidence: `crear_usuario.py`)
- Database verification → MySQL database: checks schema and data (evidence: `verificar_bodega.py`)
- Trigger repair → MySQL database: installs trigger (evidence: `reparar_trigger.py`)
- Reference migration → MySQL database: adds reference field (evidence: `migrar_consumo_referencia.py`)
- Permission repair → MySQL database: grants permissions (evidence: `reparar_permisos.py`)
- Parallel database prep → Product catalog: builds catalog (evidence: `recrear_base_bodega.py`)
- Parallel database prep → MySQL database: creates parallel database (evidence: `README.md`)
- Database activation → Database verification: runs verification (evidence: `activar_base_paralela.py`)
- Database activation → MySQL database: promotes database (evidence: `README.md`)
