# juniord-isael/school_system architecture

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

- Interactive diagram: https://gitdiagram.com/juniord-isael/school_system
- Repository: https://github.com/juniord-isael/school_system

## Overview

##### Project type and purpose
- This is a monolithic, backend-only REST API application for managing students (“Aluno”) and staff (“Colaborador”) in a school system.
- It uses Spring Boot to expose CRUD endpoints, Spring Data JPA/Hibernate for persistence, an in-memory H2 database for storage, and Flyway (via `src/main/resources/db/migration`) to version and apply database migrations.

##### File structure
- Top-level:
- `pom.xml`, Maven wrapper files – build and dependency management
- `.mvn/wrapper` – Maven wrapper configuration
- `src/main/java/br/com/vainaweb/schollsystem` – Java code organized by layer:
– `controller/` (REST controllers)
– `dto/` (data transfer objects)
– `model/` (JPA entity definitions)
– `repository/` (Spring Data JPA interfaces)
– `service/` (business logic)
– `enums/` (domain-specific enums)
- `src/main/resources` – configuration (`application.properties`) and Flyway SQL migration scripts
- `src/test/java` – integration/ unit tests
- No frontend code: purely a backend service.

##### README for additional insights
- Confirms the use of Java 17, Spring Boot, Spring Data JPA, Hibernate, H2 Database, Lombok, Jakarta Validation, Flyway migrations, and exposes a set of REST endpoints for “/aluno” and “/colaborador.”

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Client
    Client["Client (Browser/Postman)"]:::external

    %% Spring Boot Application
    subgraph "Spring Boot Application"
        direction TB
        EntryPoint["SchollSystemApplication"]:::app
        click EntryPoint "https://github.com/juniord-isael/school_system/blob/main/src/main/java/br/com/vainaweb/schollsystem/SchollSystemApplication.java"

        subgraph "Controller Layer"
            direction TB
            AController["AlunoController"]:::controller
            click AController "https://github.com/juniord-isael/school_system/blob/main/src/main/java/br/com/vainaweb/schollsystem/controller/AlunoController.java"
            CController["ColaboradorController"]:::controller
            click CController "https://github.com/juniord-isael/school_system/blob/main/src/main/java/br/com/vainaweb/schollsystem/controller/ColaboradorController.java"
            HelloController["HelloController"]:::controller
            click HelloController "https://github.com/juniord-isael/school_system/blob/main/src/main/java/br/com/vainaweb/schollsystem/controller/HelloController.java"
        end

        subgraph "Service Layer"
            direction TB
            AService["AlunoService"]:::service
            click AService "https://github.com/juniord-isael/school_system/blob/main/src/main/java/br/com/vainaweb/schollsystem/service/AlunoService.java"
            CService["ColaboradorService"]:::service
            click CService "https://github.com/juniord-isael/school_system/blob/main/src/main/java/br/com/vainaweb/schollsystem/service/ColaboradorService.java"
        end

        subgraph "Repository Layer"
            direction TB
            ARepo["AlunoRepository"]:::repository
            click ARepo "https://github.com/juniord-isael/school_system/blob/main/src/main/java/br/com/vainaweb/schollsystem/repository/AlunoRepository.java"
            CRepo["ColaboradorRepository"]:::repository
            click CRepo "https://github.com/juniord-isael/school_system/blob/main/src/main/java/br/com/vainaweb/schollsystem/repository/ColaboradorRepository.java"
        end

        subgraph "DTOs / Models / Enums"
            direction TB
            DadosAluno["DadosAluno"]:::dto
            click DadosAluno "https://github.com/juniord-isael/school_system/blob/main/src/main/java/br/com/vainaweb/schollsystem/dto/DadosAluno.java"
            DadosColaborador["DadosColaborador"]:::dto
            click DadosColaborador "https://github.com/juniord-isael/school_system/blob/main/src/main/java/br/com/vainaweb/schollsystem/dto/DadosColaborador.java"
            DadosAtualizados["DadosAtualizados"]:::dto
            click DadosAtualizados "https://github.com/juniord-isael/school_system/blob/main/src/main/java/br/com/vainaweb/schollsystem/dto/DadosAtualizados.java"
            EnderecoDTO["EnderecoDTO"]:::dto
            click EnderecoDTO "https://github.com/juniord-isael/school_system/blob/main/src/main/java/br/com/vainaweb/schollsystem/dto/EnderecoDTO.java"
            AlunoModel["AlunoModel"]:::model
            click AlunoModel "https://github.com/juniord-isael/school_system/blob/main/src/main/java/br/com/vainaweb/schollsystem/model/AlunoModel.java"
            ColaboradorModel["ColaboradorModel"]:::model
            click ColaboradorModel "https://github.com/juniord-isael/school_system/blob/main/src/main/java/br/com/vainaweb/schollsystem/model/ColaboradorModel.java"
            Endereco["Endereco"]:::model
            click Endereco "https://github.com/juniord-isael/school_system/blob/main/src/main/java/br/com/vainaweb/schollsystem/model/Endereco.java"
            Cargo["Cargo"]:::enum
            click Cargo "https://github.com/juniord-isael/school_system/blob/main/src/main/java/br/com/vainaweb/schollsystem/enums/Cargo.java"
            Curso["Curso"]:::enum
            click Curso "https://github.com/juniord-isael/school_system/blob/main/src/main/java/br/com/vainaweb/schollsystem/enums/Curso.java"
        end
    end

    %% Database and Migrations
    Flyway["Flyway Migration Engine"]:::tool
    click Flyway "https://github.com/juniord-isael/school_system/tree/main/src/main/resources/db/migration"
    H2DB["H2 In-Memory Database"]:::database
    H2Console["H2 Console (UI)"]:::tool

    %% Connections
    Client -->|"HTTP Requests"| AController
    Client -->|"HTTP Requests"| CController
    Client -->|"HTTP Requests"| HelloController

    AController -->|"calls Service"| AService
    CController -->|"calls Service"| CService
    HelloController -->|"health check"| EntryPoint

    AService -->|"calls Repository"| ARepo
    CService -->|"calls Repository"| CRepo

    ARepo <-->|"JDBC / Hibernate"| H2DB
    CRepo <-->|"JDBC / Hibernate"| H2DB

    Flyway -->|"applies migrations on startup"| H2DB
    Client -->|"browse"| H2Console
    H2Console -->|"executes SQL"| H2DB

    %% Styles
    classDef external fill:#eeeeee,stroke:#999999,color:#333333
    classDef app fill:#cceeff,stroke:#3399ff,color:#023963
    classDef controller fill:#e0f7fa,stroke:#00838f,color:#006064
    classDef service fill:#e3f2fd,stroke:#1976d2,color:#0d47a1
    classDef repository fill:#f1f8e9,stroke:#7cb342,color:#33691e
    classDef dto fill:#fce4ec,stroke:#ec407a,color:#880e4f
    classDef model fill:#fff8e1,stroke:#ffb300,color:#ff6f00
    classDef enum fill:#ede7f6,stroke:#5e35b1,color:#311b92
    classDef database fill:#e8f5e9,stroke:#2e7d32,color:#1b5e20
    classDef tool fill:#fff3e0,stroke:#ffa726,color:#e65100
```
