# getta16/hec-hms-web-runner architecture

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

- Interactive diagram: https://gitdiagram.com/getta16/hec-hms-web-runner
- Repository: https://github.com/getta16/hec-hms-web-runner

## Overview

This repository provides a single-file Mini HEC-HMS engine for reading HEC-HMS project files and running hydrologic event simulations in a browser or Node. Its principal workflow is project data entering the engine, which computes watershed flows and returns time-series results. The engine excerpt shows parsing and simulation details, while its opening comment documents supported model methods. The README is empty and the web UI is unsampled, so UI interactions and most internal call relationships cannot be verified.

Main entry points: [`web/engine.js`](https://github.com/getta16/hec-hms-web-runner/blob/main/web/engine.js) (Event simulation), [`web/data`](https://github.com/getta16/hec-hms-web-runner/tree/main/web/data) (HMS project files)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Project data"]
  node_project_files["HMS project files"]
end

subgraph group_engine["Simulation engine"]
  node_project_parser["Project parsing<br/>[engine.js]"]
  node_simulation["Event simulation<br/>[engine.js]"]
end

subgraph group_methods["Hydrologic methods"]
  node_meteorology["Precipitation forcing<br/>[engine.js]"]
  node_evapotranspiration["Evapotranspiration<br/>[engine.js]"]
  node_loss["Precipitation loss<br/>[engine.js]"]
  node_transform["Runoff transform<br/>[engine.js]"]
  node_baseflow["Baseflow<br/>[engine.js]"]
  node_routing["Channel routing<br/>[engine.js]"]
  node_reservoir["Reservoir routing<br/>[engine.js]"]
  node_diversion["Diversion<br/>[engine.js]"]
end

subgraph group_outputs["Simulation results"]
  node_results["Flow results<br/>[engine.js]"]
end

node_user(("Model user"))

node_user -.->|"selects project"| node_project_files
node_project_files -.->|"provides files"| node_project_parser
node_project_parser -.->|"configures"| node_simulation
node_simulation -.->|"uses forcing"| node_meteorology
node_simulation -.->|"uses method"| node_evapotranspiration
node_simulation -.->|"uses method"| node_loss
node_simulation -.->|"uses method"| node_transform
node_simulation -.->|"uses method"| node_baseflow
node_simulation -.->|"uses method"| node_routing
node_simulation -.->|"uses method"| node_reservoir
node_simulation -.->|"uses method"| node_diversion
node_simulation -.->|"returns results"| node_results

click node_project_files "https://github.com/getta16/hec-hms-web-runner/tree/main/web/data"
click node_project_parser "https://github.com/getta16/hec-hms-web-runner/blob/main/web/engine.js"
click node_simulation "https://github.com/getta16/hec-hms-web-runner/blob/main/web/engine.js"
click node_meteorology "https://github.com/getta16/hec-hms-web-runner/blob/main/web/engine.js"
click node_evapotranspiration "https://github.com/getta16/hec-hms-web-runner/blob/main/web/engine.js"
click node_loss "https://github.com/getta16/hec-hms-web-runner/blob/main/web/engine.js"
click node_transform "https://github.com/getta16/hec-hms-web-runner/blob/main/web/engine.js"
click node_baseflow "https://github.com/getta16/hec-hms-web-runner/blob/main/web/engine.js"
click node_routing "https://github.com/getta16/hec-hms-web-runner/blob/main/web/engine.js"
click node_reservoir "https://github.com/getta16/hec-hms-web-runner/blob/main/web/engine.js"
click node_diversion "https://github.com/getta16/hec-hms-web-runner/blob/main/web/engine.js"
click node_results "https://github.com/getta16/hec-hms-web-runner/blob/main/web/engine.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_project_files,node_user toneBlue
class node_project_parser,node_simulation toneAmber
class node_meteorology,node_evapotranspiration,node_loss,node_transform,node_baseflow,node_routing,node_reservoir,node_diversion toneMint
class node_results toneRose
```

## Components

### Project data

- [HMS project files](https://github.com/getta16/hec-hms-web-runner/tree/main/web/data): `web/data`

### Simulation engine

- [Project parsing](https://github.com/getta16/hec-hms-web-runner/blob/main/web/engine.js): `web/engine.js`
- [Event simulation](https://github.com/getta16/hec-hms-web-runner/blob/main/web/engine.js): `web/engine.js`

### Hydrologic methods

- [Precipitation forcing](https://github.com/getta16/hec-hms-web-runner/blob/main/web/engine.js): `web/engine.js`
- [Evapotranspiration](https://github.com/getta16/hec-hms-web-runner/blob/main/web/engine.js): `web/engine.js`
- [Precipitation loss](https://github.com/getta16/hec-hms-web-runner/blob/main/web/engine.js): `web/engine.js`
- [Runoff transform](https://github.com/getta16/hec-hms-web-runner/blob/main/web/engine.js): `web/engine.js`
- [Baseflow](https://github.com/getta16/hec-hms-web-runner/blob/main/web/engine.js): `web/engine.js`
- [Channel routing](https://github.com/getta16/hec-hms-web-runner/blob/main/web/engine.js): `web/engine.js`
- [Reservoir routing](https://github.com/getta16/hec-hms-web-runner/blob/main/web/engine.js): `web/engine.js`
- [Diversion](https://github.com/getta16/hec-hms-web-runner/blob/main/web/engine.js): `web/engine.js`

### Simulation results

- [Flow results](https://github.com/getta16/hec-hms-web-runner/blob/main/web/engine.js): `web/engine.js`

### Other components

- **Model user**

## Connections

- Model user → HMS project files: selects project
- HMS project files → Project parsing: provides files
- Project parsing → Event simulation: configures (evidence: `web/engine.js`)
- Event simulation → Precipitation forcing: uses forcing (evidence: `web/engine.js`)
- Event simulation → Evapotranspiration: uses method (evidence: `web/engine.js`)
- Event simulation → Precipitation loss: uses method (evidence: `web/engine.js`)
- Event simulation → Runoff transform: uses method (evidence: `web/engine.js`)
- Event simulation → Baseflow: uses method (evidence: `web/engine.js`)
- Event simulation → Channel routing: uses method (evidence: `web/engine.js`)
- Event simulation → Reservoir routing: uses method (evidence: `web/engine.js`)
- Event simulation → Diversion: uses method (evidence: `web/engine.js`)
- Event simulation → Flow results: returns results (evidence: `web/engine.js`)
