# santicaceres1/centroeventos architecture

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

- Interactive diagram: https://gitdiagram.com/santicaceres1/centroeventos
- Repository: https://github.com/santicaceres1/centroeventos

## Overview

##### Project type and purpose
- This is a full-stack .NET 8 application using Clean Architecture for managing university sports events, users, reservations, and attendance.
- The layers are clearly separated: a Blazor UI (CentroEventos.UI), a pure business-logic layer (CentroEventos.Aplicacion), and an EF-based persistence layer (CentroEventos.Repositorios).

##### File structure
- Top-level solution file (CentroEventos.sln) orchestrates three projects.
- CentroEventos.Aplicacion (“Application”):
- Entidades (domain objects)
- CasosDeUso (use-case classes implementing business rules)
- Repositorios (interfaces)
- Servicios (authentication, authorization, hashing)
- Validadores and Excepciones (validation logic)
- CentroEventos.Repositorios (“Infrastructure”):
- EF Core DbContext and repository implementations for EventoDeportivo, Persona, Reserva, Usuario.
- CentroEventos.UI (“Presentation”):
- Blazor components and pages (.razor), appsettings, static assets, Program.cs for DI.
- SQLite file for local persistence.

##### Key insights from README
- Confirms Clean Architecture: UI → Application → Repositories.
- Persistence uses plain text files in console version, but the UI uses EF/SQLite.
- Business rules (no over-booking, no deleting entities with dependent data, etc.).
- Authentication/authorization via IServicioAutorizacion and permissions.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Presentation Layer
    subgraph "Presentation Layer"
        PresentationLayer["Blazor UI"]:::presentation
        Components["Components & Pages"]:::presentation
        ProgramCs["Program.cs (DI Config)"]:::presentation
        SQLiteFile["CentroEventos.sqlite"]:::presentation
    end

    %% Application Layer
    subgraph "Application Layer"
        UseCases["CasosDeUso"]:::application
        Entities["Entidades"]:::application
        ReposInterfaces["Repositorios (Interfaces)"]:::application
        Validators["Validadores"]:::application
        Exceptions["Excepciones"]:::application
        Services["Servicios (Auth/Hashing)"]:::services
    end

    %% Infrastructure Layer
    subgraph "Infrastructure Layer"
        DbContext["CentroEventosContext.cs"]:::infrastructure
        RepoEvento["RepositorioEventoDeportivoEF"]:::infrastructure
        RepoPersona["RepositorioPersonaEF"]:::infrastructure
        RepoReserva["RepositorioReservaEF"]:::infrastructure
        RepoUsuario["RepositorioUsuarioEF"]:::infrastructure
    end

    %% Relationships
    PresentationLayer -->|"renders & navigates"| Components
    Components -->|"calls Use Cases"| UseCases
    PresentationLayer -->|"configures DI"| ProgramCs
    PresentationLayer -->|"stores data in"| SQLiteFile

    UseCases -->|"uses domain entities"| Entities
    UseCases -->|"validates via"| Validators
    Validators -->|"throws"| Exceptions
    UseCases -->|"checks permissions via"| Services
    UseCases -->|"depends on"| ReposInterfaces

    ReposInterfaces -->|"implemented by"| RepoEvento
    ReposInterfaces -->|"implemented by"| RepoPersona
    ReposInterfaces -->|"implemented by"| RepoReserva
    ReposInterfaces -->|"implemented by"| RepoUsuario

    RepoEvento -->|"uses"| DbContext
    RepoPersona -->|"uses"| DbContext
    RepoReserva -->|"uses"| DbContext
    RepoUsuario -->|"uses"| DbContext

    DbContext -->|"reads/writes to"| SQLiteFile

    %% Click Events
    click PresentationLayer "https://github.com/santicaceres1/centroeventos/blob/main/CentroEventos.UI"
    click ProgramCs "https://github.com/santicaceres1/centroeventos/blob/main/CentroEventos.UI/Program.cs"
    click Components "https://github.com/santicaceres1/centroeventos/tree/main/CentroEventos.UI/Components"
    click SQLiteFile "https://github.com/santicaceres1/centroeventos/blob/main/CentroEventos.UI/CentroEventos.sqlite"
    click UseCases "https://github.com/santicaceres1/centroeventos/tree/main/CentroEventos.Aplicacion/CasosDeUso"
    click Entities "https://github.com/santicaceres1/centroeventos/tree/main/CentroEventos.Aplicacion/Entidades"
    click ReposInterfaces "https://github.com/santicaceres1/centroeventos/tree/main/CentroEventos.Aplicacion/Repositorios"
    click Validators "https://github.com/santicaceres1/centroeventos/tree/main/CentroEventos.Aplicacion/Validadores"
    click Exceptions "https://github.com/santicaceres1/centroeventos/tree/main/CentroEventos.Aplicacion/Excepciones"
    click Services "https://github.com/santicaceres1/centroeventos/tree/main/CentroEventos.Aplicacion/Servicios"
    click DbContext "https://github.com/santicaceres1/centroeventos/blob/main/CentroEventos.Repositorios/Repositorios/Contexto/CentroEventosContext.cs"
    click RepoEvento "https://github.com/santicaceres1/centroeventos/blob/main/CentroEventos.Repositorios/Repositorios/RepositorioEventoDeportivoEF.cs"
    click RepoPersona "https://github.com/santicaceres1/centroeventos/blob/main/CentroEventos.Repositorios/Repositorios/RepositorioPersonaEF.cs"
    click RepoReserva "https://github.com/santicaceres1/centroeventos/blob/main/CentroEventos.Repositorios/Repositorios/RepositorioReservaEF.cs"
    click RepoUsuario "https://github.com/santicaceres1/centroeventos/blob/main/CentroEventos.Repositorios/Repositorios/RepositorioUsuarioEF.cs"

    %% Styles
    classDef presentation fill:#A2C8F0,stroke:#333,stroke-width:1px
    classDef application fill:#A4E786,stroke:#333,stroke-width:1px
    classDef infrastructure fill:#F7C260,stroke:#333,stroke-width:1px
    classDef services fill:#DDDDDD,stroke:#333,stroke-dasharray:5 5,stroke-width:1px
```
