# facuvillalba44/backenditsu architecture

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

- Interactive diagram: https://gitdiagram.com/facuvillalba44/backenditsu
- Repository: https://github.com/facuvillalba44/backenditsu

## Overview

##### Main Components
a. Client/Consumer Layer (External HTTP Clients): Represent external clients (web portals, mobile apps, etc.) sending HTTP requests to the service.
c. Service Layer (Business Logic): The “servicio” package contains interfaces (e.g., ICarreraServicio) and their concrete implementations (e.g., CarreraServicio). Represent this as a separate layer where business rules and domain logic are implemented.
d. Data Access Layer (Repository/DAO): The “repositorio” package includes repositories (e.g., CarreraRepositorio, UsuarioRepositorio) that manage persistence. This layer will abstract away the database operations.
e. Domain Model: The “modelo” package contains domain entities (e.g., Carrera, Materias, Notas, Usuario). Represent these as data models that migrate through layers.
g. Database: External to the application, a MySQL database is envisioned (given SQL scripts “datos_iniciales.sql” and “estructura.sql”) which acts as the persistent storage.

##### Relationships and Interactions
- Incoming requests from clients first hit the Controllers, which then delegate to the corresponding Service classes.
- The Service classes coordinate business logic and delegate data persistence operations to the Repository layer.
- The Repository layer communicates with the underlying MySQL database.
- The configuration components (e.g., SecurityConfig and JwtAuthenticationFilter) mediate authentication and environment setup across the API.

##### Architectural Patterns and Design Principles
- The project follows a layered (n-tier) architecture: separation between presentation (controllers), business logic (services), and data access (repositories).
- It also uses dependency injection and the repository pattern (as seen with Spring Boot’s typical development pattern).
- For security, JWT authentication is integrated to secure endpoints via Spring Security.

##### Relevant Technologies and Frameworks
- Java and Maven (pom.xml is used) as the project’s backbone.
- Spring Boot as the foundation of the API, with Spring Security for authentication.
- JWT for token-based security.
- SQL/MySQL as the database backend.
- DotenvConfig indicates environment variable management.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Client/Consumer Layer
    subgraph "Client/Consumer Layer"
        CLIENT("External Clients"):::clientStyle
    end

    %% API Layer (Controllers)
    subgraph "API Layer (Controllers)"
        CONTROLLERS("Controllers"):::controllerStyle
    end

    %% Service Layer (Business Logic)
    subgraph "Service Layer (Business Logic)"
        SERVICES("Services"):::serviceStyle
    end

    %% Data Access Layer (Repositories)
    subgraph "Data Access Layer (Repositories)"
        REPOSITORIES("Repositories"):::repositoryStyle
    end

    %% Domain Model
    subgraph "Domain Model"
        DOMAIN("Domain Models"):::domainStyle
    end

    %% Configuration & Security
    subgraph "Configuration & Security"
        CONFIG("Configuration & Security"):::configStyle
    end

    %% Database
    subgraph "Database"
        DB("MySQL Database"):::databaseStyle
        SQL("SQL Scripts"):::databaseStyle
        DBSETTINGS("DB Settings"):::databaseStyle
    end

    %% Relationships
    CLIENT -->|"HTTP_Requests"| CONTROLLERS
    CONTROLLERS -->|"Delegates_to"| SERVICES
    SERVICES -->|"Executes"| REPOSITORIES
    REPOSITORIES -->|"Queries"| DB
    CONFIG -.->|"JWT_Auth"| CONTROLLERS
    SERVICES -.->|"Uses"| DOMAIN

    %% Click Events
    click CONTROLLERS "https://github.com/facuvillalba44/backenditsu/tree/main/src/main/java/edu/itsu/inscripciones/controlador"
    click SERVICES "https://github.com/facuvillalba44/backenditsu/tree/main/src/main/java/edu/itsu/inscripciones/servicio"
    click REPOSITORIES "https://github.com/facuvillalba44/backenditsu/tree/main/src/main/java/edu/itsu/inscripciones/repositorio"
    click DOMAIN "https://github.com/facuvillalba44/backenditsu/tree/main/src/main/java/edu/itsu/inscripciones/modelo"
    click CONFIG "https://github.com/facuvillalba44/backenditsu/tree/main/src/main/java/edu/itsu/inscripciones/config"
    click SQL "https://github.com/facuvillalba44/backenditsu/blob/main/datos_iniciales.sql"
    click DBSETTINGS "https://github.com/facuvillalba44/backenditsu/blob/main/src/main/resources/application.properties"

    %% Styles
    classDef clientStyle fill:#fef2c0,stroke:#d8a300,stroke-width:2px;
    classDef controllerStyle fill:#c0defe,stroke:#007acc,stroke-width:2px;
    classDef serviceStyle fill:#d0f0c0,stroke:#28a745,stroke-width:2px;
    classDef repositoryStyle fill:#ffc0cb,stroke:#c82333,stroke-width:2px;
    classDef domainStyle fill:#e2ccff,stroke:#6f42c1,stroke-width:2px;
    classDef configStyle fill:#ffe0b2,stroke:#ff9800,stroke-width:2px;
    classDef databaseStyle fill:#ffcccc,stroke:#dc3545,stroke-width:2px;
```
