# salvadorandre/proyecto-i-programaci-n- architecture

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

- Interactive diagram: https://gitdiagram.com/salvadorandre/proyecto-i-programaci-n-
- Repository: https://github.com/salvadorandre/proyecto-i-programaci-n-

## Overview

##### Project type and purpose
- This is a C++20 monolithic, console-oriented (or desktop) application built with CMake/CLion.
- The domain seems to be an academic assignment management system: it handles Estudiantes (students), Profesores (teachers), and Asignaciones (assignments).

##### File structure
- Top-level files:
- CMakeLists.txt – build configuration
- main.cpp – application entry point
- interfaces/ – abstract headers (DTOs, UI, controllers, models, repositories, services)
- src/ – concrete implementations mirroring the interfaces hierarchy
- src/utils/ – utility code (e.g., Cursos helper)

##### README
- Only notes C++20 & CLion, no higher-level architecture doc—so we infer a standard layered architecture from the directory layout.

##### Main components and their interactions
a. Presentation Layer (UI)
- interfaces/UI/ui.h + src/UI/ui.cpp
- Responsible for user input/output and kicking off controller actions
b. Controller Layer
- interfaces/controller/*.h + src/controller/*.cpp
- Receives UI events, validates or transforms input, calls Services
c. Service Layer
- interfaces/services/*.h + src/services/*.cpp
- Implements business logic (e.g., assign a course, manage student/teacher rules)
d. Data Access Layer (Repository)
- interfaces/repository/*.h + src/repository/*.cpp
- Encapsulates persistence (could be file or database behind the scenes)
e. Domain Models & DTOs
- interfaces/models + src/models: Estudiante, Profesor classes
- interfaces/DTOs: Asignacion data‐transfer object
f. Utilities
- src/utils/Cursos.{h,cpp} for shared helper functions

Relationships (data flow):
UI → Controller → Service → Repository → (Persistent storage)
Service ↔ Models/DTOs
Controllers can also orchestrate multiple services

##### Architectural patterns and technologies
- Layered (n-tier) architecture: separation of concerns across UI, Controllers, Services, Repositories, and Models
- Dependency inversion via interfaces/ abstract headers, implemented in src/
- Build system: CMake for compilation, linking all modules into a single executable
- Language: Modern C++20, likely using STL, possibly smart pointers or dependency injection patterns

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Application Entry & Build
    subgraph "Build & Entry"
        direction TB
        MainCPP["main.cpp"]:::build
        CMake["CMakeLists.txt"]:::build
    end

    %% Presentation Layer
    subgraph "UI Layer"
        direction TB
        UI_IF["ui.h"]:::ui
        UI_IMPL["ui.cpp"]:::ui
    end

    %% Controller Layer
    subgraph "Controller Layer"
        direction TB
        AC_IF["AsignarController.h"]:::controller
        EC_IF["EstudianteController.h"]:::controller
        PC_IF["ProfesorController.h"]:::controller
        AC_IMPL["AsignarController.cpp"]:::controller
        EC_IMPL["EstudianteController.cpp"]:::controller
        PC_IMPL["ProfesorController.cpp"]:::controller
    end

    %% Service Layer
    subgraph "Service Layer"
        direction TB
        AS_IF["AsignarService.h"]:::service
        ES_IF["EstudianteService.h"]:::service
        PS_IF["ProfesorService.h"]:::service
        AS_IMPL["AsignarService.cpp"]:::service
        ES_IMPL["EstudianteService.cpp"]:::service
        PS_IMPL["ProfesorService.cpp"]:::service
    end

    %% Repository Layer
    subgraph "Repository Layer"
        direction TB
        AR_IF["AsignacionesRepository.h"]:::repo
        ER_IF["EstudianteRepository.h"]:::repo
        PR_IF["ProfesorRepository.h"]:::repo
        AR_IMPL["AsignacionesRepository.cpp"]:::repo
        ER_IMPL["EstudianteRepository.cpp"]:::repo
        PR_IMPL["ProfesorRepository.cpp"]:::repo
    end

    %% Domain Models & DTOs
    subgraph "Domain Models & DTOs"
        direction TB
        ModelE_IF["Estudiante.h"]:::domain
        ModelP_IF["Profesor.h"]:::domain
        DTO_A_IF["Asignacion.h"]:::domain
        ModelE_IMPL["Estudiante.cpp"]:::domain
        ModelP_IMPL["Profesor.cpp"]:::domain
    end

    %% Utilities
    subgraph "Utilities"
        direction TB
        CursosH["Cursos.h"]:::utils
        CursosCPP["Cursos.cpp"]:::utils
    end

    %% Persistent Storage
    Storage["Persistent Storage"]:::storage

    %% Flow connections
    MainCPP --> UI_IF
    MainCPP --> UI_IMPL
    UI_IMPL --> AC_IF
    UI_IMPL --> EC_IF
    UI_IMPL --> PC_IF
    AC_IF --> AS_IF
    EC_IF --> ES_IF
    PC_IF --> PS_IF
    AS_IF --> AR_IF
    ES_IF --> ER_IF
    PS_IF --> PR_IF
    AR_IF --> Storage
    ER_IF --> Storage
    PR_IF --> Storage

    AS_IMPL --> AR_IMPL
    ES_IMPL --> ER_IMPL
    PS_IMPL --> PR_IMPL
    AC_IMPL --> AS_IMPL
    EC_IMPL --> ES_IMPL
    PC_IMPL --> PS_IMPL

    AS_IMPL --> ModelE_IF
    AS_IMPL --> ModelP_IF
    AS_IMPL --> DTO_A_IF
    ModelE_IF --> ModelE_IMPL
    ModelP_IF --> ModelP_IMPL

    %% Utils usage
    UI_IMPL --> CursosH
    AC_IMPL --> CursosH
    AS_IMPL --> CursosH

    %% Click Events
    click UI_IF "https://github.com/salvadorandre/proyecto-i-programaci-n-/blob/main/interfaces/UI/ui.h"
    click UI_IMPL "https://github.com/salvadorandre/proyecto-i-programaci-n-/blob/main/src/UI/ui.cpp"
    click AC_IF "https://github.com/salvadorandre/proyecto-i-programaci-n-/blob/main/interfaces/controller/AsignarController.h"
    click EC_IF "https://github.com/salvadorandre/proyecto-i-programaci-n-/blob/main/interfaces/controller/EstudianteController.h"
    click PC_IF "https://github.com/salvadorandre/proyecto-i-programaci-n-/blob/main/interfaces/controller/ProfesorController.h"
    click AC_IMPL "https://github.com/salvadorandre/proyecto-i-programaci-n-/blob/main/src/controller/AsignarController.cpp"
    click EC_IMPL "https://github.com/salvadorandre/proyecto-i-programaci-n-/blob/main/src/controller/EstudianteController.cpp"
    click PC_IMPL "https://github.com/salvadorandre/proyecto-i-programaci-n-/blob/main/src/controller/ProfesorController.cpp"
    click AS_IF "https://github.com/salvadorandre/proyecto-i-programaci-n-/blob/main/interfaces/services/AsignarService.h"
    click ES_IF "https://github.com/salvadorandre/proyecto-i-programaci-n-/blob/main/interfaces/services/EstudianteService.h"
    click PS_IF "https://github.com/salvadorandre/proyecto-i-programaci-n-/blob/main/interfaces/services/ProfesorService.h"
    click AS_IMPL "https://github.com/salvadorandre/proyecto-i-programaci-n-/blob/main/src/services/AsignarService.cpp"
    click ES_IMPL "https://github.com/salvadorandre/proyecto-i-programaci-n-/blob/main/src/services/EstudianteService.cpp"
    click PS_IMPL "https://github.com/salvadorandre/proyecto-i-programaci-n-/blob/main/src/services/ProfesorService.cpp"
    click AR_IF "https://github.com/salvadorandre/proyecto-i-programaci-n-/blob/main/interfaces/repository/AsignacionesRepository.h"
    click ER_IF "https://github.com/salvadorandre/proyecto-i-programaci-n-/blob/main/interfaces/repository/EstudianteRepository.h"
    click PR_IF "https://github.com/salvadorandre/proyecto-i-programaci-n-/blob/main/interfaces/repository/ProfesorRepository.h"
    click AR_IMPL "https://github.com/salvadorandre/proyecto-i-programaci-n-/blob/main/src/repository/AsignacionesRepository.cpp"
    click ER_IMPL "https://github.com/salvadorandre/proyecto-i-programaci-n-/blob/main/src/repository/EstudianteRepository.cpp"
    click PR_IMPL "https://github.com/salvadorandre/proyecto-i-programaci-n-/blob/main/src/repository/ProfesorRepository.cpp"
    click ModelE_IF "https://github.com/salvadorandre/proyecto-i-programaci-n-/blob/main/interfaces/models/Estudiante.h"
    click ModelP_IF "https://github.com/salvadorandre/proyecto-i-programaci-n-/blob/main/interfaces/models/Profesor.h"
    click DTO_A_IF "https://github.com/salvadorandre/proyecto-i-programaci-n-/blob/main/interfaces/DTOs/Asignacion.h"
    click ModelE_IMPL "https://github.com/salvadorandre/proyecto-i-programaci-n-/blob/main/src/models/Estudiante.cpp"
    click ModelP_IMPL "https://github.com/salvadorandre/proyecto-i-programaci-n-/blob/main/src/models/Profesor.cpp"
    click CursosH "https://github.com/salvadorandre/proyecto-i-programaci-n-/blob/main/src/utils/Cursos.h"
    click CursosCPP "https://github.com/salvadorandre/proyecto-i-programaci-n-/blob/main/src/utils/Cursos.cpp"
    click MainCPP "https://github.com/salvadorandre/proyecto-i-programaci-n-/blob/main/main.cpp"
    click CMake "https://github.com/salvadorandre/proyecto-i-programaci-n-/blob/main/CMakeLists.txt"

    %% Styles
    classDef ui fill:#D6EAF8,stroke:#1B4F72,color:#1B4F72
    classDef controller fill:#D5F5E3,stroke:#196F3D,color:#196F3D
    classDef service fill:#EBDEF0,stroke:#6C3483,color:#6C3483
    classDef repo fill:#FCF3CF,stroke:#B7950B,color:#B7950B
    classDef domain fill:#F2F3F4,stroke:#7B7D7D,color:#7B7D7D
    classDef utils fill:#FEF9E7,stroke:#B9770E,color:#B9770E
    classDef build fill:#EBF5FB,stroke:#2E86C1,color:#2E86C1
    classDef storage fill:#FADBD8,stroke:#C0392B,color:#C0392B,stroke-dasharray: 5 5
```
