# alanvh24/raptornet_exterior_updates architecture

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

- Interactive diagram: https://gitdiagram.com/alanvh24/raptornet_exterior_updates
- Repository: https://github.com/alanvh24/raptornet_exterior_updates

## Overview

##### Main Components and Their Roles
- Backend – RaptorNet:
▪ Controllers (e.g., AuthController, DocenteController, DireccionAcademicaController, etc.) that accept inbound HTTP requests.
▪ DTOs and Models that represent data objects and domain entities such as “Alumno,” “Calificaciones,” “AspiranteCalificaciones,” etc.
▪ Repositories that handle data persistence (these communicate with the underlying database using JPA).
▪ Service layer components (e.g., CalificacionService, EmailService, CargaMateriasService, among others) where core business logic resides.
▪ Security components – this includes JWT utilities, filters, and Spring Security configurations (WebSecurityConfig, AuthTokenFilter, etc.) which handle authentication and authorization.
▪ Configuration files like application.properties that define runtime parameters.
- Frontend – raptornet-frontend:
– A React-based client built with modern JavaScript. It includes environment configuration (.env), entry points (like index.js, App.js), components for various roles (Admin, Docentes, serviciosEscolares, etc.), and service files that manage API calls.
- Database:
– SQL scripts are stored in the “BD” folder (with various SQL files suggesting different environments such as production, test, etc.) and the “BackupsBD” folder. These scripts indicate that an RDBMS is in use.

##### Relationships and Interactions
– The Frontend communicates with the Backend via RESTful HTTP calls. The API endpoints provided by the controllers support authentication, user management, academic record handling, and more.
– In the Backend, the Controllers invoke the Service layer to process business logic. These services then interact with the Repository layer which performs data operations by interfacing with the Database.
– The Security layer, including JWT utilities and filters, is integrated into the request-processing pipeline to ensure secure communication.
– The Database is central; both the backend’s Repository layer and the SQL backup/migration scripts rely on it.

##### Architectural Patterns & Design Principles
– The Backend follows the Model-View-Controller (MVC) pattern, where controllers (presentation layer) separate concerns from the services (business logic) and repositories (data access).
– The Security is implemented using JWT tokens and Spring Security, clearly separating concerns by intercepting and validating requests before they reach application logic.
– The Frontend is component-based, modularizing functionality by domain (e.g., Docentes, Servicios Escolares, Vinculacion) with clear separation between components, services, and utility modules.

##### Key Technologies/Frameworks/Libraries
– Backend: Java, Spring Boot, Maven, Spring Security, JWT, and possibly a relational database (MySQL, PostgreSQL, etc.—implied by the SQL scripts).
– Frontend: React (JavaScript), NodeJS (package.json, package-lock.json), and related libraries for routing and state management.
– Database: SQL scripts imply an RDBMS is used with potential backup and migration strategies.

##### Additional Details for Precision
– In the Backend, don’t simply group everything together; try detailing individual modules that stand out (such as the specialized security services and utilities in the “security” package).
– Indicate migration scripts and backups under the Database section to show schema evolution and backup strategy.
– On the Frontend side, note the existence of helper utilities (like EventBus.js, with-router.js) and service modules handling API interactions.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Subgraph
    subgraph "Frontend - raptornet-frontend"
        FE_ENV["Environment (.env)"]
        FE_index["index.js"]
        FE_app["App.js"]
        FE_components["Components"]
        FE_api["API Services"]
        FE_ENV --> FE_index
        FE_index --> FE_app
        FE_app --> FE_components
        FE_components --> FE_api
    end

    %% Backend Subgraph
    subgraph "Backend - RaptorNet"
        BE_controllers["Controllers"]
        BE_dtos["DTOs"]
        BE_models["Models"]
        BE_service["Service Layer"]
        BE_repos["Repositories"]
        BE_security_config["Security Config"]
        BE_jwt["JWT & Filters"]
        BE_config["Configuration (application.properties)"]
        
        BE_controllers --- BE_dtos
        BE_controllers --- BE_models
        BE_controllers -->|"calls"| BE_service
        BE_service -->|"dataAccess"| BE_repos
        BE_security_config -->|"configures"| BE_jwt
        BE_jwt -->|"validates"| BE_controllers
        BE_repos --> BE_config
    end

    %% Database Subgraph
    subgraph "Database"
        DB_scripts["SQL Scripts"]
        DB_backups["Database Backups"]
        DB_scripts -->|"backup"| DB_backups
    end

    %% Interactions Between Frontend, Backend, and Database
    FE_api -->|"REST_API"| BE_controllers
    BE_repos -->|"read/write"| DB_scripts

    %% Click Events for Backend Components
    click BE_controllers "https://github.com/alanvh24/raptornet_exterior_updates/tree/main/RaptorNet/src/main/java/com/utmir/raptornet/controllers"
    click BE_dtos "https://github.com/alanvh24/raptornet_exterior_updates/tree/main/RaptorNet/src/main/java/com/utmir/raptornet/dto"
    click BE_models "https://github.com/alanvh24/raptornet_exterior_updates/tree/main/RaptorNet/src/main/java/com/utmir/raptornet/models"
    click BE_repos "https://github.com/alanvh24/raptornet_exterior_updates/tree/main/RaptorNet/src/main/java/com/utmir/raptornet/repository"
    click BE_service "https://github.com/alanvh24/raptornet_exterior_updates/tree/main/RaptorNet/src/main/java/com/utmir/raptornet/security/services"
    click BE_security_config "https://github.com/alanvh24/raptornet_exterior_updates/blob/main/RaptorNet/src/main/java/com/utmir/raptornet/security/WebSecurityConfig.java"
    click BE_jwt "https://github.com/alanvh24/raptornet_exterior_updates/tree/main/RaptorNet/src/main/java/com/utmir/raptornet/security/jwt"
    click BE_config "https://github.com/alanvh24/raptornet_exterior_updates/blob/main/RaptorNet/src/main/resources/application.properties"

    %% Click Events for Frontend Components
    click FE_ENV "https://github.com/alanvh24/raptornet_exterior_updates/blob/main/raptornet-frontend/.env"
    click FE_index "https://github.com/alanvh24/raptornet_exterior_updates/blob/main/raptornet-frontend/src/index.js"
    click FE_app "https://github.com/alanvh24/raptornet_exterior_updates/blob/main/raptornet-frontend/src/App.js"
    click FE_components "https://github.com/alanvh24/raptornet_exterior_updates/tree/main/raptornet-frontend/src/components"
    click FE_api "https://github.com/alanvh24/raptornet_exterior_updates/tree/main/raptornet-frontend/src/services"

    %% Click Events for Database Components
    click DB_scripts "https://github.com/alanvh24/raptornet_exterior_updates/tree/main/BD"
    click DB_backups "https://github.com/alanvh24/raptornet_exterior_updates/tree/main/BackupsBD"

    %% Styles
    classDef frontend fill:#add8e6,stroke:#000,stroke-width:2px;
    classDef backend_controller fill:#90ee90,stroke:#000,stroke-width:2px;
    classDef backend_service fill:#ffff99,stroke:#000,stroke-width:2px;
    classDef backend_repo fill:#ffcc99,stroke:#000,stroke-width:2px;
    classDef backend_data fill:#d3d3d3,stroke:#000,stroke-width:2px;
    classDef backend_security fill:#ff9999,stroke:#000,stroke-width:2px;
    classDef backend_config fill:#dda0dd,stroke:#000,stroke-width:2px;
    classDef database fill:#f0e68c,stroke:#000,stroke-width:2px;

    %% Assign classes to nodes
    class FE_ENV,FE_index,FE_app,FE_components,FE_api frontend;
    class BE_controllers backend_controller;
    class BE_service backend_service;
    class BE_repos backend_repo;
    class BE_dtos,BE_models backend_data;
    class BE_security_config,BE_jwt backend_security;
    class BE_config backend_config;
    class DB_scripts,DB_backups database;
```
