# estrosebas/sistema-asistencia-integrador architecture

> Architecture diagram of the GitHub repository estrosebas/sistema-asistencia-integrador, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/estrosebas/sistema-asistencia-integrador
- Repository: https://github.com/estrosebas/sistema-asistencia-integrador

## Overview

##### Project type and purpose
- This is a full-stack web application (“Sistema Asistencia Integrador”) composed of a React/Vite frontend and a Spring Boot backend, containerized via Docker and orchestrated with Docker Compose. Its purpose is to provide user login/registration, attendance marking (including QR generation and scanning), event configuration, attendance history, reporting, and user management.

##### File structure
- Top level:
- docker-compose.yml, render.yaml – container orchestration definitions
- Base-De-Datos.sql – initial database schema/dumps
- Sistema-asistencia-frontend – React/Vite SPA with its own Dockerfile and nginx.conf
- Sistema-asistencia-backend – Spring Boot service (pom.xml, Dockerfile, Maven wrapper, src & tests)
- Frontend subfolders:
- src/Login, src/Register, src/Home, src/User, src/Manager, src/Admin – React components grouped by UI role
- public & build – static assets and compiled output served by Nginx
- Backend subfolders:
- src/main/java/api/example/apis – Controllers (AuthController, ReporteController), DTOs (LoginRequest/Response, RegisterRequest/Response, SessionResponse), domain objects (Evento, RegistroAsistencia), main class (ApisApplication)
- src/main/resources – application.properties, logging config
- src/test – unit/integration tests with Allure results

##### README for additional insights
- Lists use cases (login, user registration, attendance creation, marking attendance, QR generation, reporting, history, configuration, user management).
- Emphasizes Docker-based deployment: building frontend & backend containers and bringing them up via `docker-compose up --build`.

##### Detail without over-splitting
- Every logical component (UI modules by role, API controllers, DB) but avoid drawing each small React component.
- Integration points: QR-scanner integration in the User Panel, Docker Compose service links.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Orchestration
    DockerCompose["Docker Compose"]:::orchestration
    RenderConfig["Render Deployment Config"]:::orchestration

    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        Browser["Client Browser"]:::presentation
        subgraph "Nginx & React SPA"
            direction TB
            StaticServer["Nginx Static Server"]:::presentation
            ReactApp["React/Vite SPA"]:::presentation
        end
    end

    %% Frontend Source & Build
    subgraph "Frontend Source & Build"
        direction TB
        FE_Source["Source Directory"]:::presentation
        EntryPoint["main.tsx"]:::presentation
        ViteConfig["vite.config.ts"]:::presentation
        TSConfig["tsconfig.json\n(tsconfig.node.json)"]:::presentation
        EnvFile[".env"]:::presentation
        CSSEntry["index.css"]:::presentation
        FE_Build["Build Output"]:::presentation
        FE_Dockerfile["Dockerfile"]:::presentation
        NginxConf["nginx.conf"]:::presentation
    end

    %% Application Layer
    subgraph "Application Layer"
        direction TB
        ApiServer["Spring Boot REST API"]:::application
    end

    %% Backend Source & Config
    subgraph "Backend Source & Build"
        direction TB
        BE_Root["Service Root Dir"]:::application
        MavenBuild["pom.xml\nmvnw/mvnw.cmd"]:::application
        BE_Dockerfile["Dockerfile"]:::application
        MainClass["ApisApplication.java"]:::application
        AuthCtrl["AuthController.java"]:::application
        ReportCtrl["ReporteController.java"]:::application
        DTOs["DTOs (Login/Register/Session/Event)"]:::application
        Entities["Entities (Evento, RegistroAsistencia)"]:::application
        Configs["application.properties\nlog4j2.xml"]:::application
        Tests["Tests & Allure Results"]:::application
    end

    %% Data Layer
    subgraph "Data Layer"
        direction TB
        Database["Relational Database"]:::data
    end

    %% External Module
    QRLib["QR Scanner Library"]:::external
    Camera["Camera Hardware"]:::external

    %% Connections
    Browser -->|"HTTP/HTTPS"| StaticServer
    StaticServer -->|"serves SPA"| Browser
    StaticServer -->|serves files| ReactApp
    ReactApp -->|"REST JSON"| ApiServer
    ApiServer -->|"JDBC"| Database
    ReactApp -->|"in-browser API"| QRLib
    QRLib -->|access| Camera

    %% Orchestration connections
    DockerCompose --> StaticServer
    DockerCompose --> ApiServer
    DockerCompose --> Database
    RenderConfig --> DockerCompose

    %% Frontend build flow annotation
    FE_Source --> EntryPoint
    FE_Source --> ViteConfig
    FE_Source --> TSConfig
    FE_Source --> EnvFile
    FE_Source --> CSSEntry
    EntryPoint --> FE_Build
    ViteConfig --> FE_Build
    FE_Build --> FE_Dockerfile
    FE_Dockerfile --> StaticServer
    NginxConf --> StaticServer

    %% Backend build flow annotation
    BE_Root --> MavenBuild
    MavenBuild --> BE_Dockerfile
    BE_Dockerfile --> ApiServer
    BE_Root --> MainClass
    BE_Root --> AuthCtrl
    BE_Root --> ReportCtrl
    BE_Root --> DTOs
    BE_Root --> Entities
    BE_Root --> Configs
    BE_Root --> Tests

    %% Click Events
    click DockerCompose "https://github.com/estrosebas/sistema-asistencia-integrador/blob/main/docker-compose.yml"
    click RenderConfig "https://github.com/estrosebas/sistema-asistencia-integrador/blob/main/render.yaml"
    click Database "https://github.com/estrosebas/sistema-asistencia-integrador/blob/main/Base-De-Datos.sql"
    click FE_Source "https://github.com/estrosebas/sistema-asistencia-integrador/tree/main/Sistema-asistencia-frontend/src"
    click EntryPoint "https://github.com/estrosebas/sistema-asistencia-integrador/blob/main/Sistema-asistencia-frontend/src/main.tsx"
    click ViteConfig "https://github.com/estrosebas/sistema-asistencia-integrador/blob/main/Sistema-asistencia-frontend/vite.config.ts"
    click TSConfig "https://github.com/estrosebas/sistema-asistencia-integrador/blob/main/tsconfig.json"
    click EnvFile "https://github.com/estrosebas/sistema-asistencia-integrador/blob/main/.env"
    click CSSEntry "https://github.com/estrosebas/sistema-asistencia-integrador/blob/main/Sistema-asistencia-frontend/src/index.css"
    click FE_Build "https://github.com/estrosebas/sistema-asistencia-integrador/tree/main/Sistema-asistencia-frontend/build"
    click FE_Dockerfile "https://github.com/estrosebas/sistema-asistencia-integrador/tree/main/Sistema-asistencia-frontend/Dockerfile"
    click NginxConf "https://github.com/estrosebas/sistema-asistencia-integrador/blob/main/Sistema-asistencia-frontend/nginx.conf"
    click BE_Root "https://github.com/estrosebas/sistema-asistencia-integrador/tree/main/Sistema-asistencia-backend"
    click MavenBuild "https://github.com/estrosebas/sistema-asistencia-integrador/blob/main/Sistema-asistencia-backend/pom.xml"
    click BE_Dockerfile "https://github.com/estrosebas/sistema-asistencia-integrador/tree/main/Sistema-asistencia-backend/Dockerfile"
    click MainClass "https://github.com/estrosebas/sistema-asistencia-integrador/blob/main/Sistema-asistencia-backend/src/main/java/api/example/apis/ApisApplication.java"
    click AuthCtrl "https://github.com/estrosebas/sistema-asistencia-integrador/blob/main/Sistema-asistencia-backend/src/main/java/api/example/apis/AuthController.java"
    click ReportCtrl "https://github.com/estrosebas/sistema-asistencia-integrador/blob/main/Sistema-asistencia-backend/src/main/java/api/example/apis/ReporteController.java"
    click DTOs "https://github.com/estrosebas/sistema-asistencia-integrador/blob/main/Sistema-asistencia-backend/src/main/java/api/example/apis/LoginRequest.java"
    click Entities "https://github.com/estrosebas/sistema-asistencia-integrador/blob/main/Sistema-asistencia-backend/src/main/java/api/example/apis/Evento.java"
    click Configs "https://github.com/estrosebas/sistema-asistencia-integrador/blob/main/Sistema-asistencia-backend/src/main/resources/application.properties"
    click Tests "https://github.com/estrosebas/sistema-asistencia-integrador/tree/main/Sistema-asistencia-backend/allure-results"

    %% Styles
    classDef presentation fill:#D0E6FF,stroke:#0366d6,color:#0366d6
    classDef application fill:#D6FFD6,stroke:#228B22,color:#228B22
    classDef data fill:#FFE0B2,stroke:#FF8C00,color:#FF8C00
    classDef orchestration fill:#F0F0F0,stroke:#666666,color:#000000
    classDef external fill:#FFFFFF,stroke:#999999,color:#555555
```
