# edyrrg/-edd-1s2025_201730511 architecture

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

- Interactive diagram: https://gitdiagram.com/edyrrg/-edd-1s2025_201730511
- Repository: https://github.com/edyrrg/-edd-1s2025_201730511

## Overview

##### Project Type and Purpose
- This is a desktop application (likely using a graphical user interface provided by forms/windows) written in C#.
- It is an academic project for an “Estructura de Datos” (Data Structures) course where core emphasis is on implementing custom ADTs (e.g., CircularList, DoubleLinkedList, AVLTree, etc.) as well as integrating business logic (auth, services, user management) with a user interface.
- The existence of multiple “Fases” indicates an evolutionary design – Fase1 might provide initial features (basic UI, core ADTs, and simple services) while Fase2 improves upon these with additional ADTs, better error handling (note the ErrorReportBuilder) and a refined view layer.

##### Analyzing the File Structure
- Top-Level Directories: The top-level folders (AutoGest_Pro/Fase1 and AutoGest_Pro/Fase2) reflect the project evolution.
- Fase1 includes directories such as:
- documentation (technical and user manuals)
- src, broken down into subdirectories for adt (data structures), auth (authentication services), gui (user interfaces/forms), models (domain objects like Factura, Usuario, etc.), and services (data services)
- Fase2 restructures the project with:
- A similar intent but with refined subdirectories such as adts (more advanced data structures like AVLTree, BTree), auth (with session management), builders (for error reporting), models, services (split handling for vehicles, users, etc.), and views (for UI elements)
- This separation by feature and concern naturally suggests a layered architecture.

a. Main Components:
- User Interface Layers:
- Fase1: “gui” folder containing windows/forms (e.g., Login, MainWindow, IngresoUsuario, etc.)
- Fase2: “views” folder that provides enhanced UI components (e.g., AdminMenu, UserMenu, etc.)
- Business Logic / Service Layer:
- “services” directories in both Fase1 and Fase2 (e.g., DataService, UserService, VehiculoService, etc.)
- “auth” directories supporting authentication (AuthService and UserSession)
- “builders” (in Fase2) for constructing error reports dynamically
- Domain / Model Layer:
- “models” directories containing classes such as Factura, Usuario, Vehiculo, etc.
- Data Structures (ADT) Layer:
- “adt” in Fase1 and “adts” in Fase2 which implement various data structures (stacks, queues, trees, linked lists) crucial for the core logic
- Supporting Components:
- Documentation assets for developers and users (manuals, user guides)
- Style files (CSS for gui components in Fase1 and views in Fase2)

b. Relationships and Interactions:
- The UI (gui/views) components receive user input and trigger operations in the business logic layer.
- The business logic layer (services/auth/builders) interacts with the domain models to enact business rules.
- The ADT layer is used by services and, in some cases, directly by models to manage data efficiently (e.g., processing queues, managing sparse matrices).
- Data flows from the UI, through the business logic, to the ADT-managed models, and then results are propagated back to the UI.

c. Architectural Patterns/Design Principles:
- Layered (or tiered) architecture: UI, Business Logic, and Domain/ADT layers.
- Separation of Concerns: Different folders and modules handle discrete responsibilities (UI vs. business logic vs. data management).
- Modular Design: The project is divided into “Fases” as separate modules representing development iterations with potentially increasing complexity.

d. Relevant Technologies and Frameworks:
- C# with .NET Framework (or .NET Core) for building the application.
- Custom implementations of classic data structures (used either for educational purposes or as integral parts of the solution’s performance optimizations).
- Possibly Windows Forms or WPF (given the .cs file usage for GUI components) for the presentation layer.
- CSS for styling specific parts in the GUI (as seen in the styles directories).

- Use clear and distinct labels for each component (e.g., “UI: MainWindow, Login”, “Auth Service”, “ADT: CircularList, AVLTree”, “Data Models”).
- Use rounded rectangles for UI components.
- Use squares or standard rectangles for services and business logic.
- Dependency relationships by grouping related folders (e.g., group all “auth” related components together, all “models” together).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Interface Layer
    subgraph "User Interface Layer"
        UI1["Fase1: GUI Components"] 
        UI2["Fase2: Views"]
    end

    %% Business Logic Layer
    subgraph "Business Logic Layer"
        BL1["Fase1: Services"]
        Auth1["Fase1: Auth Service"]
        BL2["Fase2: Services"]
        Auth2["Fase2: Auth & Session"]
        Builder["Fase2: Error Report Builder"]
    end

    %% Domain / Model Layer
    subgraph "Domain/Model Layer"
        Models1["Fase1: Models"]
        Models2["Fase2: Models"]
    end

    %% ADT / Data Structures Layer
    subgraph "ADT / Data Structures Layer"
        ADT1["Fase1: ADTs"]
        ADT2["Fase2: ADTs"]
    end

    %% Documentation
    Doc1["Fase1: Documentation Assets"]

    %% Data Flow Connections
    UI1 -->|"triggers"| BL1
    UI1 -->|"triggers"| Auth1
    UI2 -->|"triggers"| BL2
    UI2 -->|"triggers"| Auth2

    BL1 -->|"calls"| Models1
    BL1 -->|"manages"| ADT1

    BL2 -->|"calls"| Models2
    BL2 -->|"manages"| ADT2
    BL2 -->|"uses"| Builder

    Auth1 -->|"validates"| Models1
    Auth2 -->|"validates"| Models2

    UI1 -.->|"refers_to"| Doc1
    UI2 -.->|"refers_to"| Doc1

    %% Style Classes
    class UI1,UI2 ui;
    class BL1,BL2 builder_logic;
    class Auth1,Auth2 auth;
    class Models1,Models2 models;
    class ADT1,ADT2 adt;
    class Builder error;
    class Doc1 documentation;

    %% Click Events for Components
    click UI1 "https://github.com/edyrrg/-edd-1s2025_201730511/tree/main/AutoGest_Pro/Fase1/src/gui"
    click UI2 "https://github.com/edyrrg/-edd-1s2025_201730511/tree/main/AutoGest_Pro/Fase2/src/views"
    click BL1 "https://github.com/edyrrg/-edd-1s2025_201730511/tree/main/AutoGest_Pro/Fase1/src/services"
    click BL2 "https://github.com/edyrrg/-edd-1s2025_201730511/tree/main/AutoGest_Pro/Fase2/src/services"
    click Auth1 "https://github.com/edyrrg/-edd-1s2025_201730511/tree/main/AutoGest_Pro/Fase1/src/auth"
    click Auth2 "https://github.com/edyrrg/-edd-1s2025_201730511/tree/main/AutoGest_Pro/Fase2/src/auth"
    click Models1 "https://github.com/edyrrg/-edd-1s2025_201730511/tree/main/AutoGest_Pro/Fase1/src/models"
    click Models2 "https://github.com/edyrrg/-edd-1s2025_201730511/tree/main/AutoGest_Pro/Fase2/src/models"
    click ADT1 "https://github.com/edyrrg/-edd-1s2025_201730511/tree/main/AutoGest_Pro/Fase1/src/adt"
    click ADT2 "https://github.com/edyrrg/-edd-1s2025_201730511/tree/main/AutoGest_Pro/Fase2/src/adts"
    click Builder "https://github.com/edyrrg/-edd-1s2025_201730511/blob/main/AutoGest_Pro/Fase2/src/builders/ErrorReportBuilder.cs"
    click Doc1 "https://github.com/edyrrg/-edd-1s2025_201730511/tree/main/AutoGest_Pro/Fase1/documentation"

    %% Style Definitions
    classDef ui fill:#ADD8E6,stroke:#000,stroke-width:2px,rx:10,ry:10;
    classDef builder_logic fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef auth fill:#FFA500,stroke:#000,stroke-width:2px;
    classDef models fill:#FFFF99,stroke:#000,stroke-width:2px;
    classDef adt fill:#FFB6C1,stroke:#000,stroke-width:2px;
    classDef error fill:#FF6347,stroke:#000,stroke-width:2px;
    classDef documentation fill:#D3D3D3,stroke:#000,stroke-width:2px,stroke-dasharray: 5 5;
```
