# adriancpc/appdressmaking architecture

> Architecture diagram of the GitHub repository adriancpc/appdressmaking, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/adriancpc/appdressmaking
- Repository: https://github.com/adriancpc/appdressmaking

## Overview

- Web/API Layer: Represent the Controllers (ClienteController, DetallePedidoController, InventarioController, MaterialController, PedidoController, ReporteController, and UsuarioController). This layer handles HTTP requests (likely using Web API) and routing (configured in App_Start/WebApiConfig.cs).
- Business Logic / Domain Layer: Represent the Models (e.g., Administrador, Cliente, Empleado, Inventario, Material, Pedido, Reporte, Usuario) which capture the core data structures and entities of the dressmaking domain.
- Data Access Layer: Represent the classes in the Data folder (for example, ConexionBD, ClienteData, DetallePedidoData, etc.) which encapsulate database connectivity and CRUD operations.
- Infrastructure/Configuration: Include components like Global.asax (entry point and lifecycle handler) and configuration files (Web.config, Web.Debug.config, Web.Release.config).

##### Relationships and Interactions
- That the Data Access Layer, in turn, maps data from or writes data to the underlying Database (even though the actual database isn’t in the file tree, it is an essential architectural component).
- Domain Models with both the Controllers (for input/output validations and responses) and the Data Access Layer (for persistence and retrieval operations).
- Application Lifecycle managed by Global.asax and route configuration provided by the WebApiConfig, as these ensure that incoming requests are properly forwarded to the correct controllers.

##### Architectural Patterns and Design Principles
- MVC Pattern: Emphasize the separation between Controllers, Models, and the (implied) Views or response generation logic.
- Separation of Concerns: Clearly show how the Data Access, Business Logic, and Presentation/API layers operate independently yet interact through well-defined interfaces.
- Configuration and Application Start-up: Include a block for the Global.asax and App_Start (web API configuration), which manage application initialization and routing.

##### Technologies and Frameworks
- ASP.NET MVC / Web API: This should be noted as the underlying framework that drives the Controllers and API endpoints.
- .NET Framework / C#: Because the project uses .cs and .csproj files.
- Database: While not explicitly in the file tree, include a Database block (likely an SQL server or similar) that the Data layer connects to via ConexionBD.

- In the Data Access Layer, list the data classes (e.g., ClienteData, PedidoData, etc.) and indicate how they interface with a central Database component.
- In the Business/Domain Layer, illustrate the Models that represent the key business entities such as Cliente, Pedido, Material, etc.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Infrastructure/Configuration Layer
    subgraph "Infrastructure/Configuration"
        GA["Global.asax"]:::infra
        WA["App_Start/WebApiConfig.cs"]:::infra
        WC["Web.config"]:::infra
        WD["Web.Debug.config"]:::infra
        WR["Web.Release.config"]:::infra
    end

    %% Web/API Layer (Controllers)
    subgraph "Web/API Layer"
        CC["ClienteController"]:::controller
        DC["DetallePedidoController"]:::controller
        IC["InventarioController"]:::controller
        MC["MaterialController"]:::controller
        PC["PedidoController"]:::controller
        RC["ReporteController"]:::controller
        UC["UsuarioController"]:::controller
    end

    %% Business/Domain Layer (Models)
    subgraph "Business/Domain Layer"
        ADM["Administrador"]:::model
        CL["Cliente"]:::model
        DPC["DetallePedido"]:::model
        EMP["Empleado"]:::model
        INV["Inventario"]:::model
        MAT["Material"]:::model
        PED["Pedido"]:::model
        REP["Reporte"]:::model
        USR["Usuario"]:::model
    end

    %% Data Access Layer
    subgraph "Data Access Layer"
        CBD["ConexionBD"]:::data
        CLD["ClienteData"]:::data
        DPD["DetallePedidoData"]:::data
        IND["InventarioData"]:::data
        MAD["MaterialData"]:::data
        PEDD["PedidoData"]:::data
        RED["ReporteData"]:::data
        USD["UsuarioData"]:::data
    end

    %% Database Component
    DB["Database"]:::db

    %% Connections from Infrastructure to Controllers
    GA -->|"routes"| CC
    WA -->|"configures"| DC

    %% Connections from Controllers to Domain Models and Data Access
    CC -->|"validates"| CL
    CC -->|"calls"| CLD
    PC -->|"validates"| PED
    PC -->|"calls"| PEDD

    %% Representative connection from Models to Data Access
    CL ---|"maps"| CLD

    %% Connections from Data Access to Database
    CLD -->|"CRUD"| DB
    PEDD -->|"CRUD"| DB

    %% Additional connection from a controller to another model and data access
    UC -->|"validates"| USR
    UC -->|"calls"| USD

    %% Class Styles
    classDef controller fill:#ADD8E6,stroke:#000,stroke-width:1px;
    classDef model fill:#90EE90,stroke:#000,stroke-width:1px;
    classDef data fill:#FFB6C1,stroke:#000,stroke-width:1px;
    classDef infra fill:#FFFFE0,stroke:#000,stroke-width:1px;
    classDef db fill:#D3D3D3,stroke:#000,stroke-width:2px,stroke-dasharray: 5,5;

    %% Click Events for Infrastructure/Configuration
    click GA "https://github.com/adriancpc/appdressmaking/blob/main/AppDressmaking/Global.asax"
    click WA "https://github.com/adriancpc/appdressmaking/blob/main/AppDressmaking/App_Start/WebApiConfig.cs"
    click WC "https://github.com/adriancpc/appdressmaking/blob/main/AppDressmaking/Web.config"
    click WD "https://github.com/adriancpc/appdressmaking/blob/main/AppDressmaking/Web.Debug.config"
    click WR "https://github.com/adriancpc/appdressmaking/blob/main/AppDressmaking/Web.Release.config"

    %% Click Events for Controllers
    click CC "https://github.com/adriancpc/appdressmaking/blob/main/AppDressmaking/Controllers/ClienteController.cs"
    click DC "https://github.com/adriancpc/appdressmaking/blob/main/AppDressmaking/Controllers/DetallePedidoController.cs"
    click IC "https://github.com/adriancpc/appdressmaking/blob/main/AppDressmaking/Controllers/InventarioController.cs"
    click MC "https://github.com/adriancpc/appdressmaking/blob/main/AppDressmaking/Controllers/MaterialController.cs"
    click PC "https://github.com/adriancpc/appdressmaking/blob/main/AppDressmaking/Controllers/PedidoController.cs"
    click RC "https://github.com/adriancpc/appdressmaking/blob/main/AppDressmaking/Controllers/ReporteController.cs"
    click UC "https://github.com/adriancpc/appdressmaking/blob/main/AppDressmaking/Controllers/UsuarioController.cs"

    %% Click Events for Domain Models
    click ADM "https://github.com/adriancpc/appdressmaking/blob/main/AppDressmaking/Models/Administrador.cs"
    click CL "https://github.com/adriancpc/appdressmaking/blob/main/AppDressmaking/Models/Cliente.cs"
    click DPC "https://github.com/adriancpc/appdressmaking/blob/main/AppDressmaking/Models/DetallePedido.cs"
    click EMP "https://github.com/adriancpc/appdressmaking/blob/main/AppDressmaking/Models/Empleado.cs"
    click INV "https://github.com/adriancpc/appdressmaking/blob/main/AppDressmaking/Models/Inventario.cs"
    click MAT "https://github.com/adriancpc/appdressmaking/blob/main/AppDressmaking/Models/Material.cs"
    click PED "https://github.com/adriancpc/appdressmaking/blob/main/AppDressmaking/Models/Pedido.cs"
    click REP "https://github.com/adriancpc/appdressmaking/blob/main/AppDressmaking/Models/Reporte.cs"
    click USR "https://github.com/adriancpc/appdressmaking/blob/main/AppDressmaking/Models/Usuario.cs"

    %% Click Events for Data Access Layer
    click CBD "https://github.com/adriancpc/appdressmaking/blob/main/AppDressmaking/Data/ConexionBD.cs"
    click CLD "https://github.com/adriancpc/appdressmaking/blob/main/AppDressmaking/Data/ClienteData.cs"
    click DPD "https://github.com/adriancpc/appdressmaking/blob/main/AppDressmaking/Data/DetallePedidoData.cs"
    click IND "https://github.com/adriancpc/appdressmaking/blob/main/AppDressmaking/Data/InventarioData.cs"
    click MAD "https://github.com/adriancpc/appdressmaking/blob/main/AppDressmaking/Data/MaterialData.cs"
    click PEDD "https://github.com/adriancpc/appdressmaking/blob/main/AppDressmaking/Data/PedidoData.cs"
    click RED "https://github.com/adriancpc/appdressmaking/blob/main/AppDressmaking/Data/ReporteData.cs"
    click USD "https://github.com/adriancpc/appdressmaking/blob/main/AppDressmaking/Data/UsuarioData.cs"
```
