# pollolopez/micasa architecture

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

- Interactive diagram: https://gitdiagram.com/pollolopez/micasa
- Repository: https://github.com/pollolopez/micasa

## Overview

Loft Calculator is a browser app for configuring a loft’s dimensions, openings, materials, and colors, then visualizing the structure and estimating materials and cost. The main workflow runs from the editor in App through validation and structure generation; that shared structure feeds the 3D viewer and budget calculation. Users can also save and restore project files. The graph includes the calculation and UI layers visible in excerpts; links based only on the source index are limited to its stated references, and unsampled capabilities are not expanded into unverified flows.

Main entry points: [`loft-calculator/src/App.jsx`](https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/App.jsx) (App), [`loft-calculator/src/motor/validacion.js`](https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/motor/validacion.js) (Validation), [`loft-calculator/src/componentes/PanelAberturas.jsx`](https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/componentes/PanelAberturas.jsx) (Opening editor), [`loft-calculator/src/LoftCanvas.jsx`](https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/LoftCanvas.jsx) (3D viewer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Configuration UI"]
  node_app["App<br/>[App.jsx]"]
  node_number["Numeric input<br/>[CampoNumero.jsx]"]
  node_openings["Opening editor<br/>[PanelAberturas.jsx]"]
  node_side["Side selector<br/>[SelectorLado.jsx]"]
  node_estimate["Budget table"]
  node_canvas["3D viewer<br/>[LoftCanvas.jsx]"]
end

subgraph group_engine["Design and estimating"]
  node_layers["Viewer layers<br/>[capas.js]"]
  node_initial["Initial parameters"]
  node_constants["System constants<br/>[constantes.js]"]
  node_geometry["Geometry<br/>[geometria.js]"]
  node_validation["Validation<br/>[validacion.js]"]
  node_structure["Structure generator<br/>[estructura.js]"]
  node_budget["Budget calculator<br/>[presupuesto.js]"]
  node_cuts["Cut optimizer"]
end

subgraph group_project["Project persistence"]
  node_saved["Browser state"]
  node_projectfile["Project files<br/>[archivoProyecto.js]"]
end

node_user(("User"))

node_user -.->|"configures"| node_app
node_app -->|"persists state"| node_saved
node_app -->|"loads defaults"| node_initial
node_app -->|"validates inputs"| node_validation
node_app -->|"generates structure"| node_structure
node_app -->|"calculates estimate"| node_budget
node_app -->|"renders viewer"| node_canvas
node_app -->|"renders fields"| node_number
node_app -->|"renders selectors"| node_side
node_app -->|"renders editor"| node_openings
node_app -->|"renders table"| node_estimate
node_app -->|"handles project files"| node_projectfile
node_openings -->|"checks openings"| node_validation
node_openings -->|"renders fields"| node_number
node_openings -->|"renders selector"| node_side
node_side -->|"labels sides"| node_geometry
node_side -->|"uses side list"| node_constants
node_structure -->|"computes positions"| node_geometry
node_structure -->|"locates openings"| node_validation
node_validation -->|"checks dimensions"| node_geometry
node_budget -->|"optimizes cuts"| node_cuts
node_canvas -->|"positions model"| node_geometry
node_canvas -->|"positions openings"| node_structure
node_canvas -->|"uses layer settings"| node_layers
node_projectfile -->|"validates imports"| node_validation
node_projectfile -->|"validates colors"| node_layers

click node_app "https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/App.jsx"
click node_number "https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/componentes/CampoNumero.jsx"
click node_openings "https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/componentes/PanelAberturas.jsx"
click node_side "https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/componentes/SelectorLado.jsx"
click node_estimate "https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/componentes/TablaPresupuesto.jsx"
click node_canvas "https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/LoftCanvas.jsx"
click node_saved "https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/hooks/useEstadoGuardado.js"
click node_layers "https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/capas.js"
click node_initial "https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/motor/parametrosIniciales.js"
click node_constants "https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/motor/constantes.js"
click node_geometry "https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/motor/geometria.js"
click node_validation "https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/motor/validacion.js"
click node_structure "https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/motor/estructura.js"
click node_budget "https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/motor/presupuesto.js"
click node_cuts "https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/motor/optimizadorCortes.js"
click node_projectfile "https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/proyecto/archivoProyecto.js"

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_app,node_number,node_openings,node_side,node_estimate,node_canvas,node_user toneBlue
class node_layers,node_initial,node_constants,node_geometry,node_validation,node_structure,node_budget,node_cuts toneAmber
class node_saved,node_projectfile toneMint
```

## Components

### Configuration UI

- [App](https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/App.jsx): `loft-calculator/src/App.jsx`
- [Numeric input](https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/componentes/CampoNumero.jsx): `loft-calculator/src/componentes/CampoNumero.jsx`
- [Opening editor](https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/componentes/PanelAberturas.jsx): `loft-calculator/src/componentes/PanelAberturas.jsx`
- [Side selector](https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/componentes/SelectorLado.jsx): `loft-calculator/src/componentes/SelectorLado.jsx`
- [Budget table](https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/componentes/TablaPresupuesto.jsx): `loft-calculator/src/componentes/TablaPresupuesto.jsx`
- [3D viewer](https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/LoftCanvas.jsx): `loft-calculator/src/LoftCanvas.jsx`

### Design and estimating

- [Viewer layers](https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/capas.js): `loft-calculator/src/capas.js`
- [Initial parameters](https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/motor/parametrosIniciales.js): `loft-calculator/src/motor/parametrosIniciales.js`
- [System constants](https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/motor/constantes.js): `loft-calculator/src/motor/constantes.js`
- [Geometry](https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/motor/geometria.js): `loft-calculator/src/motor/geometria.js`
- [Validation](https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/motor/validacion.js): `loft-calculator/src/motor/validacion.js`
- [Structure generator](https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/motor/estructura.js): `loft-calculator/src/motor/estructura.js`
- [Budget calculator](https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/motor/presupuesto.js): `loft-calculator/src/motor/presupuesto.js`
- [Cut optimizer](https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/motor/optimizadorCortes.js): `loft-calculator/src/motor/optimizadorCortes.js`

### Project persistence

- [Browser state](https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/hooks/useEstadoGuardado.js): `loft-calculator/src/hooks/useEstadoGuardado.js`
- [Project files](https://github.com/pollolopez/micasa/blob/main/loft-calculator/src/proyecto/archivoProyecto.js): `loft-calculator/src/proyecto/archivoProyecto.js`

### Other components

- **User**

## Connections

- User → App: configures
- App → Browser state: persists state (evidence: `loft-calculator/src/App.jsx`)
- App → Initial parameters: loads defaults (evidence: `loft-calculator/src/App.jsx`)
- App → Validation: validates inputs (evidence: `loft-calculator/src/App.jsx`)
- App → Structure generator: generates structure (evidence: `loft-calculator/src/App.jsx`)
- App → Budget calculator: calculates estimate (evidence: `loft-calculator/src/App.jsx`)
- App → 3D viewer: renders viewer (evidence: `loft-calculator/src/App.jsx`)
- App → Numeric input: renders fields (evidence: `loft-calculator/src/App.jsx`)
- App → Side selector: renders selectors (evidence: `loft-calculator/src/App.jsx`)
- App → Opening editor: renders editor (evidence: `loft-calculator/src/App.jsx`)
- App → Budget table: renders table (evidence: `loft-calculator/src/App.jsx`)
- App → Project files: handles project files (evidence: `loft-calculator/src/App.jsx`)
- Opening editor → Validation: checks openings (evidence: `loft-calculator/src/componentes/PanelAberturas.jsx`)
- Opening editor → Numeric input: renders fields (evidence: `loft-calculator/src/componentes/PanelAberturas.jsx`)
- Opening editor → Side selector: renders selector (evidence: `loft-calculator/src/componentes/PanelAberturas.jsx`)
- Side selector → Geometry: labels sides (evidence: `loft-calculator/src/componentes/SelectorLado.jsx`)
- Side selector → System constants: uses side list (evidence: `loft-calculator/src/componentes/SelectorLado.jsx`)
- Structure generator → Geometry: computes positions (evidence: `loft-calculator/src/motor/estructura.js`)
- Structure generator → Validation: locates openings (evidence: `loft-calculator/src/motor/estructura.js`)
- Validation → Geometry: checks dimensions (evidence: `loft-calculator/src/motor/validacion.js`)
- Budget calculator → Cut optimizer: optimizes cuts (evidence: `loft-calculator/src/motor/presupuesto.js`)
- 3D viewer → Geometry: positions model (evidence: `loft-calculator/src/LoftCanvas.jsx`)
- 3D viewer → Structure generator: positions openings (evidence: `loft-calculator/src/LoftCanvas.jsx`)
- 3D viewer → Viewer layers: uses layer settings (evidence: `loft-calculator/src/LoftCanvas.jsx`)
- Project files → Validation: validates imports (evidence: `loft-calculator/src/proyecto/archivoProyecto.js`)
- Project files → Viewer layers: validates colors (evidence: `loft-calculator/src/proyecto/archivoProyecto.js`)
