# kaik0405/ryum_control architecture

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

- Interactive diagram: https://gitdiagram.com/kaik0405/ryum_control
- Repository: https://github.com/kaik0405/ryum_control

## Overview

Ryum Control es una aplicación WPF local para gestionar inventario, combos, entregas, fichas de costo y finanzas, y generar reportes. El flujo principal comienza con el usuario en la aplicación de escritorio, atraviesa las pantallas y la lógica de cada área, y persiste los datos en SQLite mediante servicios y Entity Framework. Se conservan también ajustes, panel e informes documentados. Las relaciones entre servicios y base de datos se apoyan en referencias del índice de fuentes; las capacidades no muestreadas se representan sin conexiones internas no verificadas.

Main entry points: [`App.xaml.cs`](https://github.com/kaik0405/ryum_control/blob/master/App.xaml.cs) (Inicio y DI), [`Data/AppDbContext.cs`](https://github.com/kaik0405/ryum_control/blob/master/Data/AppDbContext.cs) (SQLite local), [`Services/ProductoService.cs`](https://github.com/kaik0405/ryum_control/blob/master/Services/ProductoService.cs) (Servicio productos), [`Services/ComboService.cs`](https://github.com/kaik0405/ryum_control/blob/master/Services/ComboService.cs) (Servicio combos)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Aplicación y navegación"]
  node_startup["Inicio y DI<br/>[App.xaml.cs]"]
  node_navigation["Navegación"]
end

subgraph group_operations["Operaciones del negocio"]
  node_inventory_ui["Inventario"]
  node_inventory_service["Servicio productos<br/>[ProductoService.cs]"]
  node_product_model["Productos<br/>[Producto.cs]"]
  node_purchase_model["Compras de productos<br/>[CompraProducto.cs]"]
  node_combo_ui["Combos<br/>[CombosViewModel.cs]"]
  node_combo_service["Servicio combos<br/>[ComboService.cs]"]
  node_combo_model["Combos y componentes<br/>[Combo.cs]"]
  node_delivery_ui["Entregas"]
  node_delivery_service["Servicio entregas<br/>[EntregaService.cs]"]
  node_agency_model["Agencias<br/>[Agencia.cs]"]
  node_client_model["Clientes<br/>[Cliente.cs]"]
end

subgraph group_finance["Costos y finanzas"]
  node_cost_ui["Fichas de costo"]
  node_cost_service["Servicio fichas"]
  node_cost_model["Fichas de costo<br/>[FichaCosto.cs]"]
  node_movement_ui["Movimientos"]
  node_movement_service["Servicio movimientos"]
  node_movement_model["Movimientos<br/>[Movimiento.cs]"]
  node_period_service["Períodos inventario"]
  node_period_model["Períodos y snapshots"]
end

subgraph group_insights["Panel e informes"]
  node_dashboard["Panel principal"]
  node_reports_ui["Reportes"]
  node_pdf_service["Generación PDF"]
end

subgraph group_persistence["Persistencia local"]
  node_db[("SQLite local<br/>[AppDbContext.cs]")]
  node_migrator["Migraciones de esquema"]
end

node_user(("Usuario"))

node_user -->|"inicia aplicación"| node_startup
node_startup -->|"configura navegación"| node_navigation
node_startup -->|"registra servicio"| node_inventory_service
node_startup -->|"registra servicio"| node_combo_service
node_startup -->|"registra servicio"| node_delivery_service
node_startup -->|"registra servicio"| node_cost_service
node_startup -->|"registra servicio"| node_movement_service
node_startup -->|"registra servicio"| node_period_service
node_startup -->|"registra servicio"| node_pdf_service
node_startup -->|"registra vista-modelo"| node_dashboard
node_inventory_service -->|"consulta y persiste"| node_db
node_combo_service -->|"consulta y persiste"| node_db
node_delivery_service -->|"consulta y persiste"| node_db
node_cost_service -->|"consulta y persiste"| node_db
node_movement_service -->|"consulta y persiste"| node_db
node_period_service -->|"consulta y persiste"| node_db
node_reports_ui -->|"solicita informes"| node_pdf_service
node_migrator -->|"gestiona esquema"| node_db

click node_startup "https://github.com/kaik0405/ryum_control/blob/master/App.xaml.cs"
click node_navigation "https://github.com/kaik0405/ryum_control/blob/master/Services/NavigationService.cs"
click node_inventory_ui "https://github.com/kaik0405/ryum_control/blob/master/ViewModels/InventarioViewModel.cs"
click node_inventory_service "https://github.com/kaik0405/ryum_control/blob/master/Services/ProductoService.cs"
click node_product_model "https://github.com/kaik0405/ryum_control/blob/master/Models/Producto.cs"
click node_purchase_model "https://github.com/kaik0405/ryum_control/blob/master/Models/CompraProducto.cs"
click node_combo_ui "https://github.com/kaik0405/ryum_control/blob/master/ViewModels/CombosViewModel.cs"
click node_combo_service "https://github.com/kaik0405/ryum_control/blob/master/Services/ComboService.cs"
click node_combo_model "https://github.com/kaik0405/ryum_control/blob/master/Models/Combo.cs"
click node_delivery_ui "https://github.com/kaik0405/ryum_control/blob/master/ViewModels/EntregasViewModel.cs"
click node_delivery_service "https://github.com/kaik0405/ryum_control/blob/master/Services/EntregaService.cs"
click node_agency_model "https://github.com/kaik0405/ryum_control/blob/master/Models/Agencia.cs"
click node_client_model "https://github.com/kaik0405/ryum_control/blob/master/Models/Cliente.cs"
click node_cost_ui "https://github.com/kaik0405/ryum_control/blob/master/ViewModels/FichasCostoViewModel.cs"
click node_cost_service "https://github.com/kaik0405/ryum_control/blob/master/Services/FichaCostoService.cs"
click node_cost_model "https://github.com/kaik0405/ryum_control/blob/master/Models/FichaCosto.cs"
click node_movement_ui "https://github.com/kaik0405/ryum_control/blob/master/ViewModels/MovimientosViewModel.cs"
click node_movement_service "https://github.com/kaik0405/ryum_control/blob/master/Services/MovimientoService.cs"
click node_movement_model "https://github.com/kaik0405/ryum_control/blob/master/Models/Movimiento.cs"
click node_period_service "https://github.com/kaik0405/ryum_control/blob/master/Services/PeriodoInventarioService.cs"
click node_period_model "https://github.com/kaik0405/ryum_control/blob/master/Models/PeriodoInventario.cs"
click node_dashboard "https://github.com/kaik0405/ryum_control/blob/master/ViewModels/DashboardViewModel.cs"
click node_reports_ui "https://github.com/kaik0405/ryum_control/blob/master/ViewModels/ReportesViewModel.cs"
click node_pdf_service "https://github.com/kaik0405/ryum_control/blob/master/Services/ReportesPdfService.cs"
click node_db "https://github.com/kaik0405/ryum_control/blob/master/Data/AppDbContext.cs"
click node_migrator "https://github.com/kaik0405/ryum_control/blob/master/Data/DatabaseMigrator.cs"

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_navigation toneBlue
class node_inventory_ui,node_inventory_service,node_product_model,node_purchase_model,node_combo_ui,node_combo_service,node_combo_model,node_delivery_ui,node_delivery_service,node_agency_model,node_client_model toneAmber
class node_cost_ui,node_cost_service,node_cost_model,node_movement_ui,node_movement_service,node_movement_model,node_period_service,node_period_model toneMint
class node_dashboard,node_reports_ui,node_pdf_service toneRose
class node_db,node_migrator,node_user toneIndigo
```

## Components

### Aplicación y navegación

- [Inicio y DI](https://github.com/kaik0405/ryum_control/blob/master/App.xaml.cs): `App.xaml.cs`
- [Navegación](https://github.com/kaik0405/ryum_control/blob/master/Services/NavigationService.cs): `Services/NavigationService.cs`

### Operaciones del negocio

- [Inventario](https://github.com/kaik0405/ryum_control/blob/master/ViewModels/InventarioViewModel.cs): `ViewModels/InventarioViewModel.cs`
- [Servicio productos](https://github.com/kaik0405/ryum_control/blob/master/Services/ProductoService.cs): `Services/ProductoService.cs`
- [Productos](https://github.com/kaik0405/ryum_control/blob/master/Models/Producto.cs): `Models/Producto.cs`
- [Compras de productos](https://github.com/kaik0405/ryum_control/blob/master/Models/CompraProducto.cs): `Models/CompraProducto.cs`
- [Combos](https://github.com/kaik0405/ryum_control/blob/master/ViewModels/CombosViewModel.cs): `ViewModels/CombosViewModel.cs`
- [Servicio combos](https://github.com/kaik0405/ryum_control/blob/master/Services/ComboService.cs): `Services/ComboService.cs`
- [Combos y componentes](https://github.com/kaik0405/ryum_control/blob/master/Models/Combo.cs): `Models/Combo.cs`
- [Entregas](https://github.com/kaik0405/ryum_control/blob/master/ViewModels/EntregasViewModel.cs): `ViewModels/EntregasViewModel.cs`
- [Servicio entregas](https://github.com/kaik0405/ryum_control/blob/master/Services/EntregaService.cs): `Services/EntregaService.cs`
- [Agencias](https://github.com/kaik0405/ryum_control/blob/master/Models/Agencia.cs): `Models/Agencia.cs`
- [Clientes](https://github.com/kaik0405/ryum_control/blob/master/Models/Cliente.cs): `Models/Cliente.cs`

### Costos y finanzas

- [Fichas de costo](https://github.com/kaik0405/ryum_control/blob/master/ViewModels/FichasCostoViewModel.cs): `ViewModels/FichasCostoViewModel.cs`
- [Servicio fichas](https://github.com/kaik0405/ryum_control/blob/master/Services/FichaCostoService.cs): `Services/FichaCostoService.cs`
- [Fichas de costo](https://github.com/kaik0405/ryum_control/blob/master/Models/FichaCosto.cs): `Models/FichaCosto.cs`
- [Movimientos](https://github.com/kaik0405/ryum_control/blob/master/ViewModels/MovimientosViewModel.cs): `ViewModels/MovimientosViewModel.cs`
- [Servicio movimientos](https://github.com/kaik0405/ryum_control/blob/master/Services/MovimientoService.cs): `Services/MovimientoService.cs`
- [Movimientos](https://github.com/kaik0405/ryum_control/blob/master/Models/Movimiento.cs): `Models/Movimiento.cs`
- [Períodos inventario](https://github.com/kaik0405/ryum_control/blob/master/Services/PeriodoInventarioService.cs): `Services/PeriodoInventarioService.cs`
- [Períodos y snapshots](https://github.com/kaik0405/ryum_control/blob/master/Models/PeriodoInventario.cs): `Models/PeriodoInventario.cs`

### Panel e informes

- [Panel principal](https://github.com/kaik0405/ryum_control/blob/master/ViewModels/DashboardViewModel.cs): `ViewModels/DashboardViewModel.cs`
- [Reportes](https://github.com/kaik0405/ryum_control/blob/master/ViewModels/ReportesViewModel.cs): `ViewModels/ReportesViewModel.cs`
- [Generación PDF](https://github.com/kaik0405/ryum_control/blob/master/Services/ReportesPdfService.cs): `Services/ReportesPdfService.cs`

### Persistencia local

- [SQLite local](https://github.com/kaik0405/ryum_control/blob/master/Data/AppDbContext.cs): `Data/AppDbContext.cs`
- [Migraciones de esquema](https://github.com/kaik0405/ryum_control/blob/master/Data/DatabaseMigrator.cs): `Data/DatabaseMigrator.cs`

### Other components

- **Usuario**

## Connections

- Usuario → Inicio y DI: inicia aplicación (evidence: `README.md`)
- Inicio y DI → Navegación: configura navegación (evidence: `App.xaml.cs`)
- Inicio y DI → Servicio productos: registra servicio (evidence: `App.xaml.cs`)
- Inicio y DI → Servicio combos: registra servicio (evidence: `App.xaml.cs`)
- Inicio y DI → Servicio entregas: registra servicio (evidence: `App.xaml.cs`)
- Inicio y DI → Servicio fichas: registra servicio (evidence: `App.xaml.cs`)
- Inicio y DI → Servicio movimientos: registra servicio (evidence: `App.xaml.cs`)
- Inicio y DI → Períodos inventario: registra servicio (evidence: `App.xaml.cs`)
- Inicio y DI → Generación PDF: registra servicio (evidence: `App.xaml.cs`)
- Inicio y DI → Panel principal: registra vista-modelo (evidence: `App.xaml.cs`)
- Servicio productos → SQLite local: consulta y persiste (evidence: `Services/ProductoService.cs`)
- Servicio combos → SQLite local: consulta y persiste (evidence: `Services/ComboService.cs`)
- Servicio entregas → SQLite local: consulta y persiste (evidence: `Services/EntregaService.cs`)
- Servicio fichas → SQLite local: consulta y persiste (evidence: `Services/FichaCostoService.cs`)
- Servicio movimientos → SQLite local: consulta y persiste (evidence: `Services/MovimientoService.cs`)
- Períodos inventario → SQLite local: consulta y persiste (evidence: `Services/PeriodoInventarioService.cs`)
- Reportes → Generación PDF: solicita informes (evidence: `ViewModels/ReportesViewModel.cs`)
- Migraciones de esquema → SQLite local: gestiona esquema (evidence: `Data/DatabaseMigrator.cs`)
