# dukenmarga/civil-engineering-toolbox architecture

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

- Interactive diagram: https://gitdiagram.com/dukenmarga/civil-engineering-toolbox
- Repository: https://github.com/dukenmarga/civil-engineering-toolbox

## Overview

civil-engineering-toolbox is an offline/LAN-capable web application for common civil-engineering calculations. A browser request is dispatched by CherryPy to a domain controller, which reads request values, invokes a calculation model, and renders a result through Mako; surcharge controllers also create plots. The graph preserves the README’s structural, geotechnical, and unit-conversion capabilities plus the options/about branch. Connections are limited to the excerpts and SOURCE INDEX references; templates and some implementation details are not present in the supplied tree.

Main entry points: [`src/router.py`](https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/src/router.py) (HTTP routes), [`src/view.py`](https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/src/view.py) (Mako lookup), [`controller/structure/concrete.py`](https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/controller/structure/concrete.py) (Concrete analysis), [`controller/geotechnic/surcharge_load.py`](https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/controller/geotechnic/surcharge_load.py) (Surcharge loads)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_main["Application start<br/>[Main.py]"]
  node_router["HTTP routes<br/>[router.py]"]
  node_view["Mako lookup<br/>[view.py]"]
end

subgraph group_structure["Structural calculations"]
  node_steel_ui["Steel profiles<br/>[steel_profile.py]"]
  node_steel_model["Steel section lookup<br/>[steel_profile.py]"]
  node_concrete_ui["Concrete analysis<br/>[concrete.py]"]
  node_concrete_model["Flexural analysis<br/>[concrete.py]"]
  node_slab_model["Two-way slab design<br/>[concrete_slab.py]"]
  node_earthquake_ui["Response spectrum<br/>[earthquake.py]"]
  node_earthquake_model["Earthquake model<br/>[earthquake.py]"]
end

subgraph group_geo["Geotechnical calculations"]
  node_geo_ui["Surcharge loads<br/>[surcharge_load.py]"]
  node_geo_model["Load distribution<br/>[surcharge_load.py]"]
  node_plot["Plot rendering<br/>[plot.py]"]
end

subgraph group_shared["Shared models and settings"]
  node_converter_ui["Unit converter<br/>[converter.py]"]
  node_converter_model["Unit conversion<br/>[converter.py]"]
  node_about["About and options<br/>[about.py]"]
  node_options_model["Preference cookies<br/>[options.py]"]
  node_startup["Option startup check<br/>[startup.py]"]
end

node_browser(("Browser user"))
node_result["Rendered result"]

node_browser -->|"sends request"| node_router
node_main -->|"configures routes"| node_router
node_router -->|"dispatches about"| node_about
node_router -->|"dispatches steel"| node_steel_ui
node_router -->|"dispatches concrete"| node_concrete_ui
node_router -->|"dispatches spectrum"| node_earthquake_ui
node_router -->|"dispatches surcharge"| node_geo_ui
node_router -->|"dispatches conversion"| node_converter_ui
node_about -->|"reads or saves"| node_options_model
node_about -->|"checks options"| node_startup
node_steel_ui -->|"queries profiles"| node_steel_model
node_concrete_ui -->|"calculates flexure"| node_concrete_model
node_concrete_ui -->|"designs slab"| node_slab_model
node_earthquake_ui -->|"calculates spectrum"| node_earthquake_model
node_geo_ui -->|"calculates loads"| node_geo_model
node_geo_ui -->|"renders plot"| node_plot
node_converter_ui -->|"converts units"| node_converter_model
node_about -->|"renders pages"| node_view
node_steel_ui -->|"renders pages"| node_view
node_concrete_ui -->|"renders pages"| node_view
node_earthquake_ui -->|"renders pages"| node_view
node_geo_ui -->|"renders pages"| node_view
node_converter_ui -->|"renders pages"| node_view
node_view -->|"renders response"| node_result
node_result -.->|"returns page"| node_browser

click node_main "https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/Main.py"
click node_router "https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/src/router.py"
click node_view "https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/src/view.py"
click node_converter_ui "https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/controller/math/converter.py"
click node_converter_model "https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/model/math/converter.py"
click node_about "https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/controller/about/about.py"
click node_options_model "https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/model/options/options.py"
click node_startup "https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/src/startup.py"
click node_steel_ui "https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/controller/structure/steel_profile.py"
click node_steel_model "https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/model/structure/steel_profile.py"
click node_concrete_ui "https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/controller/structure/concrete.py"
click node_concrete_model "https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/model/material/concrete.py"
click node_slab_model "https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/model/structure/concrete_slab.py"
click node_earthquake_ui "https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/controller/structure/earthquake.py"
click node_earthquake_model "https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/model/structure/earthquake.py"
click node_geo_ui "https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/controller/geotechnic/surcharge_load.py"
click node_geo_model "https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/model/geotechnic/surcharge_load.py"
click node_plot "https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/model/utils/plot.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_main,node_router,node_view,node_browser toneBlue
class node_steel_ui,node_steel_model,node_concrete_ui,node_concrete_model,node_slab_model,node_earthquake_ui,node_earthquake_model toneAmber
class node_geo_ui,node_geo_model,node_plot toneMint
class node_converter_ui,node_converter_model,node_about,node_options_model,node_startup toneRose
class node_result toneIndigo
```

## Components

### Web application

- [Application start](https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/Main.py): `Main.py`
- [HTTP routes](https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/src/router.py): `src/router.py`
- [Mako lookup](https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/src/view.py): `src/view.py`

### Structural calculations

- [Steel profiles](https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/controller/structure/steel_profile.py): `controller/structure/steel_profile.py`
- [Steel section lookup](https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/model/structure/steel_profile.py): `model/structure/steel_profile.py`
- [Concrete analysis](https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/controller/structure/concrete.py): `controller/structure/concrete.py`
- [Flexural analysis](https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/model/material/concrete.py): `model/material/concrete.py`
- [Two-way slab design](https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/model/structure/concrete_slab.py): `model/structure/concrete_slab.py`
- [Response spectrum](https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/controller/structure/earthquake.py): `controller/structure/earthquake.py`
- [Earthquake model](https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/model/structure/earthquake.py): `model/structure/earthquake.py`

### Geotechnical calculations

- [Surcharge loads](https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/controller/geotechnic/surcharge_load.py): `controller/geotechnic/surcharge_load.py`
- [Load distribution](https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/model/geotechnic/surcharge_load.py): `model/geotechnic/surcharge_load.py`
- [Plot rendering](https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/model/utils/plot.py): `model/utils/plot.py`

### Shared models and settings

- [Unit converter](https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/controller/math/converter.py): `controller/math/converter.py`
- [Unit conversion](https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/model/math/converter.py): `model/math/converter.py`
- [About and options](https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/controller/about/about.py): `controller/about/about.py`
- [Preference cookies](https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/model/options/options.py): `model/options/options.py`
- [Option startup check](https://github.com/dukenmarga/civil-engineering-toolbox/blob/main/src/startup.py): `src/startup.py`

### Other components

- **Browser user**
- **Rendered result**

## Connections

- Browser user → HTTP routes: sends request (evidence: `src/router.py`)
- Application start → HTTP routes: configures routes (evidence: `Main.py`)
- HTTP routes → About and options: dispatches about (evidence: `src/router.py`)
- HTTP routes → Steel profiles: dispatches steel (evidence: `src/router.py`)
- HTTP routes → Concrete analysis: dispatches concrete (evidence: `src/router.py`)
- HTTP routes → Response spectrum: dispatches spectrum (evidence: `src/router.py`)
- HTTP routes → Surcharge loads: dispatches surcharge (evidence: `src/router.py`)
- HTTP routes → Unit converter: dispatches conversion (evidence: `src/router.py`)
- About and options → Preference cookies: reads or saves (evidence: `controller/about/about.py`)
- About and options → Option startup check: checks options (evidence: `controller/about/about.py`)
- Steel profiles → Steel section lookup: queries profiles (evidence: `controller/structure/steel_profile.py`)
- Concrete analysis → Flexural analysis: calculates flexure (evidence: `controller/structure/concrete.py`)
- Concrete analysis → Two-way slab design: designs slab (evidence: `controller/structure/concrete.py`)
- Response spectrum → Earthquake model: calculates spectrum (evidence: `controller/structure/earthquake.py`)
- Surcharge loads → Load distribution: calculates loads (evidence: `controller/geotechnic/surcharge_load.py`)
- Surcharge loads → Plot rendering: renders plot (evidence: `controller/geotechnic/surcharge_load.py`)
- Unit converter → Unit conversion: converts units (evidence: `controller/math/converter.py`)
- About and options → Mako lookup: renders pages (evidence: `controller/about/about.py`)
- Steel profiles → Mako lookup: renders pages (evidence: `controller/structure/steel_profile.py`)
- Concrete analysis → Mako lookup: renders pages (evidence: `controller/structure/concrete.py`)
- Response spectrum → Mako lookup: renders pages (evidence: `controller/structure/earthquake.py`)
- Surcharge loads → Mako lookup: renders pages (evidence: `controller/geotechnic/surcharge_load.py`)
- Unit converter → Mako lookup: renders pages (evidence: `controller/math/converter.py`)
- Mako lookup → Rendered result: renders response (evidence: `src/view.py`)
- Rendered result → Browser user: returns page
