# jorgenio/pandasoft architecture

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

- Interactive diagram: https://gitdiagram.com/jorgenio/pandasoft
- Repository: https://github.com/jorgenio/pandasoft

## Overview

#### Purpose and entry point
PandaSoft is a desktop business-management application, likely for branch, warehouse, product, employee, user, consignment, and sales operations. The Qt application starts in `main.cpp`, with the main application window/controller represented by `pandasoft.cpp`, `pandasoft.h`, and `pandasoft.ui`.

#### Qt desktop composition
The repository is a Qt Widgets project: each major screen is implemented as a C++ class paired with a Qt Designer form. The build/resource boundary is defined by `pandasoft.pro` and `pandasoft.qrc`. UI behavior is therefore event-driven through widget actions, dialogs, and screen navigation rather than an HTTP or service API.

#### Main operational modules
Management (“g*”) screens form the primary operational workspace:
- Sales: `gventas.cpp`, `gventas.h`, `gventas.ui`
- Inventory/warehouse: `galmacen.cpp`, `galmacen.h`, `galmacen.ui`
- Consignments and recipients: `gconsignaciones.cpp`, `gconsignatarios.cpp`
- Product, employee, branch, zone, and user administration: `gproductos.cpp`, `gempleados.cpp`, `gsucursal.cpp`, `gzonas.cpp`, `gusuarios.cpp`

These modules likely coordinate listing, selection, and navigation into entity-editing dialogs.

#### Entity editing boundary
Entity-specific editor dialogs (“e*”) isolate create/update workflows from management screens. Core examples are `eproducto.cpp`, `eempleado.cpp`, `esucursal.cpp`, `eusuario.cpp`, `ezona.cpp`, and `econsignatarios.cpp`. `dventas.cpp` is the specialized sales-detail/editing workflow. This is the principal boundary where user-entered form state is validated and persisted.

#### Data access and persistence
`database.h` is the repository’s explicit persistence integration point and should be treated as the shared database contract. UI modules appear to access business records directly through this layer; no separate domain-model, API-server, or migration layer is visible in the tree. Database lifecycle, query ownership, and error propagation should be traced from `database.h` into `pandasoft.cpp` and the `g*`/`e*` modules before modifying data behavior.

#### Reporting and document output
Reporting is a distinct subsystem rather than part of the transactional screens. `greportes.cpp` provides report selection or orchestration, while report-specific views include `ralmacen.cpp`, `rventas.cpp`, `rconsignaciones.cpp`, and entity reports such as `rproducto.cpp`, `rempleado.cpp`, and `rsucursal.cpp`. `tdpreviewdialog.cpp` supplies a preview-dialog boundary for rendered report/document output.

#### Cross-cutting UI services
`mensajebox.cpp` centralizes application messaging/confirmation behavior and is likely used for validation failures and operation feedback. `aboutpandasoft.cpp` provides application metadata/about presentation. These should remain UI services, not persistence or business-operation owners.

Main entry points: [`database.h`](https://github.com/jorgenio/pandasoft/blob/master/database.h) (Database contract), [`pandasoft.cpp`](https://github.com/jorgenio/pandasoft/blob/master/pandasoft.cpp) (Main window), [`greportes.cpp`](https://github.com/jorgenio/pandasoft/blob/master/greportes.cpp) (Report selection), [`eproducto.cpp`](https://github.com/jorgenio/pandasoft/blob/master/eproducto.cpp) (Entity editor dialogs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_build["Qt build &amp; resources<br/>Qt project<br/>[pandasoft.pro]"]
  node_entry["Application entry<br/>Qt entry point<br/>[main.cpp]"]
  node_shell["Main window<br/>Qt widget controller<br/>[pandasoft.cpp]"]
  node_messages["Message service<br/>UI feedback<br/>[mensajebox.cpp]"]
  node_about["About dialog<br/>UI dialog<br/>[aboutpandasoft.cpp]"]
end

subgraph group_operations["Operations workspace"]
  node_sales["Sales management<br/>operational screen<br/>[gventas.cpp]"]
  node_inventory["Warehouse management<br/>operational screen<br/>[galmacen.cpp]"]
  node_consignments["Consignments management<br/>operational screen"]
  node_recipients["Recipients management<br/>operational screen"]
  node_administration["Master-data management<br/>operational screens<br/>[gproductos.cpp]"]
end

subgraph group_editing["Entity editing"]
  node_sales_detail["Sales detail editor<br/>specialized edit workflow<br/>[dventas.cpp]"]
  node_entity_editors["Entity editor dialogs<br/>create/update dialogs<br/>[eproducto.cpp]"]
end

subgraph group_reporting["Reporting"]
  node_report_hub["Report selection<br/>report orchestrator<br/>[greportes.cpp]"]
  node_inventory_report["Warehouse report<br/>report view<br/>[ralmacen.cpp]"]
  node_sales_report["Sales report<br/>report view<br/>[rventas.cpp]"]
  node_consignments_report["Consignments report<br/>report view"]
  node_entity_reports["Entity reports<br/>report views<br/>[rproducto.cpp]"]
  node_preview["Document preview<br/>preview dialog"]
end

node_database[("Database contract<br/>persistence integration<br/>[database.h]")]

node_build -->|"builds"| node_entry
node_entry -->|"starts"| node_shell
node_shell -->|"initializes access"| node_database
node_shell -->|"navigates to"| node_sales
node_shell -->|"navigates to"| node_inventory
node_shell -->|"navigates to"| node_consignments
node_shell -->|"navigates to"| node_recipients
node_shell -->|"navigates to"| node_administration
node_shell -->|"opens"| node_report_hub
node_shell -->|"opens"| node_about
node_sales -->|"edits sale"| node_sales_detail
node_administration -->|"opens editors"| node_entity_editors
node_recipients -->|"opens editor"| node_entity_editors
node_sales -->|"reads and writes"| node_database
node_inventory -->|"reads and writes"| node_database
node_consignments -->|"reads and writes"| node_database
node_recipients -->|"reads and writes"| node_database
node_administration -->|"reads and writes"| node_database
node_sales_detail -->|"persists sale details"| node_database
node_entity_editors -->|"validates and persists"| node_database
node_report_hub -->|"selects"| node_inventory_report
node_report_hub -->|"selects"| node_sales_report
node_report_hub -->|"selects"| node_consignments_report
node_report_hub -->|"selects"| node_entity_reports
node_inventory_report -->|"queries"| node_database
node_sales_report -->|"queries"| node_database
node_consignments_report -->|"queries"| node_database
node_entity_reports -->|"queries"| node_database
node_inventory_report -->|"renders to"| node_preview
node_sales_report -->|"renders to"| node_preview
node_consignments_report -->|"renders to"| node_preview
node_entity_reports -->|"renders to"| node_preview
node_entity_editors -.->|"shows validation feedback"| node_messages
node_sales_detail -.->|"shows operation feedback"| node_messages

click node_build "https://github.com/jorgenio/pandasoft/blob/master/pandasoft.pro"
click node_entry "https://github.com/jorgenio/pandasoft/blob/master/main.cpp"
click node_shell "https://github.com/jorgenio/pandasoft/blob/master/pandasoft.cpp"
click node_database "https://github.com/jorgenio/pandasoft/blob/master/database.h"
click node_messages "https://github.com/jorgenio/pandasoft/blob/master/mensajebox.cpp"
click node_about "https://github.com/jorgenio/pandasoft/blob/master/aboutpandasoft.cpp"
click node_sales "https://github.com/jorgenio/pandasoft/blob/master/gventas.cpp"
click node_inventory "https://github.com/jorgenio/pandasoft/blob/master/galmacen.cpp"
click node_consignments "https://github.com/jorgenio/pandasoft/blob/master/gconsignaciones.cpp"
click node_recipients "https://github.com/jorgenio/pandasoft/blob/master/gconsignatarios.cpp"
click node_administration "https://github.com/jorgenio/pandasoft/blob/master/gproductos.cpp"
click node_sales_detail "https://github.com/jorgenio/pandasoft/blob/master/dventas.cpp"
click node_entity_editors "https://github.com/jorgenio/pandasoft/blob/master/eproducto.cpp"
click node_report_hub "https://github.com/jorgenio/pandasoft/blob/master/greportes.cpp"
click node_inventory_report "https://github.com/jorgenio/pandasoft/blob/master/ralmacen.cpp"
click node_sales_report "https://github.com/jorgenio/pandasoft/blob/master/rventas.cpp"
click node_consignments_report "https://github.com/jorgenio/pandasoft/blob/master/rconsignaciones.cpp"
click node_entity_reports "https://github.com/jorgenio/pandasoft/blob/master/rproducto.cpp"
click node_preview "https://github.com/jorgenio/pandasoft/blob/master/tdpreviewdialog.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_build,node_entry,node_shell,node_messages,node_about toneBlue
class node_sales,node_inventory,node_consignments,node_recipients,node_administration toneAmber
class node_sales_detail,node_entity_editors toneMint
class node_report_hub,node_inventory_report,node_sales_report,node_consignments_report,node_entity_reports,node_preview toneRose
class node_database toneNeutral
```

## Components

### Application shell

- [Qt build & resources](https://github.com/jorgenio/pandasoft/blob/master/pandasoft.pro): Qt project · Defines application build inputs and bundled resources. · `pandasoft.pro`
- [Application entry](https://github.com/jorgenio/pandasoft/blob/master/main.cpp): Qt entry point · `main.cpp`
- [Main window](https://github.com/jorgenio/pandasoft/blob/master/pandasoft.cpp): Qt widget controller · Hosts navigation and database lifecycle coordination. · `pandasoft.cpp`
- [Message service](https://github.com/jorgenio/pandasoft/blob/master/mensajebox.cpp): UI feedback · `mensajebox.cpp`
- [About dialog](https://github.com/jorgenio/pandasoft/blob/master/aboutpandasoft.cpp): UI dialog · `aboutpandasoft.cpp`

### Operations workspace

- [Sales management](https://github.com/jorgenio/pandasoft/blob/master/gventas.cpp): operational screen · `gventas.cpp`
- [Warehouse management](https://github.com/jorgenio/pandasoft/blob/master/galmacen.cpp): operational screen · `galmacen.cpp`
- [Consignments management](https://github.com/jorgenio/pandasoft/blob/master/gconsignaciones.cpp): operational screen · `gconsignaciones.cpp`
- [Recipients management](https://github.com/jorgenio/pandasoft/blob/master/gconsignatarios.cpp): operational screen · `gconsignatarios.cpp`
- [Master-data management](https://github.com/jorgenio/pandasoft/blob/master/gproductos.cpp): operational screens · Products, employees, branches, zones, and users. · `gproductos.cpp`

### Entity editing

- [Sales detail editor](https://github.com/jorgenio/pandasoft/blob/master/dventas.cpp): specialized edit workflow · `dventas.cpp`
- [Entity editor dialogs](https://github.com/jorgenio/pandasoft/blob/master/eproducto.cpp): create/update dialogs · Product, employee, branch, user, zone, and recipient forms. · `eproducto.cpp`

### Reporting

- [Report selection](https://github.com/jorgenio/pandasoft/blob/master/greportes.cpp): report orchestrator · `greportes.cpp`
- [Warehouse report](https://github.com/jorgenio/pandasoft/blob/master/ralmacen.cpp): report view · `ralmacen.cpp`
- [Sales report](https://github.com/jorgenio/pandasoft/blob/master/rventas.cpp): report view · `rventas.cpp`
- [Consignments report](https://github.com/jorgenio/pandasoft/blob/master/rconsignaciones.cpp): report view · `rconsignaciones.cpp`
- [Entity reports](https://github.com/jorgenio/pandasoft/blob/master/rproducto.cpp): report views · Product, employee, and branch report views. · `rproducto.cpp`
- [Document preview](https://github.com/jorgenio/pandasoft/blob/master/tdpreviewdialog.cpp): preview dialog · Displays rendered report or document output. · `tdpreviewdialog.cpp`

### Other components

- [Database contract](https://github.com/jorgenio/pandasoft/blob/master/database.h): persistence integration · Shared UI-facing database access boundary. · `database.h`

## Connections

- Qt build & resources → Application entry: builds
- Application entry → Main window: starts
- Main window → Database contract: initializes access
- Main window → Sales management: navigates to
- Main window → Warehouse management: navigates to
- Main window → Consignments management: navigates to
- Main window → Recipients management: navigates to
- Main window → Master-data management: navigates to
- Main window → Report selection: opens
- Main window → About dialog: opens
- Sales management → Sales detail editor: edits sale
- Master-data management → Entity editor dialogs: opens editors
- Recipients management → Entity editor dialogs: opens editor
- Sales management → Database contract: reads and writes
- Warehouse management → Database contract: reads and writes
- Consignments management → Database contract: reads and writes
- Recipients management → Database contract: reads and writes
- Master-data management → Database contract: reads and writes
- Sales detail editor → Database contract: persists sale details
- Entity editor dialogs → Database contract: validates and persists
- Report selection → Warehouse report: selects
- Report selection → Sales report: selects
- Report selection → Consignments report: selects
- Report selection → Entity reports: selects
- Warehouse report → Database contract: queries
- Sales report → Database contract: queries
- Consignments report → Database contract: queries
- Entity reports → Database contract: queries
- Warehouse report → Document preview: renders to
- Sales report → Document preview: renders to
- Consignments report → Document preview: renders to
- Entity reports → Document preview: renders to
- Entity editor dialogs → Message service: shows validation feedback
- Sales detail editor → Message service: shows operation feedback
