# stredes/exelcior_apolo architecture

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

- Interactive diagram: https://gitdiagram.com/stredes/exelcior_apolo
- Repository: https://github.com/stredes/exelcior_apolo

## Overview

##### Project type and purpose
- Exelcior Apolo is a cross-platform, desktop Python application with a graphical UI (Tkinter) that automates Excel file transformation, validation, preview and printing. It supports multiple “modes” (FedEx, Urbano, Listados, Inventario, Etiquetas), persists history in SQLite, and invokes platform-specific printer services (Excel COM on Windows, LibreOffice on Linux/macOS).

##### File structure
- Top-level:
- app/: contains all application code, subdivided into
– config/: configuration loading/editing, JSON defaults
– core/: Excel processing, transformation rules, logging events
– db/: SQLAlchemy models, DB connection, SQLite file
– gui/: Tkinter windows and dialogs per mode
– printer/: mode-specific print/export logic and platform drivers
– services/: file detection/auto-load routines
– utils/: path, platform detection, logger setup, validations
- main_app.py & run_app.py: bootstrap the application
- assets/version: versioning metadata
- data/: packaged SQLite DB, JSON
- installer/: Inno Setup definitions, output installers
- build & spec files: packaging scripts
- tests/: pytest files testing printer modules and dry-runs
- requirements.txt: dependencies

##### README for additional insights
- Architecture hints:
- Modular modes — each mode as independent component
- Persistence layer via SQLAlchemy + SQLite
- Excel processing via pandas/openpyxl
- Printing via external services (Excel COM, LibreOffice)
- Preview + export to PDF (ReportLab)

##### Elements
- Green for core processing modules
- Orange for persistence
- Gray for external dependencies/services

##### Detail-level advice
- Explicitly show the branching to Excel COM vs. LibreOffice based on platform_utils
- Config JSON file location and how Config Manager abstracts it

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Bootstrap
    Bootstrap["Application Bootstrap\n(main_app.py, run_app.py)"]:::external

    %% User Interface
    subgraph "User Interface Layer"
        UI["User Interface\n(Tkinter)"]:::ui
    end

    %% Configuration Manager
    Config["Configuration Manager\n(JSON settings)"]:::config

    %% File Service / Auto-Loader
    FS["File Service\n(Auto-loader)"]:::service

    %% Core Processor
    Core["Core Processor\n(pandas/openpyxl)"]:::core

    %% Mode Handlers
    subgraph "Mode Handlers (Strategy Pattern)"
        FedEx["FedEx Mode"]:::service
        Urbano["Urbano Mode"]:::service
        Listados["Listados Mode"]:::service
        InventarioCod["Inventario by Code"]:::service
        InventarioUbic["Inventario by Location"]:::service
        Etiquetas["Etiquetas Mode"]:::service
    end

    %% Printing & Export Services
    Printers["Printing & Export Services\n(Excel COM, LibreOffice, PDF)"]:::external

    %% Persistence Layer
    DB["Persistence Layer\n(SQLAlchemy + SQLite)"]:::db

    %% Logging Subsystem
    Log["Logging Subsystem"]:::util

    %% Utilities
    Utils["Utilities\n(path, platform, validation)"]:::util

    %% Relationships
    Bootstrap --> UI
    UI --> Config
    UI --> FS
    FS --> Core
    Config --> Core
    Core -->|"DataFrame + mode config"| FedEx
    Core -->|"DataFrame + mode config"| Urbano
    Core -->|"DataFrame + mode config"| Listados
    Core -->|"DataFrame + mode config"| InventarioCod
    Core -->|"DataFrame + mode config"| InventarioUbic
    Core -->|"DataFrame + mode config"| Etiquetas
    FedEx -->|"transformed DataFrame"| Core
    Urbano --> Core
    Listados --> Core
    InventarioCod --> Core
    InventarioUbic --> Core
    Etiquetas --> Core
    Core --> Printers
    Core --> DB
    Bootstrap --> Utils
    UI --> Log
    Config --> Log
    FS --> Log
    Core --> Log
    Printers --> Log
    DB --> Log
    Utils -.-> UI
    Utils -.-> Config
    Utils -.-> FS
    Utils -.-> Core
    Utils -.-> FedEx
    Utils -.-> Printers
    Utils -.-> DB

    %% Click Events
    click Bootstrap "https://github.com/stredes/exelcior_apolo/blob/main/app/main_app.py"
    click UI "https://github.com/stredes/exelcior_apolo/tree/main/app/gui/"
    click Config "https://github.com/stredes/exelcior_apolo/tree/main/app/config/"
    click FS "https://github.com/stredes/exelcior_apolo/blob/main/app/services/file_service.py"
    click Core "https://github.com/stredes/exelcior_apolo/blob/main/app/core/excel_processor.py"
    click FedEx "https://github.com/stredes/exelcior_apolo/blob/main/app/printer/printer_fedex.py"
    click Urbano "https://github.com/stredes/exelcior_apolo/blob/main/app/printer/printer_urbano.py"
    click Listados "https://github.com/stredes/exelcior_apolo/blob/main/app/printer/printer_listados.py"
    click InventarioCod "https://github.com/stredes/exelcior_apolo/blob/main/app/printer/printer_inventario_codigo.py"
    click InventarioUbic "https://github.com/stredes/exelcior_apolo/blob/main/app/printer/printer_inventario_ubicacion.py"
    click Etiquetas "https://github.com/stredes/exelcior_apolo/blob/main/app/printer/printer_etiquetas.py"
    click Printers "https://github.com/stredes/exelcior_apolo/tree/main/app/printer/"
    click DB "https://github.com/stredes/exelcior_apolo/blob/main/app/db/models.py"
    click Log "https://github.com/stredes/exelcior_apolo/blob/main/app/utils/logger_setup.py"
    click Utils "https://github.com/stredes/exelcior_apolo/blob/main/app/utils/paths.py"

    classDef ui fill:#D6EAF8,stroke:#21618C,color:#1B4F72
    classDef core fill:#ABEBC6,stroke:#196F3D,color:#145A32
    classDef db fill:#FAD7A0,stroke:#B9770E,color:#7E5109
    classDef external fill:#D5DBDB,stroke:#616A6B,color:#1C2833
    classDef config fill:#AED6F1,stroke:#1A5276,color:#154360
    classDef service fill:#F5B7B1,stroke:#AF601A,color:#7D6608
    classDef util fill:#D2B4DE,stroke:#6C3483,color:#4A235A
```
