# engineeringsebastian-s/pdyp architecture

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

- Interactive diagram: https://gitdiagram.com/engineeringsebastian-s/pdyp
- Repository: https://github.com/engineeringsebastian-s/pdyp

## Overview

A. Project Type and Purpose
##### This is a full-stack school-management application (“PDYP”) composed of
- A React/Vite frontend (“colegio-frontend”) for managing areas, employees, offices, classrooms, and reports.
- A Spring Boot backend (“colegio”) exposing REST APIs, persisting data via JPA repositories, and seeding initial data.

B. File-Structure Analysis (QuizTwo_v2 only)
##### Top-level folders
- colegio-frontend/   → React single-page app
- colegio/            → Spring Boot REST service
##### Frontend details
- package.json, vite.config.js
- src/api/*.js        → HTTP clients for each entity
- src/pages/*.jsx     → CRUD pages (AreasList, AreaForm, etc.)
- src/components/     → shared layout components
##### Backend details
- src/main/java/co/cambridge/colegio/
- config/          → WebCorsConfig, DataSeeder
- domain/          → JPA entities (Area, Empleado, Oficina, Salon, Profesor, Administrativo)
- repository/      → Spring Data JPA repos
- service/         → business services + impl
- web/             → REST controllers
– dto/, dto/report/ → request/response models
– error/            → exception handlers
– mapper/           → DTO ↔ entity mappers

##### Frontend (React SPA)
- Pages & components
- HTTP clients invoking REST endpoints
##### API Gateway / Backend (Spring Boot)
- Controllers (REST layer)
- DTO ↔ Entity mappers
- Service layer (business logic)
- Repository layer (data access)
- DataSeeder (initial data load)
##### Database
- Relational DB (e.g., H2/MySQL/PostgreSQL) storing domain tables
##### Cross-Cutting
- CORS configuration
- application.properties (DB & server configs)

D. Relationships & Data Flow
##### Responses flow back up: DB → Repository → Service → Controller → Frontend.

E. Architectural Patterns & Principles
##### Single-page application (SPA) frontend decoupled from backend.

F. Diagramming Guidelines for Full-Stack Apps
- UI → HTTP → Controllers → Services → Repos → DB
- Modules (e.g., AreaService, EmpleadoController).
- Config (CORS, DataSeeder).

- Controller layer
- DTO↔Mapper layer
- Service layer
- Repository layer
- Config (CORS, DataSeeder)
##### Technologies
- React, Vite, Axios/http.js
- Spring Boot, Spring Data JPA, H2/MySQL, Maven

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User and Frontend
    Browser["User Browser"]:::browser
    subgraph "Frontend Layer"
        FrontendRoot["React/Vite Frontend"]:::frontend
        Pages["Pages (CRUD UIs)"]:::frontend
        HTTPClients["HTTP Clients (Axios/http.js)"]:::frontend
        Layout["Shared Layout"]:::frontend
    end

    Browser -->|"Interacts with UI"| FrontendRoot
    FrontendRoot --> Pages
    FrontendRoot --> HTTPClients
    FrontendRoot --> Layout

    click FrontendRoot "https://github.com/engineeringsebastian-s/pdyp/tree/main/QuizTwo_v2/colegio-frontend/"
    click Pages "https://github.com/engineeringsebastian-s/pdyp/tree/main/QuizTwo_v2/colegio-frontend/src/pages/"
    click HTTPClients "https://github.com/engineeringsebastian-s/pdyp/tree/main/QuizTwo_v2/colegio-frontend/src/api/"
    click Layout "https://github.com/engineeringsebastian-s/pdyp/blob/main/QuizTwo_v2/colegio-frontend/src/components/Layout.jsx"

    %% Backend
    subgraph "Spring Boot Backend"
        App["Application Entry"]:::config
        Configs["Configuration"]:::config
        Controllers["Controllers (REST Layer)"]:::api
        DTOs["DTOs (Request/Response)"]:::api
        Mappers["Mappers"]:::api
        Services["Service Layer"]:::service
        Repos["Repository Layer"]:::repo
        Entities["Domain Entities"]:::domain
        Props["application.properties"]:::config
    end

    HTTPClients -->|"REST API calls"| Controllers
    Controllers --> DTOs
    Controllers --> Mappers
    DTOs --> Mappers
    Mappers --> Services
    Services --> Repos
    Repos --> Entities
    Repos -->|"CRUD operations"| DB["Relational Database"]:::db

    DB -->|"Data results"| Repos
    Repos --> Services
    Services --> Controllers
    Controllers --> HTTPClients

    Controllers --> Services
    Services --> Repos

    click App "https://github.com/engineeringsebastian-s/pdyp/blob/main/QuizTwo_v2/colegio/src/main/java/co/cambridge/colegio/ColegioApplication.java"
    click Configs "https://github.com/engineeringsebastian-s/pdyp/tree/main/QuizTwo_v2/colegio/src/main/java/co/cambridge/colegio/config/"
    click Controllers "https://github.com/engineeringsebastian-s/pdyp/tree/main/QuizTwo_v2/colegio/src/main/java/co/cambridge/colegio/web/"
    click DTOs "https://github.com/engineeringsebastian-s/pdyp/tree/main/QuizTwo_v2/colegio/src/main/java/co/cambridge/colegio/web/dto/"
    click Mappers "https://github.com/engineeringsebastian-s/pdyp/tree/main/QuizTwo_v2/colegio/src/main/java/co/cambridge/colegio/web/mapper/"
    click Services "https://github.com/engineeringsebastian-s/pdyp/tree/main/QuizTwo_v2/colegio/src/main/java/co/cambridge/colegio/service/"
    click Repos "https://github.com/engineeringsebastian-s/pdyp/tree/main/QuizTwo_v2/colegio/src/main/java/co/cambridge/colegio/repository/"
    click Entities "https://github.com/engineeringsebastian-s/pdyp/tree/main/QuizTwo_v2/colegio/src/main/java/co/cambridge/colegio/domain/"
    click Props "https://github.com/engineeringsebastian-s/pdyp/blob/main/QuizTwo_v2/colegio/src/main/resources/application.properties"

    %% Configuration and Data Seeder
    Configs --> App
    Configs --> Controllers

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef api fill:#90EE90,stroke:#000,stroke-width:1px
    classDef service fill:#FFA500,stroke:#000,stroke-width:1px
    classDef repo fill:#FFD700,stroke:#000,stroke-width:1px
    classDef domain fill:#D3D3D3,stroke:#000,stroke-width:1px
    classDef config fill:#DDA0DD,stroke:#000,stroke-width:1px
    classDef db fill:#A52A2A,stroke:#000,stroke-width:1px
    classDef browser fill:#FFFFFF,stroke:#000,stroke-width:1px,stroke-dasharray: 5 5
```
