# arukoufx/classroom-gestor architecture

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

- Interactive diagram: https://gitdiagram.com/arukoufx/classroom-gestor
- Repository: https://github.com/arukoufx/classroom-gestor

## Overview

##### Main Components
- Frontend (aula-frontend):
– Built with React (v18) and optionally TypeScript.
– Uses Axios for API communication and React Router for navigation.
– Contains UI components (e.g., CursoList, ProfesorList, CategoriaForm) and static resources (public folder with index.html, etc.).
- Backend (aula-backend):
– Developed with Java 17 and Spring Boot 3, following an MVC pattern.
– Key packages include controllers (web endpoints for courses, professors, and categories), services (business logic), repositories (Spring Data JPA for data persistence), models (domain objects), and dtos (data transfer objects).
– Uses additional configurations and template resources for server-side rendered HTML pages (using Thymeleaf or similar).
- Database:
– MySQL 8, which stores course, professor, and category data.
- External / Optional Components:
– Potential JWT authentication or other external services like email or logging (as noted in the roadmap for authentication).

##### Relationships and Data Flow
- Within the Backend, illustrate the flow:
- Controllers receive HTTP requests and call Service layer methods.
- Services implement business logic and interact with the Repository layer.
- Repositories communicate with the MySQL database.
- Optionally, include feedback loops where the backend sends HTML pages (from the templates folders) if server-side rendering is applicable.

##### Architectural Patterns and Design Principles
- MVC Pattern in the Backend:
– Controllers, Services, Models, and Repositories clearly segregated.
- Full-stack Separation:
– Emphasize the distinct responsibilities of the frontend and backend systems, with a clear API contract (use of Axios in frontend to call backend endpoints).
- Modularity and Clear Layered Architecture:
– Break down each component (frontend modules, back-end modules, database) and show their responsibilities and how they interact.

##### Relevant Technologies and Frameworks
- Backend: Java 17, Spring Boot 3 (including modules such as Spring Data JPA and Spring Web), Maven for dependency and build management, Lombok, and ModelMapper.
- Frontend: React 18, Axios, React Router, and styling frameworks (TailwindCSS or Material UI as commented in README).
- Database: MySQL 8.

##### Additional Details
- Important infrastructure details like configuration files (e.g., application.properties for database settings) and build tools (Maven for backend, npm for frontend).
- Front-end and back-end parts are clearly separated but demonstrate their integration through the API layer.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Subgraph
    subgraph "Frontend"
        R1("React Frontend"):::frontend
        UI("UI Components"):::frontend
        API("API Service"):::frontend
        R1 -->|"comprises"| UI
        R1 -->|"comprises"| API
    end

    %% Backend Subgraph
    subgraph "Backend"
        BMain("Spring Boot Main"):::backend
        Controllers("Controllers"):::backend
        Services("Service Layer"):::backend
        Repos("Repository Layer"):::backend
        Models("Domain Models"):::backend
        DTOs("DTOs"):::backend
        Templates("Templates"):::backend
        Config("Configuration"):::backend

        BMain -->|"initializes"| Controllers
        Controllers -->|"calls"| Services
        Controllers -->|"renders_HTML"| Templates
        Services -->|"uses"| Repos
        Services -->|"processes"| Models
        Services -->|"transforms"| DTOs
        Config -->|"configures"| Repos
    end

    %% Database
    DB("MySQL Database"):::database

    %% API call from Frontend to Backend Controller
    API -->|"HTTP_Request"| Controllers

    %% Repository communicates with Database
    Repos -->|"queries"| DB

    %% Styles
    classDef frontend fill:#f9e79f,stroke:#d35400,stroke-width:2px;
    classDef backend fill:#aed6f1,stroke:#2471a3,stroke-width:2px;
    classDef database fill:#a9dfbf,stroke:#145a32,stroke-width:2px;

    %% Click Events
    click R1 "https://github.com/arukoufx/classroom-gestor/tree/main/aula-frontend/"
    click UI "https://github.com/arukoufx/classroom-gestor/tree/main/aula-frontend/src/components/"
    click API "https://github.com/arukoufx/classroom-gestor/blob/main/aula-frontend/src/service/api.js"
    click BMain "https://github.com/arukoufx/classroom-gestor/blob/main/aula-backend/src/main/java/com/aula/AulaApplication.java"
    click Controllers "https://github.com/arukoufx/classroom-gestor/tree/main/aula-backend/src/main/java/com/aula/controllers/"
    click Services "https://github.com/arukoufx/classroom-gestor/tree/main/aula-backend/src/main/java/com/aula/services/"
    click Repos "https://github.com/arukoufx/classroom-gestor/tree/main/aula-backend/src/main/java/com/aula/repositories/"
    click Models "https://github.com/arukoufx/classroom-gestor/tree/main/aula-backend/src/main/java/com/aula/models/"
    click DTOs "https://github.com/arukoufx/classroom-gestor/tree/main/aula-backend/src/main/java/com/aula/dtos/"
    click Templates "https://github.com/arukoufx/classroom-gestor/tree/main/aula-backend/src/main/resources/templates/"
    click Config "https://github.com/arukoufx/classroom-gestor/blob/main/aula-backend/src/main/resources/application.properties"
```
