# olasdemar12/almacen-wpf architecture

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

- Interactive diagram: https://gitdiagram.com/olasdemar12/almacen-wpf
- Repository: https://github.com/olasdemar12/almacen-wpf

## Overview

StockMaster is a WPF inventory application. Users enter through the desktop shell and navigate to product and category management; view models call services, which validate and persist records through repositories and SQLite. The README also names stock movements (entries/exits) and reports, but their implementation is not sampled, so they appear only as documented capability areas. The graph focuses on supported wiring and CRUD behavior; unsampled view and dialog relationships are not inferred.

Main entry points: [`Services/Product/Implementations/ProductService.cs`](https://github.com/olasdemar12/almacen-wpf/blob/main/Services/Product/Implementations/ProductService.cs) (Product service), [`MainWindow.xaml.cs`](https://github.com/olasdemar12/almacen-wpf/blob/main/MainWindow.xaml.cs) (WPF shell), [`BaseDirectory/DatabaseManager.cs`](https://github.com/olasdemar12/almacen-wpf/blob/main/BaseDirectory/DatabaseManager.cs) (Connection manager), [`Services/Data/CategoryDate/CategoryRepository.cs`](https://github.com/olasdemar12/almacen-wpf/blob/main/Services/Data/CategoryDate/CategoryRepository.cs) (Category repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop application"]
  node_shell["WPF shell<br/>[MainWindow.xaml.cs]"]
  node_navigation["Navigation"]
  node_productview["Product view"]
  node_categoryui["Category panel"]
  node_loginvm["Login flow<br/>[LoginViewModel.cs]"]
end

subgraph group_domain["Inventory management"]
  node_productvm["Product workflow"]
  node_productform["Product form"]
  node_categoryvm["Category workflow"]
  node_deleteproduct["Product deletion"]
  node_productmodel["Product record<br/>[Product.cs]"]
  node_categorymodel["Category record<br/>[Category.cs]"]
  node_stockflows["Stock movements"]
  node_reports["Reports"]
end

subgraph group_services["Application services"]
  node_productservice["Product service<br/>[ProductService.cs]"]
  node_categoryservice["Category service<br/>[CategoryService.cs]"]
  node_authservice["Authentication"]
end

subgraph group_storage["Persistence"]
  node_productrepo["Product repository"]
  node_categoryrepo["Category repository"]
  node_userrepo["User repository"]
  node_dbmanager["Connection manager<br/>[DatabaseManager.cs]"]
  node_sqlite[("StockMaster SQLite")]
end

node_user(("User"))

node_user -.->|"starts"| node_shell
node_shell -->|"creates"| node_loginvm
node_shell -.->|"opens"| node_navigation
node_navigation -.->|"navigates"| node_productview
node_productview -->|"creates"| node_productvm
node_categoryui -.->|"uses"| node_categoryvm
node_categoryui -->|"uses composition"| node_shell
node_loginvm -.->|"validates credentials"| node_authservice
node_authservice -->|"authenticates"| node_userrepo
node_productvm -.->|"requests operations"| node_productservice
node_productform -.->|"submits changes"| node_productservice
node_deleteproduct -.->|"deletes product"| node_productservice
node_categoryvm -.->|"requests operations"| node_categoryservice
node_productservice -->|"reads and writes"| node_productrepo
node_productservice -->|"reads categories"| node_categoryrepo
node_categoryservice -->|"reads and writes"| node_categoryrepo
node_productrepo -->|"opens connection"| node_dbmanager
node_categoryrepo -->|"opens connection"| node_dbmanager
node_userrepo -->|"opens connection"| node_dbmanager
node_dbmanager -->|"connects"| node_sqlite

click node_shell "https://github.com/olasdemar12/almacen-wpf/blob/main/MainWindow.xaml.cs"
click node_navigation "https://github.com/olasdemar12/almacen-wpf/blob/main/MVVM/ViewModels/Window/StockMasterViewModel.cs"
click node_productview "https://github.com/olasdemar12/almacen-wpf/blob/main/UI/Views/ProductosView.xaml.cs"
click node_categoryui "https://github.com/olasdemar12/almacen-wpf/blob/main/UI/Panels/Products/CategorysManagementControl.xaml.cs"
click node_loginvm "https://github.com/olasdemar12/almacen-wpf/blob/main/MVVM/ViewModels/Login/LoginViewModel.cs"
click node_productvm "https://github.com/olasdemar12/almacen-wpf/blob/main/MVVM/ViewModels/Pages/ProductViewModel.cs"
click node_productform "https://github.com/olasdemar12/almacen-wpf/blob/main/MVVM/ViewModels/Forms/ProductFormViewModel.cs"
click node_categoryvm "https://github.com/olasdemar12/almacen-wpf/blob/main/MVVM/ViewModels/Panels/CategorysManagementVM.cs"
click node_deleteproduct "https://github.com/olasdemar12/almacen-wpf/blob/main/MVVM/ViewModels/Dialogs/DeleteProductViewModel.cs"
click node_productmodel "https://github.com/olasdemar12/almacen-wpf/blob/main/MVVM/Models/Product/Product.cs"
click node_categorymodel "https://github.com/olasdemar12/almacen-wpf/blob/main/MVVM/Models/Categroy/Category.cs"
click node_productservice "https://github.com/olasdemar12/almacen-wpf/blob/main/Services/Product/Implementations/ProductService.cs"
click node_categoryservice "https://github.com/olasdemar12/almacen-wpf/blob/main/Services/Category/Implementations/CategoryService.cs"
click node_authservice "https://github.com/olasdemar12/almacen-wpf/blob/main/Services/Login/Implementations/DatabaseAuthenticationService.cs"
click node_productrepo "https://github.com/olasdemar12/almacen-wpf/blob/main/Services/Data/ProductDate/ProductRepository.cs"
click node_categoryrepo "https://github.com/olasdemar12/almacen-wpf/blob/main/Services/Data/CategoryDate/CategoryRepository.cs"
click node_userrepo "https://github.com/olasdemar12/almacen-wpf/blob/main/Services/Data/Login/UserAccessRepository.cs"
click node_dbmanager "https://github.com/olasdemar12/almacen-wpf/blob/main/BaseDirectory/DatabaseManager.cs"
click node_stockflows "https://github.com/olasdemar12/almacen-wpf/blob/main/UI/Views/MovimientosView.xaml.cs"
click node_reports "https://github.com/olasdemar12/almacen-wpf/blob/main/UI/Views/DocumentosView.xaml.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_shell,node_navigation,node_productview,node_categoryui,node_loginvm,node_user toneBlue
class node_productvm,node_productform,node_categoryvm,node_deleteproduct,node_productmodel,node_categorymodel,node_stockflows,node_reports toneAmber
class node_productservice,node_categoryservice,node_authservice toneMint
class node_productrepo,node_categoryrepo,node_userrepo,node_dbmanager,node_sqlite toneRose
```

## Components

### Desktop application

- [WPF shell](https://github.com/olasdemar12/almacen-wpf/blob/main/MainWindow.xaml.cs): `MainWindow.xaml.cs`
- [Navigation](https://github.com/olasdemar12/almacen-wpf/blob/main/MVVM/ViewModels/Window/StockMasterViewModel.cs): `MVVM/ViewModels/Window/StockMasterViewModel.cs`
- [Product view](https://github.com/olasdemar12/almacen-wpf/blob/main/UI/Views/ProductosView.xaml.cs): `UI/Views/ProductosView.xaml.cs`
- [Category panel](https://github.com/olasdemar12/almacen-wpf/blob/main/UI/Panels/Products/CategorysManagementControl.xaml.cs): `UI/Panels/Products/CategorysManagementControl.xaml.cs`
- [Login flow](https://github.com/olasdemar12/almacen-wpf/blob/main/MVVM/ViewModels/Login/LoginViewModel.cs): `MVVM/ViewModels/Login/LoginViewModel.cs`

### Inventory management

- [Product workflow](https://github.com/olasdemar12/almacen-wpf/blob/main/MVVM/ViewModels/Pages/ProductViewModel.cs): `MVVM/ViewModels/Pages/ProductViewModel.cs`
- [Product form](https://github.com/olasdemar12/almacen-wpf/blob/main/MVVM/ViewModels/Forms/ProductFormViewModel.cs): `MVVM/ViewModels/Forms/ProductFormViewModel.cs`
- [Category workflow](https://github.com/olasdemar12/almacen-wpf/blob/main/MVVM/ViewModels/Panels/CategorysManagementVM.cs): `MVVM/ViewModels/Panels/CategorysManagementVM.cs`
- [Product deletion](https://github.com/olasdemar12/almacen-wpf/blob/main/MVVM/ViewModels/Dialogs/DeleteProductViewModel.cs): `MVVM/ViewModels/Dialogs/DeleteProductViewModel.cs`
- [Product record](https://github.com/olasdemar12/almacen-wpf/blob/main/MVVM/Models/Product/Product.cs): `MVVM/Models/Product/Product.cs`
- [Category record](https://github.com/olasdemar12/almacen-wpf/blob/main/MVVM/Models/Categroy/Category.cs): `MVVM/Models/Categroy/Category.cs`
- [Stock movements](https://github.com/olasdemar12/almacen-wpf/blob/main/UI/Views/MovimientosView.xaml.cs): `UI/Views/MovimientosView.xaml.cs`
- [Reports](https://github.com/olasdemar12/almacen-wpf/blob/main/UI/Views/DocumentosView.xaml.cs): `UI/Views/DocumentosView.xaml.cs`

### Application services

- [Product service](https://github.com/olasdemar12/almacen-wpf/blob/main/Services/Product/Implementations/ProductService.cs): `Services/Product/Implementations/ProductService.cs`
- [Category service](https://github.com/olasdemar12/almacen-wpf/blob/main/Services/Category/Implementations/CategoryService.cs): `Services/Category/Implementations/CategoryService.cs`
- [Authentication](https://github.com/olasdemar12/almacen-wpf/blob/main/Services/Login/Implementations/DatabaseAuthenticationService.cs): `Services/Login/Implementations/DatabaseAuthenticationService.cs`

### Persistence

- [Product repository](https://github.com/olasdemar12/almacen-wpf/blob/main/Services/Data/ProductDate/ProductRepository.cs): `Services/Data/ProductDate/ProductRepository.cs`
- [Category repository](https://github.com/olasdemar12/almacen-wpf/blob/main/Services/Data/CategoryDate/CategoryRepository.cs): `Services/Data/CategoryDate/CategoryRepository.cs`
- [User repository](https://github.com/olasdemar12/almacen-wpf/blob/main/Services/Data/Login/UserAccessRepository.cs): `Services/Data/Login/UserAccessRepository.cs`
- [Connection manager](https://github.com/olasdemar12/almacen-wpf/blob/main/BaseDirectory/DatabaseManager.cs): `BaseDirectory/DatabaseManager.cs`
- **StockMaster SQLite**

### Other components

- **User**

## Connections

- User → WPF shell: starts
- WPF shell → Login flow: creates
- WPF shell → Navigation: opens
- Navigation → Product view: navigates
- Product view → Product workflow: creates (evidence: `UI/Views/ProductosView.xaml.cs`)
- Category panel → Category workflow: uses
- Category panel → WPF shell: uses composition (evidence: `UI/Panels/Products/CategorysManagementControl.xaml.cs`)
- Login flow → Authentication: validates credentials
- Authentication → User repository: authenticates (evidence: `Services/Login/Implementations/DatabaseAuthenticationService.cs`)
- Product workflow → Product service: requests operations
- Product form → Product service: submits changes
- Product deletion → Product service: deletes product
- Category workflow → Category service: requests operations
- Product service → Product repository: reads and writes (evidence: `Services/Product/Implementations/ProductService.cs`)
- Product service → Category repository: reads categories (evidence: `Composition/Bootstrapper.cs`)
- Category service → Category repository: reads and writes (evidence: `Services/Category/Implementations/CategoryService.cs`)
- Product repository → Connection manager: opens connection (evidence: `Services/Data/ProductDate/ProductRepository.cs`)
- Category repository → Connection manager: opens connection (evidence: `Services/Data/CategoryDate/CategoryRepository.cs`)
- User repository → Connection manager: opens connection (evidence: `Services/Data/Login/UserAccessRepository.cs`)
- Connection manager → StockMaster SQLite: connects (evidence: `BaseDirectory/DatabaseManager.cs`)
