# bycrack11/telefit architecture

> Architecture diagram of the GitHub repository bycrack11/telefit, 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/bycrack11/telefit
- Repository: https://github.com/bycrack11/telefit

## Overview

##### Key Domain Entities and Value Objects
- Gimnasio (Gym): As per the README snippet in Gimnasio.java, this entity holds attributes such as “sid” (room/sala ID), “cap” (capacity), and “lta” (list of permitted activities). This should be central in your domain model.
- Sala (Room): A component of the gym that is likely associated with a set of activities.
- Actividades (Activities): Represents the scheduling and management of gym activities. Under this package, you have specific components such as:
– Actividades.java (likely the main entity or aggregate for scheduling activities)
– Dia.java, TipoActividad.java, and Turno.java: These can be represented as either Value Objects or supporting entities that define the activity details, day, type, and time slot respectively.
- Usuarios (Users): This package comprises several roles:
– Usuario (Base class)
– Subclasses: Administrador, Monitor, Socio, in addition to a GestorUsuarios which might act as a domain service or manager for user operations.
- Excepciones (Exceptions): While not modeled as part of the domain in a UML sense, these indicate domain constraints or business rules that might affect interactions.

##### Relationships and Interactions
- Gimnasio is the aggregate root in the gym domain: It aggregates the Sala entities. Each Sala, identified by its “sid”, is further associated with a “cap” (capacity) and a permitted list of Actividades.
- The Usuarios entity hierarchy should be illustrated to show a clear inheritance tree with Usuario as the base, and Administrador, Monitor, and Socio as derived classes. GestorUsuarios may be represented as a manager that interacts with or oversees the Usuario entities.

##### Architectural Patterns and Design Principles
- Aggregates: For instance, note that Gimnasio could be an aggregate that maintains consistency across its Salas and their associated activities.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Gym Domain
    subgraph "Gym Domain"
        GIM["Gimnasio<br>sid, cap, lta"]:::entity
        SALA["Sala<br>sid, cap, activities"]:::entity
        GIM -->|"aggregates"| SALA
    end

    %% Activity Domain
    subgraph "Activity Domain"
        ACT["Actividades"]:::entity
        DIA["Dia"]:::valueObject
        TURNO["Turno"]:::valueObject
        TIPO["TipoActividad"]:::valueObject
        ACT -->|"composes"| DIA
        ACT -->|"composes"| TURNO
        ACT -->|"composes"| TIPO
    end

    %% Linking Gym to Activity Domain
    SALA -->|"permits"| ACT

    %% User Domain
    subgraph "User Domain"
        USR["Usuario"]:::entity
        ADMIN["Administrador"]:::entity
        MON["Monitor"]:::entity
        SOCIO["Socio"]:::entity
        GESTOR["GestorUsuarios"]:::domainService
        %% Inheritance relationships (shown as dashed arrows)
        ADMIN ---|"inherits"| USR
        MON ---|"inherits"| USR
        SOCIO ---|"inherits"| USR
        GESTOR -->|"manages"| USR
    end

    %% Exception Handling
    subgraph "Exception Handling"
        EXCEP["Excepciones"]:::exception
    end

    %% Styles
    classDef entity fill:#ADD8E6,stroke:#000,stroke-width:1px;
    classDef valueObject fill:#90EE90,stroke:#000,stroke-width:1px;
    classDef domainService fill:#FFB6C1,stroke:#000,stroke-width:1px;
    classDef exception fill:#FFD700,stroke:#000,stroke-width:1px;

    %% Click Events
    click GIM "https://github.com/bycrack11/telefit/blob/main/src/telefit/gimnasio/Gimnasio.java"
    click SALA "https://github.com/bycrack11/telefit/blob/main/src/telefit/gimnasio/Sala.java"
    click ACT "https://github.com/bycrack11/telefit/blob/main/src/telefit/actividades/Actividades.java"
    click DIA "https://github.com/bycrack11/telefit/blob/main/src/telefit/actividades/Dia.java"
    click TIPO "https://github.com/bycrack11/telefit/blob/main/src/telefit/actividades/TipoActividad.java"
    click TURNO "https://github.com/bycrack11/telefit/blob/main/src/telefit/actividades/Turno.java"
    click USR "https://github.com/bycrack11/telefit/blob/main/src/telefit/usuarios/Usuario.java"
    click ADMIN "https://github.com/bycrack11/telefit/blob/main/src/telefit/usuarios/Administrador.java"
    click MON "https://github.com/bycrack11/telefit/blob/main/src/telefit/usuarios/Monitor.java"
    click SOCIO "https://github.com/bycrack11/telefit/blob/main/src/telefit/usuarios/Socio.java"
    click GESTOR "https://github.com/bycrack11/telefit/blob/main/src/telefit/usuarios/GestorUsuarios.java"
    click EXCEP "https://github.com/bycrack11/telefit/tree/main/src/telefit/excepciones"
```
