# alvarroo/lab_diseniosoftware architecture

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

- Interactive diagram: https://gitdiagram.com/alvarroo/lab_diseniosoftware
- Repository: https://github.com/alvarroo/lab_diseniosoftware

## Overview

##### Project Type and Purpose
- The project is a multi-module, full-stack application that appears to implement distinct backend microservices with separate responsibilities (circuits management, payments, and user management) and a frontend module (circuitsfe).
- Each backend module uses Maven for build management and follows the typical Spring Boot structure with controllers, services, and configuration files. The README is minimal but confirms this is a lab design project (“lab_DiseñoSoftware”), indicating that the focus is on demonstrating the architectural design and key interactions of these components.

##### Analyzing the File Structure
- In the “Backend” directory there are three distinct sub-projects:
– circuits: Contains controllers, services, DAO, and model classes, indicating it manages circuits-related data and business logic.
– pagos: Responsible for payments handling, as suggested by the “PaymentsController” and “ProxyStripe” classes which indicate integration with external payment services.
– users: Manages user information and authentication (including token handling via “TokensController”), with its own controllers and configuration.
- Each backend module includes its own “application.properties” and test directories, which reinforces that they are designed to be decoupled and testable units.
- The “Frontend” directory (specifically “circuitsfe”) is likely to provide the user interface that interacts with these backend services.

##### Additional Insights from the README
- Even though the README is brief, the structure combined with the file names reveal an architecture that uses a separation of concerns and likely follows a microservices pattern at the backend level.
- The modules appear to be independent Spring Boot applications, potentially communicating with separate databases and/or external systems.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend Layer"
        FE["Frontend (circuitsfe)"]:::frontend
    end

    %% Backend Layer
    subgraph "Backend Layer"
        %% Circuits Service
        subgraph "Circuits Service"
            CI_Controller["Circuit Controller"]:::controller
            CI_Service["Circuit Service"]:::service
            CI_DAO["Circuit DAO"]:::data
            CI_Model["Circuit Model"]:::data
            CI_Source["Circuits Source Code"]:::backend
            CI_IBM["IBM Integration"]:::external
            CI_DB["Circuits Database"]:::database
        end

        %% Payments Service
        subgraph "Payments Service"
            PY_Controller["Payments Controller"]:::controller
            PY_Service["Payments Service"]:::service
            PY_Proxy["ProxyStripe"]:::external
            PY_Config["Payments Config"]:::config
            PY_Source["Payments Source Code"]:::backend
            PY_DB["Payments Database"]:::database
        end

        %% Users Service
        subgraph "Users Service"
            US_Tokens["Tokens Controller"]:::controller
            US_User["User Controller"]:::controller
            US_Source["Users Source Code"]:::backend
            US_Config["Users Config"]:::config
            US_DB["Users Database"]:::database
        end
    end

    %% External Gateways
    SP["Stripe Payment Gateway"]:::external
    IBMExt["IBM External Service"]:::external

    %% Connections from Frontend to Backend Controllers
    FE -->|"API_Call"| CI_Controller
    FE -->|"API_Call"| PY_Controller
    FE -->|"API_Call"| US_Tokens
    FE -->|"API_Call"| US_User

    %% Circuits Service internal interactions
    CI_Controller -->|"calls"| CI_Service
    CI_Service -->|"invokes"| CI_DAO
    CI_DAO -->|"queries"| CI_DB
    CI_Controller -->|"configures"| CI_IBM
    CI_Source -->|"includes"| CI_Controller
    CI_Source -->|"includes"| CI_Service
    CI_Source -->|"includes"| CI_DAO
    CI_Source -->|"includes"| CI_Model
    CI_IBM -.->|"integrates"| IBMExt

    %% Payments Service internal interactions
    PY_Controller -->|"calls"| PY_Service
    PY_Controller -->|"loads"| PY_Config
    PY_Service -->|"uses"| PY_Proxy
    PY_Service -->|"records"| PY_DB
    PY_Source -->|"includes"| PY_Controller
    PY_Source -->|"includes"| PY_Service
    PY_Source -->|"includes"| PY_Proxy
    PY_Config -->|"configures"| PY_Service
    PY_Proxy -.->|"Stripe_API"| SP

    %% Users Service internal interactions
    US_Tokens -->|"calls"| US_Source
    US_User -->|"calls"| US_Source
    US_Source -->|"reads"| US_Config
    US_Source -->|"accesses"| US_DB

    %% Databases connections note (added as direct arrows from service layers)
    %% (Already included above in internal interactions)

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#333,stroke-width:2px,color:#000;
    classDef backend fill:#F4A582,stroke:#333,stroke-width:2px,color:#000;
    classDef controller fill:#F7DC6F,stroke:#333,stroke-width:2px,color:#000;
    classDef service fill:#82E0AA,stroke:#333,stroke-width:2px,color:#000;
    classDef data fill:#D7BDE2,stroke:#333,stroke-width:2px,color:#000;
    classDef external fill:#AED6F1,stroke:#333,stroke-width:2px,color:#000;
    classDef database fill:#F9E79F,stroke:#333,stroke-width:2px,color:#000;
    classDef config fill:#E6B0AA,stroke:#333,stroke-width:2px,color:#000;

    %% Click Events
    click FE "https://github.com/alvarroo/lab_diseniosoftware/tree/main/Frontend/circuitsfe"
    click CI_Controller "https://github.com/alvarroo/lab_diseniosoftware/blob/main/Backend/circuits/src/main/java/edu/uclm/esi/circuits/http/CircuitController.java"
    click CI_DAO "https://github.com/alvarroo/lab_diseniosoftware/blob/main/Backend/circuits/src/main/java/edu/uclm/esi/circuits/dao/CircuitDao.java"
    click CI_Model "https://github.com/alvarroo/lab_diseniosoftware/blob/main/Backend/circuits/src/main/java/edu/uclm/esi/circuits/model/Circuit.java"
    click CI_Source "https://github.com/alvarroo/lab_diseniosoftware/tree/main/Backend/circuits/src/main/java/edu/uclm/esi/circuits"
    click CI_IBM "https://github.com/alvarroo/lab_diseniosoftware/blob/main/Backend/circuits/src/main/resources/ibm_local.txt"
    click PY_Controller "https://github.com/alvarroo/lab_diseniosoftware/blob/main/Backend/pagos/src/main/java/edu/uclm/esi/payments/http/PaymentsController.java"
    click PY_Service "https://github.com/alvarroo/lab_diseniosoftware/blob/main/Backend/pagos/src/main/java/edu/uclm/esi/payments/services/PaymentsService.java"
    click PY_Proxy "https://github.com/alvarroo/lab_diseniosoftware/blob/main/Backend/pagos/src/main/java/edu/uclm/esi/payments/services/ProxyStripe.java"
    click PY_Source "https://github.com/alvarroo/lab_diseniosoftware/tree/main/Backend/pagos/src/main/java/edu/uclm/esi/payments"
    click PY_Config "https://github.com/alvarroo/lab_diseniosoftware/blob/main/Backend/pagos/src/main/resources/application.properties"
    click US_Tokens "https://github.com/alvarroo/lab_diseniosoftware/blob/main/Backend/users/src/main/java/edu/uclm/esi/users/http/TokensController.java"
    click US_User "https://github.com/alvarroo/lab_diseniosoftware/blob/main/Backend/users/src/main/java/edu/uclm/esi/users/http/UserController.java"
    click US_Source "https://github.com/alvarroo/lab_diseniosoftware/tree/main/Backend/users/src/main/java/edu/uclm/esi/users"
    click US_Config "https://github.com/alvarroo/lab_diseniosoftware/blob/main/Backend/users/src/main/resources/application.properties"
```
