# juliannparra99/inventory-management-system architecture

> Architecture diagram of the GitHub repository juliannparra99/inventory-management-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/juliannparra99/inventory-management-system
- Repository: https://github.com/juliannparra99/inventory-management-system

## Overview

##### Main Components
- UI Layer (WinForms-app): This is the front-end desktop application where users interact with the system. It contains the forms for CRUD operations and searching.
- Business Layer (Business): This layer encapsulates the application logic and handles operations such as validating inputs, executing business rules, and interacting with the data access part. Components here include ArticuloBusiness, CategoriaBusiness, MarcaBusiness, and even the DataAccess functionality.
- Domain Layer (Domain): This layer establishes the core entities for the system – for example, Articulo, Categoria, and Marca. It represents the application’s inherent business data structures.
- Database Layer: The application uses SQL Server for persistence, with a SQL script provided (CATALOGO_DB.sql in the Business/script_db folder) for database creation/maintenance.

##### Relationships and Interactions
- That the Business layer processes the logic and interacts with both the Domain models (to apply business rules and operations) and the database (through DataAccess).
- Domain layer as central core models being used/updated by the business logic.

##### Architectural Patterns and Design Principles
- Use of Object-Oriented principles: For example, the distinct classes in Business and Domain illustrate encapsulation and separation of responsibilities.
- CRUD operations: Emphasize that the system is built around standard CRUD operations supported by search features, and show how they flow through the different layers.

##### Relevant Technologies and Frameworks
- C# and .NET Framework: Note these fundamental technologies.
- WinForms for the front-end.
- SQL Server for data persistence.
- Mention any build or project files (like .csproj and .sln) that indicate the solution organization though they are more technical/implementation details.

- Grouping: Since the project’s structure is layered, group related components together. For example, visually group all business-related classes (ArticuloBusiness, CategoriaBusiness, MarcaBusiness, and DataAccess) in a “Business Layer” container.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Presentation Layer"
        UI["WinForms UI"]:::ui
    end

    subgraph "Business Layer"
        BL["Business Logic"]:::business
        AB["ArticuloBusiness"]:::businessComp
        CB["CategoriaBusiness"]:::businessComp
        MB["MarcaBusiness"]:::businessComp
        DA["Data Access"]:::businessComp
    end

    subgraph "Domain Layer"
        DM["Domain Models"]:::domain
        Art["Articulo Entity"]:::domainComp
        Cat["Categoria Entity"]:::domainComp
        Mar["Marca Entity"]:::domainComp
    end

    subgraph "Database Layer"
        DB["SQL Server Database"]:::database
    end

    UI -->|"triggers"| BL
    BL -->|"applies_models"| DM
    BL -->|"persists_data"| DB

    BL --> AB
    BL --> CB
    BL --> MB
    BL --> DA

    DM --> Art
    DM --> Cat
    DM --> Mar

    click UI "https://github.com/juliannparra99/inventory-management-system/tree/main/inventory-management-system/Winform-app"
    click BL "https://github.com/juliannparra99/inventory-management-system/tree/main/inventory-management-system/Business"
    click AB "https://github.com/juliannparra99/inventory-management-system/blob/main/inventory-management-system/Business/ArticuloBusiness.cs"
    click CB "https://github.com/juliannparra99/inventory-management-system/blob/main/inventory-management-system/Business/CategoriaBusiness.cs"
    click MB "https://github.com/juliannparra99/inventory-management-system/blob/main/inventory-management-system/Business/MarcaBusiness.cs"
    click DA "https://github.com/juliannparra99/inventory-management-system/blob/main/inventory-management-system/Business/DataAccess.cs"
    click DM "https://github.com/juliannparra99/inventory-management-system/tree/main/inventory-management-system/Domain"
    click Art "https://github.com/juliannparra99/inventory-management-system/blob/main/inventory-management-system/Domain/Articulo.cs"
    click Cat "https://github.com/juliannparra99/inventory-management-system/blob/main/inventory-management-system/Domain/Categoria.cs"
    click Mar "https://github.com/juliannparra99/inventory-management-system/blob/main/inventory-management-system/Domain/Marca.cs"
    click DB "https://github.com/juliannparra99/inventory-management-system/blob/main/inventory-management-system/Business/script_db/CATALOGO_DB.sql"

    classDef ui fill:#f4cccc,stroke:#cc0000,stroke-width:2px;
    classDef business fill:#cfe2f3,stroke:#0b5394,stroke-width:2px;
    classDef businessComp fill:#fde9d9,stroke:#b45f06,stroke-width:2px;
    classDef domain fill:#d9ead3,stroke:#38761d,stroke-width:2px;
    classDef domainComp fill:#e2efda,stroke:#134f1c,stroke-width:2px;
    classDef database fill:#fff2cc,stroke:#bf9000,stroke-width:2px;
```
