# anthony12lolk1789/emilyshop-app architecture

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

- Interactive diagram: https://gitdiagram.com/anthony12lolk1789/emilyshop-app
- Repository: https://github.com/anthony12lolk1789/emilyshop-app

## Overview

##### Main Components

- Presentation Layer (Vista)
- Business Logic Layer (Controlador)
- Data Layer (Modelo)
- Utility Layer (Utilitario)

B. Key Components:
1. User Interface Components:
- Login Interface
- Main Menu
- User Management
- Inventory Management
- Sales Management
- Registration Forms

2. Controllers:
- Login Controller
- User Creation Controller
- Main Menu Controller

3. Models:
- User Management
- Inventory Management
- Sales Management
- PDF Generation
- Product Model
- User Model
- Sales Model

4. Database Layer:
- Database Connection (ConexionBD)

##### Relationship Flows to Illustrate

- User interface to controller interactions
- Controller to model communications
- Model to database interactions
- Observer pattern implementation (noted by LoginObserver)
- PDF generation flow for sales
- Authentication flow
- Inventory management flow
- Sales processing flow

- [User Interface Layer]
- ↕
- [Controller Layer]
- ↕
- [Model Layer]
- ↕
- [Database Layer]

##### Technical Details

- Database connection pool
- Observer pattern implementation for login events
- PDF generation service
- Password validation service
- Loading screen utility

- [User Interfaces]
- LoginVista → GestionarVentasVista → PrincipalVista → etc.
- ↓
- [Controllers]
- FrmLoginUsuario_Controlador → Menu_Principal_Controlador → etc.
- ↓
- [Models]
- Modelo_Login → Modelo_Inventario → ModeloGestionarVentas → etc.
- ↓
- [Database]
- ConexionBD

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Style Definitions
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef controller fill:#2ecc71,stroke:#27ae60,color:white
    classDef model fill:#f1c40f,stroke:#f39c12,color:black
    classDef database fill:#e74c3c,stroke:#c0392b,color:white
    classDef utility fill:#9b59b6,stroke:#8e44ad,color:white

    %% Presentation Layer
    subgraph Presentation
        Login["Login Interface"]:::ui
        MainMenu["Main Menu"]:::ui
        UserMgmtUI["User Management"]:::ui
        InvMgmtUI["Inventory Management"]:::ui
        SalesMgmtUI["Sales Management"]:::ui
        RegSales["Sales Registration"]:::ui
        RegInv["Inventory Registration"]:::ui
        RegUser["User Registration"]:::ui
    end

    %% Controller Layer
    subgraph Controllers
        LoginCtrl["Login Controller"]:::controller
        UserCtrl["User Creation Controller"]:::controller
        MainCtrl["Main Menu Controller"]:::controller
    end

    %% Model Layer
    subgraph Models
        UserMgmt["User Management"]:::model
        UserCreate["User Creation"]:::model
        InvMgmt["Inventory Management"]:::model
        SalesMgmt["Sales Management"]:::model
        PDFGen["PDF Generation"]:::model
        ProdModel["Product Model"]:::model
        UserModel["User Model"]:::model
        SalesModel["Sales Model"]:::model
        LoginModel["Login Model"]:::model
        LoginObs["Login Observer"]:::model
    end

    %% Utility Layer
    subgraph Utilities
        DBConn["Database Connection"]:::utility
        LoadScreen["Loading Screen"]:::utility
        PassValid["Password Validation"]:::utility
    end

    %% Relationships
    Login --> LoginCtrl
    LoginCtrl --> LoginModel
    LoginModel --> LoginObs
    LoginModel --> DBConn
    
    MainMenu --> MainCtrl
    MainCtrl --> UserMgmt
    MainCtrl --> InvMgmt
    MainCtrl --> SalesMgmt
    
    UserMgmtUI --> UserCtrl
    UserCtrl --> UserCreate
    UserCreate --> UserModel
    UserModel --> DBConn
    
    InvMgmtUI --> InvMgmt
    InvMgmt --> ProdModel
    ProdModel --> DBConn
    
    SalesMgmtUI --> SalesMgmt
    SalesMgmt --> SalesModel
    SalesMgmt --> PDFGen
    SalesModel --> DBConn
    
    RegSales --> SalesMgmt
    RegInv --> InvMgmt
    RegUser --> UserCreate
    
    PassValid --> UserCreate
    LoadScreen --> MainCtrl

    %% Click Events
    click Login "https://github.com/anthony12lolk1789/EmilyShop-App/blob/master/src/Vista/LoginVista.java"
    click MainMenu "https://github.com/anthony12lolk1789/EmilyShop-App/blob/master/src/Vista/PrincipalVista.java"
    click UserMgmtUI "https://github.com/anthony12lolk1789/EmilyShop-App/blob/master/src/Vista/gestionUsuarioVista.java"
    click InvMgmtUI "https://github.com/anthony12lolk1789/EmilyShop-App/blob/master/src/Vista/gestioninventarioVista.java"
    click SalesMgmtUI "https://github.com/anthony12lolk1789/EmilyShop-App/blob/master/src/Vista/GestionarVentasVista.java"
    click LoginCtrl "https://github.com/anthony12lolk1789/EmilyShop-App/blob/master/src/Controlador/FrmLoginUsuario_Controlador.java"
    click UserCtrl "https://github.com/anthony12lolk1789/EmilyShop-App/blob/master/src/Controlador/ControladorCrearUsuario.java"
    click MainCtrl "https://github.com/anthony12lolk1789/EmilyShop-App/blob/master/src/Controlador/Menu_Principal_Controlador.java"
    click UserMgmt "https://github.com/anthony12lolk1789/EmilyShop-App/blob/master/src/Modelo/Modelo_GestionarUsuario.java"
    click UserCreate "https://github.com/anthony12lolk1789/EmilyShop-App/blob/master/src/Modelo/Modelo_CrearUsuario.java"
    click InvMgmt "https://github.com/anthony12lolk1789/EmilyShop-App/blob/master/src/Modelo/Modelo_Inventario.java"
    click SalesMgmt "https://github.com/anthony12lolk1789/EmilyShop-App/blob/master/src/Modelo/ModeloGestionarVentas.java"
    click PDFGen "https://github.com/anthony12lolk1789/EmilyShop-App/blob/master/src/Modelo/VentaPDF.java"
    click ProdModel "https://github.com/anthony12lolk1789/EmilyShop-App/blob/master/src/Modelo/producto.java"
    click UserModel "https://github.com/anthony12lolk1789/EmilyShop-App/blob/master/src/Modelo/usuario.java"
    click SalesModel "https://github.com/anthony12lolk1789/EmilyShop-App/blob/master/src/Modelo/ventas.java"
    click LoginModel "https://github.com/anthony12lolk1789/EmilyShop-App/blob/master/src/Modelo/Modelo_Login.java"
    click LoginObs "https://github.com/anthony12lolk1789/EmilyShop-App/blob/master/src/Modelo/LoginObserver.java"
    click DBConn "https://github.com/anthony12lolk1789/EmilyShop-App/blob/master/src/Utilitario/ConexionBD.java"
    click LoadScreen "https://github.com/anthony12lolk1789/EmilyShop-App/blob/master/src/Utilitario/PantallaCarga.java"
    click PassValid "https://github.com/anthony12lolk1789/EmilyShop-App/blob/master/src/Utilitario/ValidationPassword.java"
    click RegSales "https://github.com/anthony12lolk1789/EmilyShop-App/blob/master/src/Vista/registroVentaVista.java"
    click RegInv "https://github.com/anthony12lolk1789/EmilyShop-App/blob/master/src/Vista/registroInventarioVista.java"
    click RegUser "https://github.com/anthony12lolk1789/EmilyShop-App/blob/master/src/Vista/RegistroUsuarioVista.java"

    %% Legend
    subgraph Legend
        UI[User Interface]:::ui
        CTRL[Controller]:::controller
        MDL[Model]:::model
        DB[Database]:::utility
        UTIL[Utility]:::utility
    end
```
