# cstantony1996/gestor-de-biblioteca architecture

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

- Interactive diagram: https://gitdiagram.com/cstantony1996/gestor-de-biblioteca
- Repository: https://github.com/cstantony1996/gestor-de-biblioteca

## Overview

##### Project type and purpose
- This is a monolithic, desktop GUI application written in C++17 for managing a library’s books, loans, reports and user authentication.
- It uses libpqxx to talk to a PostgreSQL database.

##### File structure
- Top-level source files:
- WinMain.cpp – application entry point
- VentanasGUI.* – GUI windows and user interaction
- Connection.* – database connection wrapper using libpqxx
- GestorDBiblioteca.cpp – core business-logic and data-access functions
- Ingresar_libros.* – “book management” use-case module (add/edit/delete/search)
- UserAuth.* – authentication module (login, user roles)
- GestorDBiblioteca.exe – compiled binary
- Supporting directories:
- .github/workflows – CI build/test via GitHub Actions
- .gitignore, LICENSE, README.md

##### README for additional insights
- Key features: advanced search, loans & returns, reporting, secure login
- Tech stack: C++17, PostgreSQL, libpqxx, Git/GitHub

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Application Monolith
    subgraph "Application (C++17 Monolith)"
        direction TB
        WinMain["WinMain.cpp\n(Application Entry Point)"]:::app
        subgraph "UI Layer" 
            direction TB
            VentanasGUI["VentanasGUI.cpp/h\n(UI Layer)"]:::ui
        end
        subgraph "Use-Case Layer"
            direction TB
            Ingresar_libros["Ingresar_libros.cpp/h\n(Book Management)"]:::biz
            UserAuth["UserAuth.cpp/h\n(User Authentication)"]:::biz
        end
        GestorDBiblioteca["GestorDBiblioteca.cpp\n(Business Logic)"]:::biz
        subgraph "Data Access Layer"
            direction TB
            Connection["Connection.cpp/h\n(DB Connection)"]:::data
        end
        GestorDBibliotecaExe["GestorDBiblioteca.exe\n(Compiled Binary)"]:::binary
    end

    %% External Database
    PostgreSQL["PostgreSQL\n(Cylinder)"]:::db

    %% CI/CD
    CI["GitHub Actions\n(.github/workflows)"]:::external

    %% Documentation
    Docs["Project Docs\n(README.md, LICENSE, .gitignore)"]:::external

    %% Application Flow
    WinMain -->|"init: load config"| Connection
    WinMain -->|"showLogin()"| VentanasGUI
    VentanasGUI -->|"userEvent()"| UserAuth
    VentanasGUI -->|"userEvent()"| Ingresar_libros
    VentanasGUI -->|"userEvent()"| GestorDBiblioteca
    UserAuth -->|"authenticate()"| Connection
    Ingresar_libros -->|"executeQuery()"| Connection
    GestorDBiblioteca -->|"executeQuery()"| Connection
    Connection -->|"fetchResults()"| UserAuth
    Connection -->|"fetchResults()"| Ingresar_libros
    Connection -->|"fetchResults()"| GestorDBiblioteca
    Connection -->|"SQL over libpqxx"| PostgreSQL
    PostgreSQL -->|"resultSets"| Connection
    GestorDBiblioteca -->|"generateReport()"| VentanasGUI
    GestorDBiblioteca -->|"launch()"| GestorDBibliotecaExe

    %% CI/CD Flow
    CI -->|"build/test"| GestorDBibliotecaExe
    CI -->|"lint/docs"| Docs

    %% Click Events
    click VentanasGUI "https://github.com/cstantony1996/gestor-de-biblioteca/blob/main/VentanasGUI.cpp"
    click WinMain "https://github.com/cstantony1996/gestor-de-biblioteca/blob/main/WinMain.cpp"
    click Ingresar_libros "https://github.com/cstantony1996/gestor-de-biblioteca/blob/main/Ingresar_libros.cpp"
    click UserAuth "https://github.com/cstantony1996/gestor-de-biblioteca/blob/main/UserAuth.cpp"
    click GestorDBiblioteca "https://github.com/cstantony1996/gestor-de-biblioteca/blob/main/GestorDBiblioteca.cpp"
    click Connection "https://github.com/cstantony1996/gestor-de-biblioteca/blob/main/Connection.cpp"
    click GestorDBibliotecaExe "https://github.com/cstantony1996/gestor-de-biblioteca/blob/main/GestorDBiblioteca.exe"
    click CI "https://github.com/cstantony1996/gestor-de-biblioteca/blob/main/.github/workflows/snake.yml"
    click Docs "https://github.com/cstantony1996/gestor-de-biblioteca/blob/main/README.md"

    %% Styles
    classDef ui fill:#cce5ff,stroke:#004085,color:#004085;
    classDef biz fill:#d4edda,stroke:#155724,color:#155724;
    classDef data fill:#fff3cd,stroke:#856404,color:#856404;
    classDef db fill:#d1ecf1,stroke:#0c5460,color:#0c5460,stroke-dasharray: 5 5;
    classDef external fill:#f8d7da,stroke:#721c24,color:#721c24;
    classDef app fill:#e2e3e5,stroke:#383d41,color:#383d41;
    classDef binary fill:#e2e3e5,stroke:#383d41,color:#383d41,stroke-dasharray: 2 2;
```
