# brayancortes22/sprintboot_carlos_julio architecture

> Architecture diagram of the GitHub repository brayancortes22/sprintboot_carlos_julio, 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/brayancortes22/sprintboot_carlos_julio
- Repository: https://github.com/brayancortes22/sprintboot_carlos_julio

## Overview

##### Main Components

a. Front-end Client:
- Located under the "front-end/gestion" directory.
- Built with React (hinted by files like App.jsx, main.jsx) and styled using TailwindCSS.
- Likely communicates with the REST API hosted on the back-end.

b. Back-end API (Spring Boot Application):
- Located in "back-end/sprint-boot".
- Contains distinct packages:
- Controllers (handling incoming HTTP requests and routing them to the correct service).
- Models (representing the entities such as Aprendiz, Certificados, Cursos, Lecciones).
- Repositories (interfaces for data access using Spring Data JPA).
- Services (business logic and interaction between controllers and repositories).
- DTOs (data transfer objects for API communication).
- Includes a well-defined structure that maps closely to REST endpoints as documented in the README.

c. Database:
- A MariaDB/MySQL database with configuration details provided in application.properties.
- The "base_de datos" directory includes an SQL script (Sena.sql) to establish the database structure and initial data.

##### Relationships and Interactions

- The Front-end client makes HTTP requests (GET, POST, PUT, DELETE) to the Back-end API endpoints.
- The back-end REST controllers receive the requests, forward them to the corresponding service classes.
- Service classes encapsulate business logic, call repository methods to perform CRUD operations on the database.
- The Data Transfer Objects (DTOs) are used to pass structured data between the client and the server.
- The database stores the persistent state for the application (Aprendices, Cursos, etc.), with ORM mapping configured via Spring Data JPA.
- Optional: Include representation of tests and configuration files that support these operations (like application.properties and Maven build files).

##### Architectural Patterns and Design Principles

- Layered Architecture:
- Presentation Layer (Controllers) handles the incoming requests.
- Business Logic (Services) contains application logic.
- Data Access Layer (Repositories) interacts with the MySQL/MariaDB database.
- Use of DTOs for decoupling the internal model from external data representation.

- RESTful API design:
- Clear endpoint definitions for each entity (Aprendiz, Cursos, Lecciones, Certificados).
- CRUD operations with standardized response and error codes.

- Separation of Concerns: The project clearly separates the front-end and back-end responsibilities, enabling independent development and scalability.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Front-end Layer"
        FE["Front-end Client (React/Vite, TailwindCSS)"]:::frontend
    end

    subgraph "Back-end API Layer"
        BE_App["Back-end Main Entry (Spring Boot)"]:::backend
        Controllers["API Controllers (Spring Boot)"]:::backend
        Services["Business Services (Spring Boot)"]:::backend
        Repositories["Data Repositories (Spring Data JPA)"]:::backend
        DTOs["DTOs (Data Transfer Objects)"]:::backend
        DataModels["Data Models (Entities)"]:::backend
        Tests["Tests (Unit&Integration)"]:::backend
    end

    Database["Database (MariaDB/MySQL)"]:::database

    %% Connections between layers
    FE -->|"HTTP_requests"| Controllers
    BE_App -->|"initializes"| Controllers
    Controllers -->|"calls"| Services
    Controllers -->|"transfers_data"| DTOs
    Services -->|"maps"| DataModels
    Services -->|"invokes"| Repositories
    Repositories -->|"CRUD_operations"| Database
    Tests -->|"validates"| BE_App

    %% Click Events
    click FE "https://github.com/brayancortes22/sprintboot_carlos_julio/tree/main/front-end/gestion"
    click BE_App "https://github.com/brayancortes22/sprintboot_carlos_julio/blob/main/back-end/sprint-boot/SprintBootApplication.java"
    click Controllers "https://github.com/brayancortes22/sprintboot_carlos_julio/tree/main/back-end/sprint-boot/src/main/java/com/sena_proyecto_car_2025/controller"
    click Services "https://github.com/brayancortes22/sprintboot_carlos_julio/tree/main/back-end/sprint-boot/src/main/java/com/sena_proyecto_car_2025/service"
    click DataModels "https://github.com/brayancortes22/sprintboot_carlos_julio/tree/main/back-end/sprint-boot/src/main/java/com/sena_proyecto_car_2025/model"
    click Repositories "https://github.com/brayancortes22/sprintboot_carlos_julio/tree/main/back-end/sprint-boot/src/main/java/com/sena_proyecto_car_2025/repository"
    click DTOs "https://github.com/brayancortes22/sprintboot_carlos_julio/tree/main/back-end/sprint-boot/src/main/java/com/sena_proyecto_car_2025/Dto"
    click Database "https://github.com/brayancortes22/sprintboot_carlos_julio/blob/main/base_de datos/Sena.sql"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef backend fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef database fill:#FFD700,stroke:#000,stroke-width:2px;
```
