# alexisbasantes/g1escanertarjetas architecture

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

- Interactive diagram: https://gitdiagram.com/alexisbasantes/g1escanertarjetas
- Repository: https://github.com/alexisbasantes/g1escanertarjetas

## Overview

##### Project type and purpose
- This is a small Java application (CLI‐style) built and run in VS Code.
- It’s centered around an RFID card reader (“LectorTarjeta”) that reads card IDs and records access events.
- There is no separate web frontend or external database; it’s a standalone tool for card‐reader integration and logging.

##### File structure
- Top-level folders:
- src – all Java source code, organized into packages:
– App.java (entry point)
– Contratos (interfaces, e.g. ILectorRFID.java)
– LectorTarjeta (controller and domain, e.g. ControllerLector.java, RegistroAcceso.java)
- .vscode – IDE settings
- No explicit database or network modules; likely logs to file or console.

##### Extract insights from README
- It’s a standard VS Code Java project scaffold.

a. Main components
- CLI Application (App)
- RFID Reader Interface (ILectorRFID)
- Controller Layer (ControllerLector)
- Domain/Logging Module (RegistroAcceso)
- External Hardware (RFID card reader device)
b. Relationships and interactions
1. App invokes ControllerLector to start a read cycle.
2. ControllerLector depends on ILectorRFID (interface) to abstract hardware access.
3. A concrete implementation (not shown in src, but implied) communicates with the physical reader.
4. ControllerLector receives card ID, passes it to RegistroAcceso.
5. RegistroAcceso writes to a log (console or file).
c. Architectural patterns/design principles
- Layered architecture: Presentation (App) → Controller → Domain/Logging.
- Interface segregation and dependency inversion via ILectorRFID.
- Single Responsibility: Controller only orchestrates; RegistroAcceso only logs.
d. Key technologies/libraries
- Java 11+ (run via VS Code Java Extension)
- VS Code build tasks output to bin/
- No external frameworks (plain Java SE)

- Inversion of control via the ILectorRFID interface.
- Data flow from the moment the user/application invokes the reader to the logging of the access event.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        App["App"]:::presentation
    end

    %% Contracts Layer
    subgraph "Contracts (src/Contratos)"
        ILectorRFID["ILectorRFID"]:::controller
    end

    %% Controller and Domain Layer
    subgraph "LectorTarjeta (src/LectorTarjeta)"
        ControllerLector["ControllerLector"]:::controller
        RegistroAcceso["RegistroAcceso"]:::domain
    end

    %% Design Artifacts
    subgraph "Design Artifacts (src/design)"
        DDiagramaClase["DDiagramaClase.drawio"]:::design
        DUseCase["DUseCase.drawio"]:::design
    end

    %% External Hardware
    RFIDDevice["RFID Device"]:::external

    %% Relationships
    App -->|"startRead()"| ControllerLector
    ControllerLector -->|"readCard()"| ILectorRFID
    ILectorRFID -->|"readCard()"| RFIDDevice
    ControllerLector -->|"logAccess()"| RegistroAcceso

    %% Click Events
    click App "https://github.com/alexisbasantes/g1escanertarjetas/blob/main/src/App.java"
    click ILectorRFID "https://github.com/alexisbasantes/g1escanertarjetas/blob/main/src/Contratos/ILectorRFID.java"
    click ControllerLector "https://github.com/alexisbasantes/g1escanertarjetas/blob/main/src/LectorTarjeta/ControllerLector.java"
    click RegistroAcceso "https://github.com/alexisbasantes/g1escanertarjetas/blob/main/src/LectorTarjeta/RegistroAcceso.java"
    click DDiagramaClase "https://github.com/alexisbasantes/g1escanertarjetas/blob/main/src/design/DDiagramaClase.drawio"
    click DUseCase "https://github.com/alexisbasantes/g1escanertarjetas/blob/main/src/design/DUseCase.drawio"

    %% Styles
    classDef presentation fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef controller fill:#90EE90,stroke:#000,stroke-width:1px
    classDef domain fill:#FFFFE0,stroke:#000,stroke-width:1px
    classDef external fill:#D3D3D3,stroke:#000,stroke-width:1px
    classDef design fill:#E0FFFF,stroke:#000,stroke-width:1px
```
