# gonoboben/buoycalc-windows architecture

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

- Interactive diagram: https://gitdiagram.com/gonoboben/buoycalc-windows
- Repository: https://github.com/gonoboben/buoycalc-windows

## Overview

BuoyCalc Windows is an Avalonia desktop engineering application for designing and assessing quasi-static buoy moorings. The main workflow assembles environment, buoy, line and anchor inputs, runs an engineering calculation, derives selected-path design authorities and presents the result in the UI, 2D view, PDF and technical report. The README documents the selected-authority stages and presentation-only rule; excerpts additionally show application-run orchestration and authority projection. Unsampled view-model wiring and solver internals are not asserted beyond documented behavior.

Main entry points: [`ViewModels/MainWindowViewModel.cs`](https://github.com/gonoboben/buoycalc-windows/blob/main/ViewModels/MainWindowViewModel.cs) (Project editor), [`ApplicationModel/CalculationSnapshot.cs`](https://github.com/gonoboben/buoycalc-windows/blob/main/ApplicationModel/CalculationSnapshot.cs) (Run snapshot), [`Services/MooringSelectedEngineeringAssessmentState.cs`](https://github.com/gonoboben/buoycalc-windows/blob/main/Services/MooringSelectedEngineeringAssessmentState.cs) (Engineering assessment), [`ApplicationModel/ApplicationCalculationRunner.cs`](https://github.com/gonoboben/buoycalc-windows/blob/main/ApplicationModel/ApplicationCalculationRunner.cs) (Run coordinator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop workflow"]
  node_main_ui["Project editor"]
  node_sequence["Mooring sequence"]
end

subgraph group_calculation["Engineering calculation"]
  node_runner["Run coordinator"]
  node_validation["Input validation"]
  node_snapshot["Run snapshot"]
  node_geometry["Selected geometry"]
end

subgraph group_authorities["Selected authorities"]
  node_envelope["Design envelope"]
  node_demand["Design tension"]
  node_anchor["Anchor reaction"]
  node_local_demand["Local element demand"]
  node_capacity["Structural capacity"]
  node_assessment["Engineering assessment"]
end

subgraph group_presentation["Results and reports"]
  node_diagram["2D selected shape"]
  node_canvas["2D canvas<br/>[Mooring2DCanvas.cs]"]
  node_pdf["PDF report"]
  node_technical["Technical report"]
end

subgraph group_persistence["Project and libraries"]
  node_project_store[("Project files")]
  node_library[("Element libraries")]
end

node_engineer(("Engineer"))

node_engineer -->|"edits project"| node_main_ui
node_main_ui -.->|"configures sequence"| node_sequence
node_main_ui -.->|"runs calculation"| node_runner
node_runner -->|"validates inputs"| node_validation
node_runner -->|"builds snapshot"| node_snapshot
node_snapshot -->|"selects shape"| node_geometry
node_geometry -.->|"derives demand envelope"| node_envelope
node_envelope -->|"projects tension demand"| node_demand
node_envelope -->|"projects anchor reaction"| node_anchor
node_demand -.->|"informs local demand"| node_local_demand
node_local_demand -->|"projects capacity"| node_capacity
node_demand -->|"informs assessment"| node_assessment
node_anchor -->|"informs assessment"| node_assessment
node_capacity -->|"informs assessment"| node_assessment
node_snapshot -.->|"projects selected shape"| node_diagram
node_diagram -->|"renders diagram"| node_canvas
node_snapshot -.->|"supplies report data"| node_pdf
node_snapshot -->|"retains report data"| node_technical
node_main_ui -.->|"loads and saves"| node_project_store
node_main_ui -.->|"uses presets"| node_library
node_assessment -.->|"presents verdict"| node_main_ui
node_pdf -.->|"exports PDF"| node_engineer
node_technical -.->|"presents report"| node_engineer

click node_main_ui "https://github.com/gonoboben/buoycalc-windows/blob/main/ViewModels/MainWindowViewModel.cs"
click node_sequence "https://github.com/gonoboben/buoycalc-windows/blob/main/ViewModels/AssemblyItemViewModel.cs"
click node_runner "https://github.com/gonoboben/buoycalc-windows/blob/main/ApplicationModel/ApplicationCalculationRunner.cs"
click node_validation "https://github.com/gonoboben/buoycalc-windows/blob/main/ApplicationModel/EngineeringInputValidation.cs"
click node_snapshot "https://github.com/gonoboben/buoycalc-windows/blob/main/ApplicationModel/CalculationSnapshot.cs"
click node_geometry "https://github.com/gonoboben/buoycalc-windows/blob/main/Services/MooringSignedCandidateEvaluator.cs"
click node_envelope "https://github.com/gonoboben/buoycalc-windows/blob/main/Services/MooringSelectedDesignEnvelopeState.cs"
click node_demand "https://github.com/gonoboben/buoycalc-windows/blob/main/Services/MooringSelectedDesignTensionDemandState.cs"
click node_anchor "https://github.com/gonoboben/buoycalc-windows/blob/main/Services/MooringSelectedAnchorReactionState.cs"
click node_local_demand "https://github.com/gonoboben/buoycalc-windows/blob/main/Services/MooringSelectedLocalElementDemandState.cs"
click node_capacity "https://github.com/gonoboben/buoycalc-windows/blob/main/Services/MooringSelectedLocalStructuralCapacityState.cs"
click node_assessment "https://github.com/gonoboben/buoycalc-windows/blob/main/Services/MooringSelectedEngineeringAssessmentState.cs"
click node_diagram "https://github.com/gonoboben/buoycalc-windows/blob/main/Services/Mooring2DDiagramReadModel.cs"
click node_canvas "https://github.com/gonoboben/buoycalc-windows/blob/main/Views/Mooring2DCanvas.cs"
click node_pdf "https://github.com/gonoboben/buoycalc-windows/blob/main/Services/PdfReportBuilder.cs"
click node_technical "https://github.com/gonoboben/buoycalc-windows/blob/main/Services/TechnicalReportData.cs"
click node_project_store "https://github.com/gonoboben/buoycalc-windows/blob/main/Services/ProjectJsonStorage.cs"
click node_library "https://github.com/gonoboben/buoycalc-windows/blob/main/Services/ElementLibraryBundleStorage.cs"

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_main_ui,node_sequence toneBlue
class node_runner,node_validation,node_snapshot,node_geometry toneAmber
class node_envelope,node_demand,node_anchor,node_local_demand,node_capacity,node_assessment toneMint
class node_diagram,node_canvas,node_pdf,node_technical toneRose
class node_project_store,node_library,node_engineer toneIndigo
```

## Components

### Desktop workflow

- [Project editor](https://github.com/gonoboben/buoycalc-windows/blob/main/ViewModels/MainWindowViewModel.cs): `ViewModels/MainWindowViewModel.cs`
- [Mooring sequence](https://github.com/gonoboben/buoycalc-windows/blob/main/ViewModels/AssemblyItemViewModel.cs): `ViewModels/AssemblyItemViewModel.cs`

### Engineering calculation

- [Run coordinator](https://github.com/gonoboben/buoycalc-windows/blob/main/ApplicationModel/ApplicationCalculationRunner.cs): `ApplicationModel/ApplicationCalculationRunner.cs`
- [Input validation](https://github.com/gonoboben/buoycalc-windows/blob/main/ApplicationModel/EngineeringInputValidation.cs): `ApplicationModel/EngineeringInputValidation.cs`
- [Run snapshot](https://github.com/gonoboben/buoycalc-windows/blob/main/ApplicationModel/CalculationSnapshot.cs): `ApplicationModel/CalculationSnapshot.cs`
- [Selected geometry](https://github.com/gonoboben/buoycalc-windows/blob/main/Services/MooringSignedCandidateEvaluator.cs): `Services/MooringSignedCandidateEvaluator.cs`

### Selected authorities

- [Design envelope](https://github.com/gonoboben/buoycalc-windows/blob/main/Services/MooringSelectedDesignEnvelopeState.cs): `Services/MooringSelectedDesignEnvelopeState.cs`
- [Design tension](https://github.com/gonoboben/buoycalc-windows/blob/main/Services/MooringSelectedDesignTensionDemandState.cs): `Services/MooringSelectedDesignTensionDemandState.cs`
- [Anchor reaction](https://github.com/gonoboben/buoycalc-windows/blob/main/Services/MooringSelectedAnchorReactionState.cs): `Services/MooringSelectedAnchorReactionState.cs`
- [Local element demand](https://github.com/gonoboben/buoycalc-windows/blob/main/Services/MooringSelectedLocalElementDemandState.cs): `Services/MooringSelectedLocalElementDemandState.cs`
- [Structural capacity](https://github.com/gonoboben/buoycalc-windows/blob/main/Services/MooringSelectedLocalStructuralCapacityState.cs): `Services/MooringSelectedLocalStructuralCapacityState.cs`
- [Engineering assessment](https://github.com/gonoboben/buoycalc-windows/blob/main/Services/MooringSelectedEngineeringAssessmentState.cs): `Services/MooringSelectedEngineeringAssessmentState.cs`

### Results and reports

- [2D selected shape](https://github.com/gonoboben/buoycalc-windows/blob/main/Services/Mooring2DDiagramReadModel.cs): `Services/Mooring2DDiagramReadModel.cs`
- [2D canvas](https://github.com/gonoboben/buoycalc-windows/blob/main/Views/Mooring2DCanvas.cs): `Views/Mooring2DCanvas.cs`
- [PDF report](https://github.com/gonoboben/buoycalc-windows/blob/main/Services/PdfReportBuilder.cs): `Services/PdfReportBuilder.cs`
- [Technical report](https://github.com/gonoboben/buoycalc-windows/blob/main/Services/TechnicalReportData.cs): `Services/TechnicalReportData.cs`

### Project and libraries

- [Project files](https://github.com/gonoboben/buoycalc-windows/blob/main/Services/ProjectJsonStorage.cs): `Services/ProjectJsonStorage.cs`
- [Element libraries](https://github.com/gonoboben/buoycalc-windows/blob/main/Services/ElementLibraryBundleStorage.cs): `Services/ElementLibraryBundleStorage.cs`

### Other components

- **Engineer**

## Connections

- Engineer → Project editor: edits project (evidence: `README.md`)
- Project editor → Mooring sequence: configures sequence (evidence: `ViewModels/MainWindowViewModel.cs`)
- Project editor → Run coordinator: runs calculation (evidence: `ViewModels/MainWindowViewModel.cs`)
- Run coordinator → Input validation: validates inputs (evidence: `ApplicationModel/ApplicationCalculationRunner.cs`)
- Run coordinator → Run snapshot: builds snapshot (evidence: `ApplicationModel/ApplicationCalculationRunner.cs`)
- Run snapshot → Selected geometry: selects shape (evidence: `ApplicationModel/CalculationSnapshot.cs`)
- Selected geometry → Design envelope: derives demand envelope
- Design envelope → Design tension: projects tension demand (evidence: `Services/MooringSelectedDesignTensionDemandState.cs`)
- Design envelope → Anchor reaction: projects anchor reaction (evidence: `Services/MooringSelectedAnchorReactionState.cs`)
- Design tension → Local element demand: informs local demand
- Local element demand → Structural capacity: projects capacity (evidence: `Services/MooringSelectedLocalStructuralCapacityState.cs`)
- Design tension → Engineering assessment: informs assessment (evidence: `Services/MooringSelectedEngineeringAssessmentState.cs`)
- Anchor reaction → Engineering assessment: informs assessment (evidence: `Services/MooringSelectedEngineeringAssessmentState.cs`)
- Structural capacity → Engineering assessment: informs assessment (evidence: `Services/MooringSelectedEngineeringAssessmentState.cs`)
- Run snapshot → 2D selected shape: projects selected shape
- 2D selected shape → 2D canvas: renders diagram (evidence: `Views/Mooring2DCanvas.cs`)
- Run snapshot → PDF report: supplies report data
- Run snapshot → Technical report: retains report data (evidence: `ApplicationModel/CalculationSnapshot.cs`)
- Project editor → Project files: loads and saves (evidence: `ViewModels/MainWindowViewModel.cs`)
- Project editor → Element libraries: uses presets
- Engineering assessment → Project editor: presents verdict (evidence: `README.md`)
- PDF report → Engineer: exports PDF (evidence: `README.md`)
- Technical report → Engineer: presents report (evidence: `README.md`)
