# bryanguano02/app_finanzas architecture

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

- Interactive diagram: https://gitdiagram.com/bryanguano02/app_finanzas
- Repository: https://github.com/bryanguano02/app_finanzas

## Overview

##### Key Components

Frontend Layer (View):
- Dashboard View
- Transaction Views (Income/Expense/Transfer)
- Account View
- Category View
- With CSS styling files

Controller Layer:
- ContabilidadController.java as the main controller
- Request/response flow between View and Controller

Model Layer:
- Create three sub-sections:
a. Entities:
- Cuenta (Account)
- Movimiento (Transaction)
- Categories (Ingreso, Egreso, Transferencia)
b. DAO Layer:
- Account operations
- Transaction operations
- Category operations
c. DTOs:
- MovimientoDTO

Database Layer:
- Microsoft Azure Database connection
- Persistence.xml configuration

##### Data Flow Representation

Following flows:
##### User Interface → Controller
- HTTP requests from JSP pages
##### Controller → Model
- Data processing and business logic
##### Model → Database
- Persistence operations

##### Key Relationships to Highlight

- DAO pattern implementation
- Entity relationships (Account-Transaction-Category)
- MVC pattern implementation
- Database connectivity

##### Additional Elements

A section showing:
- External Dependencies (Maven)
- Server Configuration (Tomcat)
- Security Layer (if any)

##### Technical Details

- Java EE/Jakarta EE components
- Database connection details
- Controller mappings
- View template structure

Remember to include notes about:
- Transaction management
- Data validation flow
- Error handling paths
- Azure integration points

This will provide a complete picture of how the application handles financial transactions from user input through to database storage and back to display.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef view 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 config fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Legend
    subgraph Legend
        L1[View Components]:::view
        L2[Controller Components]:::controller
        L3[Model Components]:::model
        L4[Database Components]:::database
        L5[Configuration]:::config
    end

    %% View Layer
    subgraph ViewLayer
        Dashboard["Dashboard View"]:::view
        TransactionViews["Transaction Views"]:::view
        AccountView["Account View"]:::view
        CategoryView["Category View"]:::view
        
        subgraph Styling
            CSS["CSS Styles"]:::view
        end
    end

    %% Controller Layer
    subgraph ControllerLayer
        ContabilidadController["ContabilidadController"]:::controller
    end

    %% Model Layer
    subgraph ModelLayer
        subgraph Entities
            Cuenta["Account Entity"]:::model
            Movimiento["Transaction Entity"]:::model
            Categoria["Category Entity"]:::model
            TransactionTypes["Transaction Types<br/>(Income/Expense/Transfer)"]:::model
        end

        subgraph DAOLayer
            AccountDAO["Account DAO"]:::model
            MovimientoDAO["Transaction DAO"]:::model
            CategoriaDAO["Category DAO"]:::model
        end

        subgraph DTOs
            MovimientoDTO["MovimientoDTO"]:::model
        end
    end

    %% Database Layer
    subgraph DatabaseLayer
        AzureDB["Microsoft Azure Database"]:::database
        PersistenceConfig["Persistence Configuration"]:::config
    end

    %% Relationships
    ViewLayer --> ContabilidadController
    ContabilidadController --> ModelLayer
    ModelLayer --> DatabaseLayer
    DatabaseLayer --> ModelLayer
    ModelLayer --> ContabilidadController
    ContabilidadController --> ViewLayer

    %% Click Events
    click Dashboard "https://github.com/BryanGuano02/App_Finanzas/blob/main/src/main/webapp/jsp/VerDashboard.jsp"
    click AccountView "https://github.com/BryanGuano02/App_Finanzas/blob/main/src/main/webapp/jsp/VerCuenta.jsp"
    click CategoryView "https://github.com/BryanGuano02/App_Finanzas/blob/main/src/main/webapp/jsp/VerCategoria.jsp"
    click CSS "https://github.com/BryanGuano02/App_Finanzas/tree/main/src/main/webapp/jsp"
    click ContabilidadController "https://github.com/BryanGuano02/App_Finanzas/blob/main/src/main/java/controlador/ContabilidadController.java"
    click Cuenta "https://github.com/BryanGuano02/App_Finanzas/blob/main/src/main/java/modelo/entidades/Cuenta.java"
    click Movimiento "https://github.com/BryanGuano02/App_Finanzas/blob/main/src/main/java/modelo/entidades/Movimiento.java"
    click Categoria "https://github.com/BryanGuano02/App_Finanzas/blob/main/src/main/java/modelo/entidades/Categoria.java"
    click AccountDAO "https://github.com/BryanGuano02/App_Finanzas/blob/main/src/main/java/modelo/dao/CuentaDAO.java"
    click MovimientoDAO "https://github.com/BryanGuano02/App_Finanzas/blob/main/src/main/java/modelo/dao/MovimientoDAO.java"
    click CategoriaDAO "https://github.com/BryanGuano02/App_Finanzas/blob/main/src/main/java/modelo/dao/CategoriaDAO.java"
    click MovimientoDTO "https://github.com/BryanGuano02/App_Finanzas/blob/main/src/main/java/modelo/dto/MovimientoDTO.java"
    click PersistenceConfig "https://github.com/BryanGuano02/App_Finanzas/blob/main/src/main/resources/META-INF/persistence.xml"
```
