# jeanesg/acme_aplication architecture

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

- Interactive diagram: https://gitdiagram.com/jeanesg/acme_aplication
- Repository: https://github.com/jeanesg/acme_aplication

## Overview

##### Project type and purpose
- This is a Python-based backend application implementing a layered MVC-style architecture.
- It exposes Controllers for handling requests (likely a REST API), applies business rules in Services, persists data via Repositories, and uses Models as data contracts.

##### File structure
- Top level:
- configurations.py – application configuration (database URLs, API keys, framework settings)
- main.py – entry point, wires up configuration, controllers, services, repositories
- Folders:
- Controller – HTTP or RPC endpoint handlers
- Service – business logic interfaces (I…Service) and implementations (…ServiceImp)
- Repository – data-access layer for each domain entity
- Model – domain/data transfer objects (DTOs) and request/response schemas
- Data – static files or metadata used by the app
- Test – unit tests for Service layer
- No “frontend” folder → purely backend/service application.

##### README
- Minimal description (“Informatic Project I”) so rely on file structure for architecture.

a. Main components (layers):
1. Configuration Layer (configurations.py)
2. API Layer (Controller)
3. Business Logic Layer (Service & interface definitions)
4. Data Access Layer (Repository)
5. Domain/Data Model Layer (Model + Data folder)
6. Entry Point (main.py)
7. External/Internal Data Stores or Services (e.g., file system, external Gemini API via RagServiceController, Auditor services)

b. Relationships & interactions:
- Entry Point → Controllers (inject configured routers, frameworks)
- Controller → Service (calls business-logic methods)
- Service → Repository (invokes persistence operations)
- Repository → Data Store (reads/writes Data.txt, metadata.json or external DB)
- Anywhere a Model travels: Controller inputs/outputs, Service processing, Repository mapping

c. Architectural patterns & principles:
- Layered (Onion/Clean) architecture: separation of concerns
- Dependency injection: controllers depend on service interfaces, services on repositories
- Single responsibility per layer
- Interface-implementation segregation for testability

d. Key technologies & libraries:
- Python 3.x
- Likely a web framework (Flask, FastAPI or similar) initialized in main.py
- JSON for data exchange
- Unit testing via pytest or unittest in Test folder

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Configuration Layer
    subgraph "Configuration Layer"
        Config["configurations.py"]:::configuration
    end

    %% Entry Point
    subgraph "Entry Point"
        Main["main.py"]:::configuration
    end

    %% API Layer
    subgraph "API Layer"
        AdminCtrl["AdminController.py"]:::controller
        AuditorECtrl["AuditorEController.py"]:::controller
        AuditorICtrl["AuditorIController.py"]:::controller
        FormularioCtrl["FormularioController.py"]:::controller
        GeminiCtrl["GeminiController.py"]:::controller
        PlanAccionCtrl["PlanAccionController.py"]:::controller
        RagServiceCtrl["RagServiceController.py"]:::controller
        RespuestaCtrl["RespuestaController.py"]:::controller
    end

    %% Business Logic Layer
    subgraph "Business Logic Layer"
        IAuditorESvc["IAuditorEService.py"]:::service
        AuditorESvcImp["AuditorEServiceImp.py"]:::service
        IAuditorISvc["IAuditorIService.py"]:::service
        AuditorISvcImp["AuditorIServiceImp.py"]:::service
        IFormularioSvc["IFormularioService.py"]:::service
        FormularioSvcImp["FormularioServiceImp.py"]:::service
        IGeminiSvc["IGeminiService.py"]:::service
        GeminiSvcImp["GeminiServiceImp.py"]:::service
        IPlanAccionSvc["IPlanAccionService.py"]:::service
        PlanAccionSvcImp["PlanAccionServiceImp.py"]:::service
        IRespuestaSvc["IRespuestaService.py"]:::service
        RespuestaSvcImp["RespuestaServiceImp.py"]:::service
        AdminSvc["AdminService.py"]:::service
        RagSvc["RagService.py"]:::service
    end

    %% Data Access Layer
    subgraph "Data Access Layer"
        AuditorERepo["AuditorERepository.py"]:::repository
        AuditorIRepo["AuditorIRepository.py"]:::repository
        FormularioRepo["FormularioRepository.py"]:::repository
        GeminiRepo["GeminiRepository.py"]:::repository
        PlanAccionRepo["PlanAccionRepository.py"]:::repository
        RespuestaRepo["RespuestaRepository.py"]:::repository
    end

    %% Domain/Data Model Layer
    subgraph "Domain/Data Model Layer"
        AuditorEModel["AuditorEModel.py"]:::model
        AuditorIModel["AuditorIModel.py"]:::model
        AuditorResponse["AuditorResponse.py"]:::model
        DocumentModel["DocumentModel.py"]:::model
        FormularioModel["FormularioModel.py"]:::model
        LoginReq["LoginRequest.py"]:::model
        PlanAccionModel["PlanAccionModel.py"]:::model
        PromptModel["PromptModel.py"]:::model
        RespuestaModel["RespuestaModel.py"]:::model
        UsuarioModel["UsuarioModel.py"]:::model
        DataFiles["Data.txt / metadata.json"]:::model
    end

    %% Connections
    Config --> Main
    Main --> AdminCtrl
    Main --> AuditorECtrl
    Main --> AuditorICtrl
    Main --> FormularioCtrl
    Main --> GeminiCtrl
    Main --> PlanAccionCtrl
    Main --> RagServiceCtrl
    Main --> RespuestaCtrl

    AdminCtrl -->|"calls"| AdminSvc
    AuditorECtrl -->|"calls"| AuditorESvcImp
    AuditorICtrl -->|"calls"| AuditorISvcImp
    FormularioCtrl -->|"calls"| FormularioSvcImp
    GeminiCtrl -->|"calls"| GeminiSvcImp
    PlanAccionCtrl -->|"calls"| PlanAccionSvcImp
    RagServiceCtrl -->|"calls"| RagSvc
    RespuestaCtrl -->|"calls"| RespuestaSvcImp

    AuditorESvcImp -->|"implements"| IAuditorESvc
    AuditorISvcImp -->|"implements"| IAuditorISvc
    FormularioSvcImp -->|"implements"| IFormularioSvc
    GeminiSvcImp -->|"implements"| IGeminiSvc
    PlanAccionSvcImp -->|"implements"| IPlanAccionSvc
    RespuestaSvcImp -->|"implements"| IRespuestaSvc

    AdminSvc -->|"calls"| AuditorERepo
    AuditorESvcImp -->|"calls"| AuditorERepo
    AuditorISvcImp -->|"calls"| AuditorIRepo
    FormularioSvcImp -->|"calls"| FormularioRepo
    GeminiSvcImp -->|"calls"| GeminiRepo
    PlanAccionSvcImp -->|"calls"| PlanAccionRepo
    RespuestaSvcImp -->|"calls"| RespuestaRepo
    RagSvc -->|"calls"| GeminiRepo

    AuditorERepo -->|"reads/writes"| DataFiles
    AuditorIRepo -->|"reads/writes"| DataFiles
    FormularioRepo -->|"reads/writes"| DataFiles
    GeminiRepo -->|"reads/writes"| DataFiles
    PlanAccionRepo -->|"reads/writes"| DataFiles
    RespuestaRepo -->|"reads/writes"| DataFiles

    %% Styles
    classDef configuration fill:#d3d3d3,stroke:#333,stroke-width:1px
    classDef controller fill:#add8e6,stroke:#333,stroke-width:1px
    classDef service fill:#90ee90,stroke:#333,stroke-width:1px
    classDef repository fill:#ffdead,stroke:#333,stroke-width:1px
    classDef model fill:#ffffe0,stroke:#333,stroke-width:1px

    %% Click Events
    click Config "https://github.com/jeanesg/acme_aplication/blob/main/configurations.py"
    click Main "https://github.com/jeanesg/acme_aplication/blob/main/main.py"
    click AdminCtrl "https://github.com/jeanesg/acme_aplication/blob/main/Controller/AdminController.py"
    click AuditorECtrl "https://github.com/jeanesg/acme_aplication/blob/main/Controller/AuditorEController.py"
    click AuditorICtrl "https://github.com/jeanesg/acme_aplication/blob/main/Controller/AuditorIController.py"
    click FormularioCtrl "https://github.com/jeanesg/acme_aplication/blob/main/Controller/FormularioController.py"
    click GeminiCtrl "https://github.com/jeanesg/acme_aplication/blob/main/Controller/GeminiController.py"
    click PlanAccionCtrl "https://github.com/jeanesg/acme_aplication/blob/main/Controller/PlanAccionController.py"
    click RagServiceCtrl "https://github.com/jeanesg/acme_aplication/blob/main/Controller/RagServiceController.py"
    click RespuestaCtrl "https://github.com/jeanesg/acme_aplication/blob/main/Controller/RespuestaController.py"
    click IAuditorESvc "https://github.com/jeanesg/acme_aplication/blob/main/Service/IAuditorEService.py"
    click IAuditorISvc "https://github.com/jeanesg/acme_aplication/blob/main/Service/IAuditorIService.py"
    click IFormularioSvc "https://github.com/jeanesg/acme_aplication/blob/main/Service/IFormularioService.py"
    click IGeminiSvc "https://github.com/jeanesg/acme_aplication/blob/main/Service/IGeminiService.py"
    click IPlanAccionSvc "https://github.com/jeanesg/acme_aplication/blob/main/Service/IPlanAccionService.py"
    click IRespuestaSvc "https://github.com/jeanesg/acme_aplication/blob/main/Service/IRespuestaService.py"
    click AuditorESvcImp "https://github.com/jeanesg/acme_aplication/blob/main/Service/AuditorEServiceImp.py"
    click AuditorISvcImp "https://github.com/jeanesg/acme_aplication/blob/main/Service/AuditorIServiceImp.py"
    click FormularioSvcImp "https://github.com/jeanesg/acme_aplication/blob/main/Service/FormularioServiceImp.py"
    click GeminiSvcImp "https://github.com/jeanesg/acme_aplication/blob/main/Service/GeminiServiceImp.py"
    click PlanAccionSvcImp "https://github.com/jeanesg/acme_aplication/blob/main/Service/PlanAccionServiceImp.py"
    click RespuestaSvcImp "https://github.com/jeanesg/acme_aplication/blob/main/Service/RespuestaServiceImp.py"
    click AdminSvc "https://github.com/jeanesg/acme_aplication/blob/main/Service/AdminService.py"
    click RagSvc "https://github.com/jeanesg/acme_aplication/blob/main/Service/RagService.py"
    click AuditorERepo "https://github.com/jeanesg/acme_aplication/blob/main/Repository/AuditorERepository.py"
    click AuditorIRepo "https://github.com/jeanesg/acme_aplication/blob/main/Repository/AuditorIRepository.py"
    click FormularioRepo "https://github.com/jeanesg/acme_aplication/blob/main/Repository/FormularioRepository.py"
    click GeminiRepo "https://github.com/jeanesg/acme_aplication/blob/main/Repository/GeminiRepository.py"
    click PlanAccionRepo "https://github.com/jeanesg/acme_aplication/blob/main/Repository/PlanAccionRepository.py"
    click RespuestaRepo "https://github.com/jeanesg/acme_aplication/blob/main/Repository/RespuestaRepository.py"
    click AuditorEModel "https://github.com/jeanesg/acme_aplication/blob/main/Model/AuditorEModel.py"
    click AuditorIModel "https://github.com/jeanesg/acme_aplication/blob/main/Model/AuditorIModel.py"
    click AuditorResponse "https://github.com/jeanesg/acme_aplication/blob/main/Model/AuditorResponse.py"
    click DocumentModel "https://github.com/jeanesg/acme_aplication/blob/main/Model/DocumentModel.py"
    click FormularioModel "https://github.com/jeanesg/acme_aplication/blob/main/Model/FormularioModel.py"
    click LoginReq "https://github.com/jeanesg/acme_aplication/blob/main/Model/LoginRequest.py"
    click PlanAccionModel "https://github.com/jeanesg/acme_aplication/blob/main/Model/PlanAccionModel.py"
    click PromptModel "https://github.com/jeanesg/acme_aplication/blob/main/Model/PromptModel.py"
    click RespuestaModel "https://github.com/jeanesg/acme_aplication/blob/main/Model/RespuestaModel.py"
    click UsuarioModel "https://github.com/jeanesg/acme_aplication/blob/main/Model/UsuarioModel.py"
    click DataFiles "https://github.com/jeanesg/acme_aplication/blob/main/Data/Data.txt"
    click DataFiles "https://github.com/jeanesg/acme_aplication/blob/main/Data/metadata.json"
```
