# ingelibre/ingepresupuestos architecture

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

- Interactive diagram: https://gitdiagram.com/ingelibre/ingepresupuestos
- Repository: https://github.com/ingelibre/ingepresupuestos

## Overview

IngePresupuestos is a native desktop application for preparing civil-works budgets and managing project execution. Users open or create a project, build hierarchical budgets and editable unit-cost analyses from reusable resources, then plan schedules or track site operations. They can import existing project data, calculate INEI-based price adjustments, and export configurable reports. Tuxia adds local project analysis, semantic suggestions and optional hosted AI. The README documents these capabilities; sampled source confirms SQLite-backed project data, the embedding search and report-export behavior, but not every UI-to-backend call, so uncertain links are omitted.

Main entry points: [`views/metrados_view.py`](https://github.com/ingelibre/ingepresupuestos/blob/main/views/metrados_view.py) (Budget editor), [`views/control_obra_view.py`](https://github.com/ingelibre/ingepresupuestos/blob/main/views/control_obra_view.py) (Site control), [`views/ia_view.py`](https://github.com/ingelibre/ingepresupuestos/blob/main/views/ia_view.py) (Tuxia interface), [`views/proyecto_view.py`](https://github.com/ingelibre/ingepresupuestos/blob/main/views/proyecto_view.py) (Project workspace)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["Desktop application"]
  node_entry["Application entry<br/>[main.py]"]
  node_main_window["Main window<br/>[main_window.py]"]
end

subgraph group_budgeting["Project budgeting"]
  node_project["Project workspace<br/>[proyecto_view.py]"]
  node_project_data["Project data<br/>[obra_crud.py]"]
  node_database[("SQLite database<br/>[database.py]")]
  node_budget_ui["Budget editor<br/>[metrados_view.py]"]
  node_acu_table["Unit-cost analysis<br/>[acu_table.py]"]
  node_resource_ui["Resource catalog<br/>[recursos_view.py]"]
  node_library_ui["Cost library<br/>[biblioteca_view.py]"]
end

subgraph group_planning["Planning and control"]
  node_schedule_ui["Schedule planning<br/>[cronograma_view.py]"]
  node_schedule_engine["Schedule calculations<br/>[cronograma.py]"]
  node_curve["S-curve analysis<br/>[curva_s.py]"]
  node_site_ui["Site control"]
  node_requirements["Site requirements<br/>[requerimientos.py]"]
  node_warehouse["Warehouse and ledger<br/>[almacen.py]"]
  node_valuations["Progress valuations<br/>[valorizacion.py]"]
  node_formula["Price adjustment"]
  node_indices["INEI indices<br/>[indices_inei.py]"]
end

subgraph group_exchange["Imports and reports"]
  node_import_ui["Import workspace<br/>[importar_view.py]"]
  node_importers["Project importers<br/>[importer.py]"]
  node_msproject["MS Project exchange"]
  node_reports_ui["Report center<br/>[reportes_view.py]"]
  node_report_engines["Report generation<br/>[pdf_reports.py]"]
  node_exporter["Data export<br/>[exporter.py]"]
end

subgraph group_assistant["Tuxia assistant"]
  node_ai_ui["Tuxia interface<br/>[ia_view.py]"]
  node_local_ai["Local project analysis<br/>[asistente_local.py]"]
  node_ai_specs["Part suggestion<br/>[ai_specs.py]"]
  node_embeddings["Semantic search"]
end

node_engineer(("Project engineer"))
node_ai_providers{{"Hosted AI providers"}}

node_engineer -->|"launches"| node_entry
node_entry -->|"opens"| node_main_window
node_main_window -->|"opens project"| node_project
node_project -->|"manages"| node_project_data
node_project_data -->|"reads and writes"| node_database
node_project -->|"edits budget"| node_budget_ui
node_budget_ui -->|"edits analysis"| node_acu_table
node_budget_ui -->|"uses resources"| node_resource_ui
node_budget_ui -->|"reuses costs"| node_library_ui
node_schedule_ui -->|"calculates schedule"| node_schedule_engine
node_schedule_ui -->|"shows curve"| node_curve
node_site_ui -->|"manages needs"| node_requirements
node_site_ui -->|"tracks stock"| node_warehouse
node_site_ui -->|"records progress"| node_valuations
node_valuations -->|"applies adjustment"| node_formula
node_formula -->|"uses indices"| node_indices
node_import_ui -->|"imports projects"| node_importers
node_import_ui -->|"syncs schedule"| node_msproject
node_reports_ui -->|"generates reports"| node_report_engines
node_reports_ui -->|"exports data"| node_exporter
node_ai_ui -->|"analyzes project"| node_local_ai
node_ai_ui -->|"suggests items"| node_ai_specs
node_ai_specs -->|"searches semantically"| node_embeddings
node_ai_ui -.->|"sends prompts"| node_ai_providers

click node_entry "https://github.com/ingelibre/ingepresupuestos/blob/main/main.py"
click node_main_window "https://github.com/ingelibre/ingepresupuestos/blob/main/views/main_window.py"
click node_project "https://github.com/ingelibre/ingepresupuestos/blob/main/views/proyecto_view.py"
click node_project_data "https://github.com/ingelibre/ingepresupuestos/blob/main/core/obra_crud.py"
click node_database "https://github.com/ingelibre/ingepresupuestos/blob/main/core/database.py"
click node_budget_ui "https://github.com/ingelibre/ingepresupuestos/blob/main/views/metrados_view.py"
click node_acu_table "https://github.com/ingelibre/ingepresupuestos/blob/main/widgets/acu_table.py"
click node_resource_ui "https://github.com/ingelibre/ingepresupuestos/blob/main/views/recursos_view.py"
click node_library_ui "https://github.com/ingelibre/ingepresupuestos/blob/main/views/biblioteca_view.py"
click node_schedule_ui "https://github.com/ingelibre/ingepresupuestos/blob/main/views/cronograma_view.py"
click node_schedule_engine "https://github.com/ingelibre/ingepresupuestos/blob/main/core/cronograma.py"
click node_curve "https://github.com/ingelibre/ingepresupuestos/blob/main/core/curva_s.py"
click node_site_ui "https://github.com/ingelibre/ingepresupuestos/blob/main/views/control_obra_view.py"
click node_requirements "https://github.com/ingelibre/ingepresupuestos/blob/main/core/requerimientos.py"
click node_warehouse "https://github.com/ingelibre/ingepresupuestos/blob/main/core/almacen.py"
click node_valuations "https://github.com/ingelibre/ingepresupuestos/blob/main/core/valorizacion.py"
click node_formula "https://github.com/ingelibre/ingepresupuestos/blob/main/core/formula_polinomica.py"
click node_indices "https://github.com/ingelibre/ingepresupuestos/blob/main/core/indices_inei.py"
click node_import_ui "https://github.com/ingelibre/ingepresupuestos/blob/main/views/importar_view.py"
click node_importers "https://github.com/ingelibre/ingepresupuestos/blob/main/core/importer.py"
click node_msproject "https://github.com/ingelibre/ingepresupuestos/blob/main/core/msproject_importer.py"
click node_reports_ui "https://github.com/ingelibre/ingepresupuestos/blob/main/views/reportes_view.py"
click node_report_engines "https://github.com/ingelibre/ingepresupuestos/blob/main/core/pdf_reports.py"
click node_exporter "https://github.com/ingelibre/ingepresupuestos/blob/main/core/exporter.py"
click node_ai_ui "https://github.com/ingelibre/ingepresupuestos/blob/main/views/ia_view.py"
click node_local_ai "https://github.com/ingelibre/ingepresupuestos/blob/main/core/asistente_local.py"
click node_ai_specs "https://github.com/ingelibre/ingepresupuestos/blob/main/core/ai_specs.py"
click node_embeddings "https://github.com/ingelibre/ingepresupuestos/blob/main/core/biblioteca_embeddings.py"

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_entry,node_main_window toneBlue
class node_project,node_project_data,node_database,node_budget_ui,node_acu_table,node_resource_ui,node_library_ui toneAmber
class node_schedule_ui,node_schedule_engine,node_curve,node_site_ui,node_requirements,node_warehouse,node_valuations,node_formula,node_indices toneMint
class node_import_ui,node_importers,node_msproject,node_reports_ui,node_report_engines,node_exporter toneRose
class node_ai_ui,node_local_ai,node_ai_specs,node_embeddings,node_engineer,node_ai_providers toneIndigo
```

## Components

### Desktop application

- [Application entry](https://github.com/ingelibre/ingepresupuestos/blob/main/main.py): `main.py`
- [Main window](https://github.com/ingelibre/ingepresupuestos/blob/main/views/main_window.py): `views/main_window.py`

### Project budgeting

- [Project workspace](https://github.com/ingelibre/ingepresupuestos/blob/main/views/proyecto_view.py): `views/proyecto_view.py`
- [Project data](https://github.com/ingelibre/ingepresupuestos/blob/main/core/obra_crud.py): `core/obra_crud.py`
- [SQLite database](https://github.com/ingelibre/ingepresupuestos/blob/main/core/database.py): `core/database.py`
- [Budget editor](https://github.com/ingelibre/ingepresupuestos/blob/main/views/metrados_view.py): `views/metrados_view.py`
- [Unit-cost analysis](https://github.com/ingelibre/ingepresupuestos/blob/main/widgets/acu_table.py): `widgets/acu_table.py`
- [Resource catalog](https://github.com/ingelibre/ingepresupuestos/blob/main/views/recursos_view.py): `views/recursos_view.py`
- [Cost library](https://github.com/ingelibre/ingepresupuestos/blob/main/views/biblioteca_view.py): `views/biblioteca_view.py`

### Planning and control

- [Schedule planning](https://github.com/ingelibre/ingepresupuestos/blob/main/views/cronograma_view.py): `views/cronograma_view.py`
- [Schedule calculations](https://github.com/ingelibre/ingepresupuestos/blob/main/core/cronograma.py): `core/cronograma.py`
- [S-curve analysis](https://github.com/ingelibre/ingepresupuestos/blob/main/core/curva_s.py): `core/curva_s.py`
- [Site control](https://github.com/ingelibre/ingepresupuestos/blob/main/views/control_obra_view.py): `views/control_obra_view.py`
- [Site requirements](https://github.com/ingelibre/ingepresupuestos/blob/main/core/requerimientos.py): `core/requerimientos.py`
- [Warehouse and ledger](https://github.com/ingelibre/ingepresupuestos/blob/main/core/almacen.py): `core/almacen.py`
- [Progress valuations](https://github.com/ingelibre/ingepresupuestos/blob/main/core/valorizacion.py): `core/valorizacion.py`
- [Price adjustment](https://github.com/ingelibre/ingepresupuestos/blob/main/core/formula_polinomica.py): `core/formula_polinomica.py`
- [INEI indices](https://github.com/ingelibre/ingepresupuestos/blob/main/core/indices_inei.py): `core/indices_inei.py`

### Imports and reports

- [Import workspace](https://github.com/ingelibre/ingepresupuestos/blob/main/views/importar_view.py): `views/importar_view.py`
- [Project importers](https://github.com/ingelibre/ingepresupuestos/blob/main/core/importer.py): `core/importer.py`
- [MS Project exchange](https://github.com/ingelibre/ingepresupuestos/blob/main/core/msproject_importer.py): `core/msproject_importer.py`
- [Report center](https://github.com/ingelibre/ingepresupuestos/blob/main/views/reportes_view.py): `views/reportes_view.py`
- [Report generation](https://github.com/ingelibre/ingepresupuestos/blob/main/core/pdf_reports.py): `core/pdf_reports.py`
- [Data export](https://github.com/ingelibre/ingepresupuestos/blob/main/core/exporter.py): `core/exporter.py`

### Tuxia assistant

- [Tuxia interface](https://github.com/ingelibre/ingepresupuestos/blob/main/views/ia_view.py): `views/ia_view.py`
- [Local project analysis](https://github.com/ingelibre/ingepresupuestos/blob/main/core/asistente_local.py): `core/asistente_local.py`
- [Part suggestion](https://github.com/ingelibre/ingepresupuestos/blob/main/core/ai_specs.py): `core/ai_specs.py`
- [Semantic search](https://github.com/ingelibre/ingepresupuestos/blob/main/core/biblioteca_embeddings.py): `core/biblioteca_embeddings.py`

### Other components

- **Project engineer**
- **Hosted AI providers**

## Connections

- Project engineer → Application entry: launches
- Application entry → Main window: opens
- Main window → Project workspace: opens project
- Project workspace → Project data: manages
- Project data → SQLite database: reads and writes
- Project workspace → Budget editor: edits budget
- Budget editor → Unit-cost analysis: edits analysis
- Budget editor → Resource catalog: uses resources
- Budget editor → Cost library: reuses costs
- Schedule planning → Schedule calculations: calculates schedule
- Schedule planning → S-curve analysis: shows curve
- Site control → Site requirements: manages needs
- Site control → Warehouse and ledger: tracks stock
- Site control → Progress valuations: records progress
- Progress valuations → Price adjustment: applies adjustment
- Price adjustment → INEI indices: uses indices
- Import workspace → Project importers: imports projects
- Import workspace → MS Project exchange: syncs schedule
- Report center → Report generation: generates reports
- Report center → Data export: exports data
- Tuxia interface → Local project analysis: analyzes project
- Tuxia interface → Part suggestion: suggests items
- Part suggestion → Semantic search: searches semantically
- Tuxia interface → Hosted AI providers: sends prompts
