# liavhv/simpleinventario architecture

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

- Interactive diagram: https://gitdiagram.com/liavhv/simpleinventario
- Repository: https://github.com/liavhv/simpleinventario

## Overview

SimpleInventario is a WinForms inventory application. A user works through the Principal window to maintain measurement units and products, record stock entries and exits, and view inventory and product-movement reports. The window uses an Entity Framework context for inventory data; the README identifies LocalDB as the database. Report templates and the kardex capability are documented, but their runtime wiring is not shown in the excerpts, so those links are marked unverified.

Main entry points: [`SimpleInventario/Models/ApplicationDbContext.cs`](https://github.com/liavhv/simpleinventario/blob/main/SimpleInventario/Models/ApplicationDbContext.cs) (Entity Framework context), [`SimpleInventario/Principal.cs`](https://github.com/liavhv/simpleinventario/blob/main/SimpleInventario/Principal.cs) (Inventory window), [`SimpleInventario/Program.cs`](https://github.com/liavhv/simpleinventario/blob/main/SimpleInventario/Program.cs) (Application startup), [`SimpleInventario/Models/Unidades.cs`](https://github.com/liavhv/simpleinventario/blob/main/SimpleInventario/Models/Unidades.cs) (Unit catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop interface"]
  node_startup["Application startup<br/>[Program.cs]"]
  node_window["Inventory window<br/>[Principal.cs]"]
end

subgraph group_catalog["Inventory catalog"]
  node_units["Unit catalog<br/>[Unidades.cs]"]
  node_products["Product catalog<br/>[Productos.cs]"]
end

subgraph group_movement["Stock movements"]
  node_entries["Stock entries<br/>[Entradas.cs]"]
  node_exits["Stock exits<br/>[Salidas.cs]"]
end

subgraph group_reporting["Reports and persistence"]
  node_context["Entity Framework context"]
  node_database[("LocalDB database")]
  node_reportdata["Report dataset<br/>[dsReportes.cs]"]
  node_stockreport["Stock report"]
  node_kardex["Product kardex<br/>[ReportKardex.rdlc]"]
end

node_user(("User"))

node_user -->|"starts app"| node_startup
node_startup -->|"opens window"| node_window
node_user -.->|"uses"| node_window
node_window -->|"queries and saves"| node_context
node_context -->|"maps set"| node_units
node_context -->|"maps set"| node_products
node_context -->|"maps set"| node_entries
node_context -->|"maps set"| node_exits
node_context -.->|"connects to"| node_database
node_window -->|"fills and refreshes"| node_reportdata
node_window -.->|"displays report"| node_stockreport
node_window -.->|"offers report"| node_kardex

click node_startup "https://github.com/liavhv/simpleinventario/blob/main/SimpleInventario/Program.cs"
click node_window "https://github.com/liavhv/simpleinventario/blob/main/SimpleInventario/Principal.cs"
click node_units "https://github.com/liavhv/simpleinventario/blob/main/SimpleInventario/Models/Unidades.cs"
click node_products "https://github.com/liavhv/simpleinventario/blob/main/SimpleInventario/Models/Productos.cs"
click node_entries "https://github.com/liavhv/simpleinventario/blob/main/SimpleInventario/Models/Entradas.cs"
click node_exits "https://github.com/liavhv/simpleinventario/blob/main/SimpleInventario/Models/Salidas.cs"
click node_context "https://github.com/liavhv/simpleinventario/blob/main/SimpleInventario/Models/ApplicationDbContext.cs"
click node_reportdata "https://github.com/liavhv/simpleinventario/blob/main/SimpleInventario/Reportes/dsReportes.cs"
click node_stockreport "https://github.com/liavhv/simpleinventario/blob/main/SimpleInventario/Reportes/ReportExistencias.rdlc"
click node_kardex "https://github.com/liavhv/simpleinventario/blob/main/SimpleInventario/Reportes/ReportKardex.rdlc"

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_startup,node_window,node_user toneBlue
class node_units,node_products toneAmber
class node_entries,node_exits toneMint
class node_context,node_database,node_reportdata,node_stockreport,node_kardex toneRose
```

## Components

### Desktop interface

- [Application startup](https://github.com/liavhv/simpleinventario/blob/main/SimpleInventario/Program.cs): `SimpleInventario/Program.cs`
- [Inventory window](https://github.com/liavhv/simpleinventario/blob/main/SimpleInventario/Principal.cs): `SimpleInventario/Principal.cs`

### Inventory catalog

- [Unit catalog](https://github.com/liavhv/simpleinventario/blob/main/SimpleInventario/Models/Unidades.cs): `SimpleInventario/Models/Unidades.cs`
- [Product catalog](https://github.com/liavhv/simpleinventario/blob/main/SimpleInventario/Models/Productos.cs): `SimpleInventario/Models/Productos.cs`

### Stock movements

- [Stock entries](https://github.com/liavhv/simpleinventario/blob/main/SimpleInventario/Models/Entradas.cs): `SimpleInventario/Models/Entradas.cs`
- [Stock exits](https://github.com/liavhv/simpleinventario/blob/main/SimpleInventario/Models/Salidas.cs): `SimpleInventario/Models/Salidas.cs`

### Reports and persistence

- [Entity Framework context](https://github.com/liavhv/simpleinventario/blob/main/SimpleInventario/Models/ApplicationDbContext.cs): `SimpleInventario/Models/ApplicationDbContext.cs`
- **LocalDB database**
- [Report dataset](https://github.com/liavhv/simpleinventario/blob/main/SimpleInventario/Reportes/dsReportes.cs): `SimpleInventario/Reportes/dsReportes.cs`
- [Stock report](https://github.com/liavhv/simpleinventario/blob/main/SimpleInventario/Reportes/ReportExistencias.rdlc): `SimpleInventario/Reportes/ReportExistencias.rdlc`
- [Product kardex](https://github.com/liavhv/simpleinventario/blob/main/SimpleInventario/Reportes/ReportKardex.rdlc): `SimpleInventario/Reportes/ReportKardex.rdlc`

### Other components

- **User**

## Connections

- User → Application startup: starts app (evidence: `SimpleInventario/Program.cs`)
- Application startup → Inventory window: opens window (evidence: `SimpleInventario/Program.cs`)
- User → Inventory window: uses
- Inventory window → Entity Framework context: queries and saves (evidence: `SimpleInventario/Principal.cs`)
- Entity Framework context → Unit catalog: maps set (evidence: `SimpleInventario/Models/ApplicationDbContext.cs`)
- Entity Framework context → Product catalog: maps set (evidence: `SimpleInventario/Models/ApplicationDbContext.cs`)
- Entity Framework context → Stock entries: maps set (evidence: `SimpleInventario/Models/ApplicationDbContext.cs`)
- Entity Framework context → Stock exits: maps set (evidence: `SimpleInventario/Models/ApplicationDbContext.cs`)
- Entity Framework context → LocalDB database: connects to
- Inventory window → Report dataset: fills and refreshes (evidence: `SimpleInventario/Principal.cs`)
- Inventory window → Stock report: displays report
- Inventory window → Product kardex: offers report
