# sarrgyy/tpf-grupo5-programacioniii-icomp architecture

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

- Interactive diagram: https://gitdiagram.com/sarrgyy/tpf-grupo5-programacioniii-icomp
- Repository: https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp

## Overview

This is a local logistics and distribution application: users manage product stock by depot, prepare and confirm orders, assign vehicles, dispatch shipments, and record delivery. The web UI sends JSON to FastAPI; the console uses the same SQLite-backed business repositories directly. The graph separates user interfaces, API entry, operational repositories, and domain models. README statements and indexed source references support the main links; unsampled UI and repository internals are not expanded into guessed call chains.

Main entry points: [`Backend/pedidos.py`](https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Backend/pedidos.py) (Order repository), [`Backend/persistencia.py`](https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Backend/persistencia.py) (Inventory repository), [`Backend/flota.py`](https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Backend/flota.py) (Fleet repository), [`Frontend/api.js`](https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Frontend/api.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_web["Web interface<br/>[app.js]"]
  node_api_client["API client<br/>[api.js]"]
  node_management["Inventory management<br/>[gestion.js]"]
  node_loads["Order loads<br/>[carga.js]"]
  node_tracking["Order tracking<br/>[seguimiento.js]"]
  node_console_entry["Console entry<br/>[main.py]"]
  node_console["Console menus<br/>[consola.py]"]
end

subgraph group_api["HTTP API"]
  node_fastapi["FastAPI routes<br/>[api.py]"]
end

subgraph group_operations["Business repositories"]
  node_inventory["Inventory repository<br/>[persistencia.py]"]
  node_orders["Order repository<br/>[pedidos.py]"]
  node_fleet["Fleet repository<br/>[flota.py]"]
end

subgraph group_domain["Domain models"]
  node_product["Product model<br/>[productos.py]"]
  node_depot["Depot model<br/>[deposito.py]"]
  node_order["Order model<br/>[pedido.py]"]
  node_delivery["Delivery model<br/>[entrega.py]"]
  node_vehicle["Vehicle model<br/>[vehiculo.py]"]
  node_driver["Driver model<br/>[conductor.py]"]
  node_validation["Measure validation<br/>[validaciones.py]"]
end

node_user(("Logistics user"))
node_sqlite[("SQLite database")]

node_user -->|"uses"| node_web
node_web -.->|"uses"| node_api_client
node_api_client -->|"sends JSON"| node_fastapi
node_management -.->|"requests data"| node_api_client
node_loads -.->|"requests data"| node_api_client
node_tracking -.->|"requests data"| node_api_client
node_fastapi -->|"delegates to"| node_inventory
node_fastapi -->|"delegates to"| node_orders
node_fastapi -->|"delegates to"| node_fleet
node_console_entry -->|"opens session"| node_inventory
node_console_entry -->|"starts menu"| node_console
node_console -->|"uses"| node_orders
node_console -->|"uses"| node_fleet
node_console -->|"uses"| node_inventory
node_inventory -->|"reads and writes"| node_sqlite
node_orders -->|"reads and writes"| node_sqlite
node_fleet -->|"reads and writes"| node_sqlite
node_orders -->|"checks assignments"| node_fleet
node_inventory -->|"builds copies"| node_product
node_inventory -->|"builds copies"| node_depot
node_orders -->|"builds copies"| node_order
node_orders -->|"integrates"| node_delivery
node_fleet -->|"builds copies"| node_vehicle
node_fleet -->|"builds copies"| node_driver
node_depot -->|"validates measures"| node_validation
node_order -->|"validates measures"| node_validation

click node_web "https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Frontend/app.js"
click node_api_client "https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Frontend/api.js"
click node_management "https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Frontend/gestion.js"
click node_loads "https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Frontend/carga.js"
click node_tracking "https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Frontend/seguimiento.js"
click node_fastapi "https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Backend/api.py"
click node_console_entry "https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Backend/main.py"
click node_console "https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Backend/consola.py"
click node_inventory "https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Backend/persistencia.py"
click node_orders "https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Backend/pedidos.py"
click node_fleet "https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Backend/flota.py"
click node_product "https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Backend/modelos/productos.py"
click node_depot "https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Backend/modelos/deposito.py"
click node_order "https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Backend/modelos/pedido.py"
click node_delivery "https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Backend/modelos/entrega.py"
click node_vehicle "https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Backend/modelos/vehiculo.py"
click node_driver "https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Backend/modelos/conductor.py"
click node_validation "https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Backend/modelos/validaciones.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_web,node_api_client,node_management,node_loads,node_tracking,node_console_entry,node_console,node_user toneBlue
class node_fastapi,node_sqlite toneAmber
class node_inventory,node_orders,node_fleet toneMint
class node_product,node_depot,node_order,node_delivery,node_vehicle,node_driver,node_validation toneRose
```

## Components

### User interfaces

- [Web interface](https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Frontend/app.js): `Frontend/app.js`
- [API client](https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Frontend/api.js): `Frontend/api.js`
- [Inventory management](https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Frontend/gestion.js): `Frontend/gestion.js`
- [Order loads](https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Frontend/carga.js): `Frontend/carga.js`
- [Order tracking](https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Frontend/seguimiento.js): `Frontend/seguimiento.js`
- [Console entry](https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Backend/main.py): `Backend/main.py`
- [Console menus](https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Backend/consola.py): `Backend/consola.py`

### HTTP API

- [FastAPI routes](https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Backend/api.py): `Backend/api.py`

### Business repositories

- [Inventory repository](https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Backend/persistencia.py): `Backend/persistencia.py`
- [Order repository](https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Backend/pedidos.py): `Backend/pedidos.py`
- [Fleet repository](https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Backend/flota.py): `Backend/flota.py`

### Domain models

- [Product model](https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Backend/modelos/productos.py): `Backend/modelos/productos.py`
- [Depot model](https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Backend/modelos/deposito.py): `Backend/modelos/deposito.py`
- [Order model](https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Backend/modelos/pedido.py): `Backend/modelos/pedido.py`
- [Delivery model](https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Backend/modelos/entrega.py): `Backend/modelos/entrega.py`
- [Vehicle model](https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Backend/modelos/vehiculo.py): `Backend/modelos/vehiculo.py`
- [Driver model](https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Backend/modelos/conductor.py): `Backend/modelos/conductor.py`
- [Measure validation](https://github.com/sarrgyy/tpf-grupo5-programacioniii-icomp/blob/main/Backend/modelos/validaciones.py): `Backend/modelos/validaciones.py`

### Other components

- **Logistics user**
- **SQLite database**

## Connections

- Logistics user → Web interface: uses (evidence: `README.md`)
- Web interface → API client: uses
- API client → FastAPI routes: sends JSON (evidence: `README.md`)
- Inventory management → API client: requests data
- Order loads → API client: requests data
- Order tracking → API client: requests data
- FastAPI routes → Inventory repository: delegates to (evidence: `README.md`)
- FastAPI routes → Order repository: delegates to (evidence: `README.md`)
- FastAPI routes → Fleet repository: delegates to (evidence: `README.md`)
- Console entry → Inventory repository: opens session (evidence: `Backend/main.py`)
- Console entry → Console menus: starts menu (evidence: `Backend/main.py`)
- Console menus → Order repository: uses (evidence: `Backend/consola.py`)
- Console menus → Fleet repository: uses (evidence: `Backend/consola.py`)
- Console menus → Inventory repository: uses (evidence: `Backend/consola.py`)
- Inventory repository → SQLite database: reads and writes (evidence: `Backend/persistencia.py`)
- Order repository → SQLite database: reads and writes (evidence: `Backend/pedidos.py`)
- Fleet repository → SQLite database: reads and writes (evidence: `Backend/flota.py`)
- Order repository → Fleet repository: checks assignments (evidence: `Backend/pedidos.py`)
- Inventory repository → Product model: builds copies (evidence: `Backend/persistencia.py`)
- Inventory repository → Depot model: builds copies (evidence: `Backend/persistencia.py`)
- Order repository → Order model: builds copies (evidence: `Backend/pedidos.py`)
- Order repository → Delivery model: integrates (evidence: `Backend/pedidos.py`)
- Fleet repository → Vehicle model: builds copies (evidence: `Backend/flota.py`)
- Fleet repository → Driver model: builds copies (evidence: `Backend/flota.py`)
- Depot model → Measure validation: validates measures (evidence: `Backend/modelos/deposito.py`)
- Order model → Measure validation: validates measures (evidence: `Backend/modelos/pedido.py`)
