# jhackisneros/gestor_de_clientes architecture

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

- Interactive diagram: https://gitdiagram.com/jhackisneros/gestor_de_clientes
- Repository: https://github.com/jhackisneros/gestor_de_clientes

## Overview

##### Project type and purpose
- This is a standalone, monolithic, Python‑based “Client Manager” tool offering both console and Tkinter GUIs for CRUD operations over a CSV file.
- Its core use‑case: maintain a client database (clientes.csv), log changes (historial.log), and optionally export or manipulate data.

##### File structure
- Top‑level:
- main.py / gestor/run.py – entry points
- gestor/ – source package
- tests/ – pytest tests + test CSV
- clientes.csv – production data
- historial.log – operation audit trail
- Inside gestor/:
- menu.py – console menu
- ui.py – Tkinter interface
- database.py – domain logic: load, CRUD, save
- exportador.py – CSV export routines
- historial.py – logging of operations
- helpers.py – screen clears, input wrappers
- config.py – central paths for CSV/test CSV

##### README for additional insights
- Confirms a two‑UI approach (console & GUI), CSV as “database,” pytest for database tests.
- No multi‑service or network layer—pure local file manipulation.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Entry/Orchestration
    subgraph "Entry / Orchestration"
        main("main.py") 
        run("gestor/run.py")
    end

    %% Presentation Layer
    subgraph "Presentation Layer" 
        direction TB
        menu("gestor/menu.py<br/>Console UI") 
        ui("gestor/ui.py<br/>Tkinter GUI")
    end

    %% Business Logic Layer
    subgraph "Business Logic Layer"
        direction TB
        database("gestor/database.py<br/>CRUD & Model")
        exportador("gestor/exportador.py<br/>CSV Export")
        historialLogic("gestor/historial.py<br/>Operation Logging")
        helpers("gestor/helpers.py<br/>Utility Helpers")
    end

    %% Configuration & Tests
    subgraph "Config & Tests"
        direction TB
        config("gestor/config.py<br/>Paths & Settings")
        testDB("tests/test_database.py<br/>Test Logic")
        clientesTest("tests/clientes_test.csv<br/>Test CSV Data")
    end

    %% Data Layer / Resources
    subgraph "Data Layer / Resources"
        direction TB
        clientesCSV("clientes.csv<br/>Client DB")
        historialLog("historial.log<br/>Audit Log")
    end

    %% Connections: Entry to Presentation
    main -->|select UI| menu
    main -->|select UI| ui
    run -->|select UI| menu
    run -->|select UI| ui

    %% Presentation to Business Logic
    menu -->|"invoke CRUD"| database
    menu -->|"invoke export"| exportador
    menu -->|"invoke log"| historialLogic
    menu -->|"invoke helper"| helpers

    ui -->|"invoke CRUD"| database
    ui -->|"invoke export"| exportador
    ui -->|"invoke log"| historialLogic
    ui -->|"invoke helper"| helpers

    %% Config to Business Logic
    config -->|provides paths| database
    config -->|provides paths| exportador
    config -->|provides paths| historialLogic

    %% Business Logic to Data
    database -->|read/write| clientesCSV
    exportador -->|read model/write| clientesCSV
    historialLogic -->|append| historialLog

    %% Tests to Logic and Test Data
    testDB -->|test CRUD| database
    testDB -->|uses| clientesTest

    %% Styles
    classDef presentation fill:#cce5ff,stroke:#333,stroke-width:1px;
    classDef logic fill:#d4edda,stroke:#333,stroke-width:1px;
    classDef data fill:#fff3cd,stroke:#333,stroke-width:1px;
    classDef configTests fill:#e2e3e5,stroke:#333,stroke-width:1px;

    class menu,ui presentation;
    class database,exportador,historialLogic,helpers logic;
    class clientesCSV,historialLog data;
    class config,testDB,clientesTest configTests;

    %% Click Events
    click main "https://github.com/jhackisneros/gestor_de_clientes/blob/main/main.py"
    click run "https://github.com/jhackisneros/gestor_de_clientes/blob/main/gestor/run.py"
    click menu "https://github.com/jhackisneros/gestor_de_clientes/blob/main/gestor/menu.py"
    click ui "https://github.com/jhackisneros/gestor_de_clientes/blob/main/gestor/ui.py"
    click database "https://github.com/jhackisneros/gestor_de_clientes/blob/main/gestor/database.py"
    click exportador "https://github.com/jhackisneros/gestor_de_clientes/blob/main/gestor/exportador.py"
    click historialLogic "https://github.com/jhackisneros/gestor_de_clientes/blob/main/gestor/historial.py"
    click helpers "https://github.com/jhackisneros/gestor_de_clientes/blob/main/gestor/helpers.py"
    click config "https://github.com/jhackisneros/gestor_de_clientes/blob/main/gestor/config.py"
    click clientesCSV "https://github.com/jhackisneros/gestor_de_clientes/blob/main/clientes.csv"
    click historialLog "https://github.com/jhackisneros/gestor_de_clientes/blob/main/historial.log"
    click testDB "https://github.com/jhackisneros/gestor_de_clientes/blob/main/tests/test_database.py"
    click clientesTest "https://github.com/jhackisneros/gestor_de_clientes/blob/main/tests/clientes_test.csv"
```
