# technologiestiftung/smartwater-infoportal architecture

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

- Interactive diagram: https://gitdiagram.com/technologiestiftung/smartwater-infoportal
- Repository: https://github.com/technologiestiftung/smartwater-infoportal

## Overview

Smartwater Infoportal is a Berlin flood-information website: residents look up an address, review building-specific hazard data, answer a risk questionnaire, and view results and guidance. Its broader capabilities include interactive hazard and scenario maps, downloadable reports, educational and accessibility content, and screenshot/API support. The address, store, and risk-calculation relationships below are supported by source excerpts or the SOURCE INDEX; map and other unsampled feature links are omitted where their wiring is not shown.

Main entry points: [`src/components/Results.tsx`](https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/components/Results.tsx) (Risk results), [`src/app/page.tsx`](https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/app/page.tsx) (Portal home), [`src/app/hochwasser-check/FloodCheckClient.tsx`](https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/app/hochwasser-check/FloodCheckClient.tsx) (Flood check flow), [`src/components/AddressSearch.tsx`](https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/components/AddressSearch.tsx) (Address search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_lookup["Address lookup"]
  node_address_ui["Address search<br/>[AddressSearch.tsx]"]
  node_address_action["Address search action<br/>[searchAddresses.ts]"]
  node_photon["Photon fallback"]
  node_building_action["Building lookup action"]
  node_geoserver_client["GeoServer client<br/>[geoserverClient.ts]"]
end

subgraph group_assessment["Risk assessment"]
  node_flood_check["Flood check flow"]
  node_check_block["Check questions<br/>[CheckBlock.tsx]"]
  node_risk_analysis["Risk questionnaire<br/>[RiskAnalysis.tsx]"]
  node_risk_calc["Risk calculator"]
  node_risk_store[("Assessment state<br/>[defaultStore.tsx]")]
  node_results["Risk results<br/>[Results.tsx]"]
  node_risk_block["Hazard summary<br/>[RiskBlock.tsx]"]
  node_risk_factors["Risk factors<br/>[RiskFactors.tsx]"]
  node_result_block["Result details<br/>[ResultBlock.tsx]"]
end

subgraph group_maps["Maps and hazards"]
  node_map["Interactive hazard map"]
  node_scenario_map["Scenario map"]
  node_map_types["Map configuration<br/>[map.ts]"]
end

subgraph group_portal["Portal features"]
  node_report["PDF report<br/>[ReportPDF.tsx]"]
  node_report_utils["Report utilities<br/>[utils.ts]"]
  node_screenshot_api["Screenshot endpoint<br/>[route.ts]"]
  node_wfs_api["WFS cache endpoint<br/>[route.ts]"]
  node_wmts_api["WMTS capabilities endpoint<br/>[route.ts]"]
  node_guidance["Safety guidance"]
  node_content_pages["Information pages<br/>[page.tsx]"]
  node_home["Portal home<br/>[page.tsx]"]
end

node_resident(("Berlin resident"))
node_geoserver[("GeoServer")]

node_resident -->|"enters address"| node_address_ui
node_address_ui -->|"searches"| node_address_action
node_address_action -->|"tries fallback"| node_photon
node_address_action -->|"looks up building"| node_building_action
node_building_action -->|"delegates lookup"| node_geoserver_client
node_geoserver_client -.->|"queries layers"| node_geoserver
node_address_ui -->|"opens check"| node_flood_check
node_flood_check -->|"shows initial check"| node_check_block
node_flood_check -->|"shows questionnaire"| node_risk_analysis
node_flood_check -->|"shows results"| node_results
node_risk_analysis -->|"uses assessment state"| node_risk_store
node_risk_store -->|"calculates score"| node_risk_calc
node_risk_store -->|"provides state"| node_results
node_results -->|"renders hazard summary"| node_risk_block
node_results -->|"renders result details"| node_result_block
node_results -->|"renders factors"| node_risk_factors
node_results -->|"renders report"| node_report
node_report -->|"uses report utilities"| node_report_utils
node_map -.->|"uses map configuration"| node_map_types
node_scenario_map -.->|"uses map configuration"| node_map_types
node_resident -->|"visits portal"| node_home
node_home -.->|"offers hazard maps"| node_map
node_home -.->|"offers scenarios"| node_scenario_map
node_home -.->|"links information"| node_content_pages
node_home -.->|"offers safety advice"| node_guidance
node_screenshot_api -.->|"returns image"| node_resident

click node_address_ui "https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/components/AddressSearch.tsx"
click node_address_action "https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/server/actions/searchAddresses.ts"
click node_photon "https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/server/actions/searchAddressesPhotonAPI.ts"
click node_building_action "https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/server/actions/findAlkisBuilding.ts"
click node_geoserver_client "https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/lib/geoserverClient.ts"
click node_flood_check "https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/app/hochwasser-check/FloodCheckClient.tsx"
click node_check_block "https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/components/CheckBlock.tsx"
click node_risk_analysis "https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/components/RiskAnalysis.tsx"
click node_risk_calc "https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/utils/floodRiskCalculator.ts"
click node_risk_store "https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/store/defaultStore.tsx"
click node_results "https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/components/Results.tsx"
click node_risk_block "https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/components/RiskBlock.tsx"
click node_risk_factors "https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/components/RiskFactors.tsx"
click node_result_block "https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/components/ResultBlock.tsx"
click node_map "https://github.com/technologiestiftung/smartwater-infoportal/tree/staging/src/components/Map"
click node_scenario_map "https://github.com/technologiestiftung/smartwater-infoportal/tree/staging/src/components/ScenarioMap"
click node_map_types "https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/types/map.ts"
click node_report "https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/components/Report/components/ReportPDF.tsx"
click node_report_utils "https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/components/Report/utils.ts"
click node_screenshot_api "https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/app/api/screenshot/route.ts"
click node_wfs_api "https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/app/api/wfs-cache/route.ts"
click node_wmts_api "https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/app/api/wmts-capabilities/route.ts"
click node_guidance "https://github.com/technologiestiftung/smartwater-infoportal/tree/staging/src/components/Handlungsempfehlungen"
click node_content_pages "https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/app/hintergrund-informationen/page.tsx"
click node_home "https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/app/page.tsx"

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_address_ui,node_address_action,node_photon,node_building_action,node_geoserver_client toneBlue
class node_flood_check,node_check_block,node_risk_analysis,node_risk_calc,node_risk_store,node_results,node_risk_block,node_risk_factors,node_result_block,node_geoserver toneAmber
class node_map,node_scenario_map,node_map_types toneMint
class node_report,node_report_utils,node_screenshot_api,node_wfs_api,node_wmts_api,node_guidance,node_content_pages,node_home toneRose
class node_resident toneIndigo
```

## Components

### Address lookup

- [Address search](https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/components/AddressSearch.tsx): `src/components/AddressSearch.tsx`
- [Address search action](https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/server/actions/searchAddresses.ts): `src/server/actions/searchAddresses.ts`
- [Photon fallback](https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/server/actions/searchAddressesPhotonAPI.ts): `src/server/actions/searchAddressesPhotonAPI.ts`
- [Building lookup action](https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/server/actions/findAlkisBuilding.ts): `src/server/actions/findAlkisBuilding.ts`
- [GeoServer client](https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/lib/geoserverClient.ts): `src/lib/geoserverClient.ts`

### Risk assessment

- [Flood check flow](https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/app/hochwasser-check/FloodCheckClient.tsx): `src/app/hochwasser-check/FloodCheckClient.tsx`
- [Check questions](https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/components/CheckBlock.tsx): `src/components/CheckBlock.tsx`
- [Risk questionnaire](https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/components/RiskAnalysis.tsx): `src/components/RiskAnalysis.tsx`
- [Risk calculator](https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/utils/floodRiskCalculator.ts): `src/utils/floodRiskCalculator.ts`
- [Assessment state](https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/store/defaultStore.tsx): `src/store/defaultStore.tsx`
- [Risk results](https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/components/Results.tsx): `src/components/Results.tsx`
- [Hazard summary](https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/components/RiskBlock.tsx): `src/components/RiskBlock.tsx`
- [Risk factors](https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/components/RiskFactors.tsx): `src/components/RiskFactors.tsx`
- [Result details](https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/components/ResultBlock.tsx): `src/components/ResultBlock.tsx`

### Maps and hazards

- [Interactive hazard map](https://github.com/technologiestiftung/smartwater-infoportal/tree/staging/src/components/Map): `src/components/Map`
- [Scenario map](https://github.com/technologiestiftung/smartwater-infoportal/tree/staging/src/components/ScenarioMap): `src/components/ScenarioMap`
- [Map configuration](https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/types/map.ts): `src/types/map.ts`

### Portal features

- [PDF report](https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/components/Report/components/ReportPDF.tsx): `src/components/Report/components/ReportPDF.tsx`
- [Report utilities](https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/components/Report/utils.ts): `src/components/Report/utils.ts`
- [Screenshot endpoint](https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/app/api/screenshot/route.ts): `src/app/api/screenshot/route.ts`
- [WFS cache endpoint](https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/app/api/wfs-cache/route.ts): `src/app/api/wfs-cache/route.ts`
- [WMTS capabilities endpoint](https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/app/api/wmts-capabilities/route.ts): `src/app/api/wmts-capabilities/route.ts`
- [Safety guidance](https://github.com/technologiestiftung/smartwater-infoportal/tree/staging/src/components/Handlungsempfehlungen): `src/components/Handlungsempfehlungen`
- [Information pages](https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/app/hintergrund-informationen/page.tsx): `src/app/hintergrund-informationen/page.tsx`
- [Portal home](https://github.com/technologiestiftung/smartwater-infoportal/blob/staging/src/app/page.tsx): `src/app/page.tsx`

### Other components

- **Berlin resident**
- **GeoServer**

## Connections

- Berlin resident → Address search: enters address
- Address search → Address search action: searches (evidence: `src/components/AddressSearch.tsx`)
- Address search action → Photon fallback: tries fallback (evidence: `src/server/actions/searchAddresses.ts`)
- Address search action → Building lookup action: looks up building (evidence: `src/server/actions/searchAddresses.ts`)
- Building lookup action → GeoServer client: delegates lookup (evidence: `src/server/actions/findAlkisBuilding.ts`)
- GeoServer client → GeoServer: queries layers
- Address search → Flood check flow: opens check (evidence: `src/components/AddressSearch.tsx`)
- Flood check flow → Check questions: shows initial check (evidence: `src/app/hochwasser-check/FloodCheckClient.tsx`)
- Flood check flow → Risk questionnaire: shows questionnaire (evidence: `src/app/hochwasser-check/FloodCheckClient.tsx`)
- Flood check flow → Risk results: shows results (evidence: `src/app/hochwasser-check/FloodCheckClient.tsx`)
- Risk questionnaire → Assessment state: uses assessment state (evidence: `src/components/RiskAnalysis.tsx`)
- Assessment state → Risk calculator: calculates score (evidence: `src/store/defaultStore.tsx`)
- Assessment state → Risk results: provides state (evidence: `src/components/Results.tsx`)
- Risk results → Hazard summary: renders hazard summary (evidence: `src/components/Results.tsx`)
- Risk results → Result details: renders result details (evidence: `src/components/Results.tsx`)
- Risk results → Risk factors: renders factors (evidence: `src/components/Results.tsx`)
- Risk results → PDF report: renders report (evidence: `src/components/Results.tsx`)
- PDF report → Report utilities: uses report utilities (evidence: `src/components/Report/utils.ts`)
- Interactive hazard map → Map configuration: uses map configuration
- Scenario map → Map configuration: uses map configuration
- Berlin resident → Portal home: visits portal
- Portal home → Interactive hazard map: offers hazard maps
- Portal home → Scenario map: offers scenarios
- Portal home → Information pages: links information
- Portal home → Safety guidance: offers safety advice
- Screenshot endpoint → Berlin resident: returns image
