# josephmn/api-services-all architecture

> Architecture diagram of the GitHub repository josephmn/api-services-all, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/josephmn/api-services-all
- Repository: https://github.com/josephmn/api-services-all

## Overview

##### Project type and purpose
- From the file tree and minimal README, this is a Spring-based monolithic API service (“api-services-all”) built with Maven.
- It exposes REST endpoints (in the `controller` layer) for different external providers (e.g., EmapaCanete, LuzDelSur), orchestrates calls via WebClient, maps/parses responses, and returns DTOs.

##### File structure
- Top-level:
- pom.xml / Maven wrapper → Java, Spring Boot project
- src/main/java/com/services/api/all → code under one spring-boot module
- Under `api/all`:
- config → JacksonConfig, WebClientConfig (app-wide beans)
- controller → REST controllers
- dto → request/response payload objects
- service → service interfaces
- service/impl → business logic, calling external APIs
- util → mappers, HTMLParser
- src/main/resources/application.yml → runtime properties

##### Diagramming conventions
- Controllers (blue)
- Services (green)
- Utils (yellow)
- Config (gray)
- External (red)
- Rectangles for components

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Entry
    Client["Client"]:::external
    Client -->|HTTP Request| App

    %% Application Entry Point
    App["Spring Boot Application"]:::config

    %% Configuration Layer
    subgraph "Configuration Layer"
        JacksonConfig["JacksonConfig"]:::config
        WebClientConfig["WebClientConfig"]:::config
    end
    App --> JacksonConfig
    App --> WebClientConfig

    %% Presentation Layer
    subgraph "Controllers" 
        ECtrl["EmapaCaneteController"]:::controller
        LSCtrl["LuzDelSurController"]:::controller
    end
    App --> ECtrl
    App --> LSCtrl

    %% DTOs
    subgraph "DTOs"
        BR["BillingRequest / BillingResponse"]:::dto
        LASR["LightAccountStatementResponse"]:::dto
        LR["LoginRequest / LoginResponse"]:::dto
        TR["TicketRequest"]:::dto
        WASR["WaterAccountStatementResponse"]:::dto
    end
    ECtrl -->|uses DTOs| BR
    ECtrl -->|uses DTOs| WASR
    LSCtrl -->|uses DTOs| TR
    LSCtrl -->|uses DTOs| LR

    %% Business Layer Interfaces and Implementations
    subgraph "Service Interfaces"
        ESvcI["EmapaCaneteService"]:::service
        LSvcI["LuzDelSurService"]:::service
    end
    subgraph "Service Implementations"
        ESvcImpl["EmapaCaneteServiceImpl"]:::service
        LSvcImpl["LuzDelSurServiceImpl"]:::service
    end
    ECtrl -->|calls| ESvcI
    LSCtrl -->|calls| LSvcI
    ESvcI -->|implemented by| ESvcImpl
    LSvcI -->|implemented by| LSvcImpl

    %% Utility Layer
    subgraph "Utility Layer"
        ASMapper["AccountStatementMapper"]:::util
        BillingMapper["BillingMapper"]:::util
        HtmlParser["HtmlParser"]:::util
    end
    ESvcImpl -->|uses| ASMapper
    ESvcImpl -->|uses| BillingMapper
    ESvcImpl -->|uses| HtmlParser
    LSvcImpl -->|uses| ASMapper
    LSvcImpl -->|uses| BillingMapper
    LSvcImpl -->|uses| HtmlParser

    %% WebClient Bean
    WebClientBean["WebClient Bean"]:::config
    WebClientConfig --> WebClientBean
    WebClientBean --> ESvcImpl
    WebClientBean --> LSvcImpl

    %% External Systems
    subgraph "External APIs"
        EmapaAPI["EmapaCanete API"]:::external
        LuzAPI["LuzDelSur API"]:::external
    end
    ESvcImpl -->|HTTP Call| EmapaAPI
    LSvcImpl -->|HTTP Call| LuzAPI

    %% Click Events
    click App "https://github.com/josephmn/api-services-all/blob/main/src/main/java/com/services/api/all/Application.java"
    click JacksonConfig "https://github.com/josephmn/api-services-all/blob/main/src/main/java/com/services/api/all/config/JacksonConfig.java"
    click WebClientConfig "https://github.com/josephmn/api-services-all/blob/main/src/main/java/com/services/api/all/config/WebClientConfig.java"
    click ECtrl "https://github.com/josephmn/api-services-all/blob/main/src/main/java/com/services/api/all/controller/EmapaCaneteController.java"
    click LSCtrl "https://github.com/josephmn/api-services-all/blob/main/src/main/java/com/services/api/all/controller/LuzDelSurController.java"
    click ESvcI "https://github.com/josephmn/api-services-all/blob/main/src/main/java/com/services/api/all/service/EmapaCaneteService.java"
    click LSvcI "https://github.com/josephmn/api-services-all/blob/main/src/main/java/com/services/api/all/service/LuzDelSurService.java"
    click ESvcImpl "https://github.com/josephmn/api-services-all/blob/main/src/main/java/com/services/api/all/service/impl/EmapaCaneteServiceImpl.java"
    click LSvcImpl "https://github.com/josephmn/api-services-all/blob/main/src/main/java/com/services/api/all/service/impl/LuzDelSurServiceImpl.java"
    click ASMapper "https://github.com/josephmn/api-services-all/blob/main/src/main/java/com/services/api/all/util/AccountStatementMapper.java"
    click BillingMapper "https://github.com/josephmn/api-services-all/blob/main/src/main/java/com/services/api/all/util/BillingMapper.java"
    click HtmlParser "https://github.com/josephmn/api-services-all/blob/main/src/main/java/com/services/api/all/util/HtmlParser.java"
    click BR "https://github.com/josephmn/api-services-all/blob/main/src/main/java/com/services/api/all/dto/BillingRequest.java"
    click LR "https://github.com/josephmn/api-services-all/blob/main/src/main/java/com/services/api/all/dto/LoginRequest.java"
    click TR "https://github.com/josephmn/api-services-all/blob/main/src/main/java/com/services/api/all/dto/TicketRequest.java"
    click WASR "https://github.com/josephmn/api-services-all/blob/main/src/main/java/com/services/api/all/dto/WaterAccountStatementResponse.java"
    click LASR "https://github.com/josephmn/api-services-all/blob/main/src/main/java/com/services/api/all/dto/LightAccountStatementResponse.java"
    click BR "https://github.com/josephmn/api-services-all/blob/main/src/main/java/com/services/api/all/dto/BillingResponse.java"
    click LR "https://github.com/josephmn/api-services-all/blob/main/src/main/java/com/services/api/all/dto/LoginResponse.java"
    click AppConfig "https://github.com/josephmn/api-services-all/blob/main/src/main/resources/application.yml"

    %% Styles
    classDef controller fill:#D0E8FF,stroke:#4A90E2,stroke-width:1px
    classDef service fill:#D0FFD8,stroke:#3C763D,stroke-width:1px
    classDef util fill:#FFF5BA,stroke:#C09F00,stroke-width:1px
    classDef config fill:#E0E0E0,stroke:#777777,stroke-width:1px
    classDef external fill:#FFD0D0,stroke:#A94442,stroke-width:1px
    classDef dto fill:#F0E0FF,stroke:#6A1B9A,stroke-width:1px
```
