# deltares-research/digitaltwin-waterway architecture

> Architecture diagram of the GitHub repository deltares-research/digitaltwin-waterway, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/deltares-research/digitaltwin-waterway
- Repository: https://github.com/deltares-research/digitaltwin-waterway

## Overview

##### Main System Components

a) Frontend Layer (dtv_frontend)
- Vue.js based application
- Mapbox integration for geographical visualization
- Components for climate, fleet, KPIs, and routing
- Vuetify for UI components
- State management with Vuex

b) Backend Layer (dtv_backend)
- Python-based server
- Network analysis module
- FIS (Fairway Information System) processing
- Simulation engine
- Data processing services

c) Data Layer
- GeoJSON files for waterway networks
- Ship types database
- Climate and environmental data
- Velocity and water level data
- Test configurations and results

##### Component Relationships

**[Frontend Components] ←→ [State Management] ←→ [Backend API] ←→ [Data Processing] ←→ [Data Storage]**

Use these specific elements:

Frontend Components:
- Visualization (MapComponent)
- Climate Interface
- Fleet Management
- KPI Dashboard
- Route Planning

Backend Services:
- Network Analysis
- Simulation Engine
- Climate Processing
- Scheduling Service
- Berthing Management

Data Stores:
- Network Topology
- Environmental Data
- Ship Database
- Simulation Results

##### Architectural Patterns to Highlight

- Client-Server Architecture
- RESTful API communication
- Modular component structure
- Data processing pipeline
- Microservices-like separation of concerns

Use the following visual elements:

##### Important Subsystems

Network Analysis:
**[Network Utilities] → [Build Network Functions] → [PyFIS]**

Simulation Pipeline:
**[Input Data] → [Climate Processing] → [Simulation Engine] → [Post-processing] → [Results Visualization]**

##### Integration Points

Key integration points:
- Mapbox GL integration
- Vue-ECharts for visualization
- External data sources (vaarweginformatie.nl)
- Netlify deployment

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef backend fill:#2ecc71,stroke:#27ae60,color:white
    classDef data fill:#f1c40f,stroke:#f39c12,color:black
    classDef external fill:#9b59b6,stroke:#8e44ad,color:white
    classDef api fill:#e74c3c,stroke:#c0392b,color:white

    %% Frontend Layer
    subgraph Frontend
        MapVis["Map Visualization"]:::frontend
        Climate["Climate Interface"]:::frontend
        Fleet["Fleet Management"]:::frontend
        KPI["KPI Dashboard"]:::frontend
        Route["Route Planning"]:::frontend
        State["State Management"]:::frontend
        
        State --> MapVis
        State --> Climate
        State --> Fleet
        State --> KPI
        State --> Route
    end

    %% Backend Layer
    subgraph Backend
        NetAnalysis["Network Analysis"]:::backend
        SimEngine["Simulation Engine"]:::backend
        ClimateProc["Climate Processing"]:::backend
        Schedule["Scheduling Service"]:::backend
        Berth["Berthing Management"]:::backend
        FIS["FIS Processing"]:::backend

        subgraph NetworkModule
            NetUtils["Network Utilities"]:::backend
            BuildNet["Build Network Functions"]:::backend
            PyFIS["PyFIS"]:::backend

            NetUtils --> BuildNet
            BuildNet --> PyFIS
        end

        NetworkModule --> NetAnalysis
        FIS --> SimEngine
        ClimateProc --> SimEngine
    end

    %% Data Layer
    subgraph Data
        ShipDB["Ship Types Database"]:::data
        NetTopo["Network Topology"]:::data
        RiverVel["River Velocity"]:::data
        WaterLvl["Water Levels"]:::data
    end

    %% External Services
    Mapbox["Mapbox GL"]:::external
    VueCharts["Vue-ECharts"]:::external
    ExtData["vaarweginformatie.nl"]:::external

    %% Connections
    State <--> Backend
    Backend <--> Data
    MapVis --> Mapbox
    KPI --> VueCharts
    ExtData --> FIS

    %% Click Events
    click MapVis "https://github.com/Deltares-research/digitaltwin-waterway/blob/master/dtv_frontend/src/components/MapComponent.vue"
    click Climate "https://github.com/Deltares-research/digitaltwin-waterway/blob/master/dtv_frontend/src/components/ClimateComponent.vue"
    click Fleet "https://github.com/Deltares-research/digitaltwin-waterway/blob/master/dtv_frontend/src/components/FleetComponent.vue"
    click KPI "https://github.com/Deltares-research/digitaltwin-waterway/blob/master/dtv_frontend/src/components/KpiComponent.vue"
    click State "https://github.com/Deltares-research/digitaltwin-waterway/blob/master/dtv_frontend/src/store.js"
    click Route "https://github.com/Deltares-research/digitaltwin-waterway/blob/master/dtv_frontend/src/components/RouteCard.vue"
    click NetAnalysis "https://github.com/Deltares-research/digitaltwin-waterway/tree/master/dtv_backend/dtv_backend/network/"
    click FIS "https://github.com/Deltares-research/digitaltwin-waterway/blob/master/dtv_backend/dtv_backend/fis.py"
    click SimEngine "https://github.com/Deltares-research/digitaltwin-waterway/blob/master/dtv_backend/dtv_backend/simulate.py"
    click ClimateProc "https://github.com/Deltares-research/digitaltwin-waterway/blob/master/dtv_backend/dtv_backend/climate.py"
    click Schedule "https://github.com/Deltares-research/digitaltwin-waterway/blob/master/dtv_backend/dtv_backend/scheduling.py"
    click Berth "https://github.com/Deltares-research/digitaltwin-waterway/blob/master/dtv_backend/dtv_backend/berthing.py"
    click ShipDB "https://github.com/Deltares-research/digitaltwin-waterway/blob/master/dtv_backend/data/DTV_shiptypes_database.json"
    click NetTopo "https://github.com/Deltares-research/digitaltwin-waterway/blob/master/dtv_backend/data/edges_0.3_with_bathy.geojson"
    click RiverVel "https://github.com/Deltares-research/digitaltwin-waterway/blob/master/dtv_backend/data/river_velocity.geojson"
    click WaterLvl "https://github.com/Deltares-research/digitaltwin-waterway/blob/master/dtv_backend/data/river_waterlevel.geojson"
    click NetUtils "https://github.com/Deltares-research/digitaltwin-waterway/blob/master/dtv_backend/dtv_backend/network/network_utilities.py"
    click BuildNet "https://github.com/Deltares-research/digitaltwin-waterway/blob/master/dtv_backend/dtv_backend/network/build_network_functions.py"
    click PyFIS "https://github.com/Deltares-research/digitaltwin-waterway/blob/master/dtv_backend/dtv_backend/network/pyFIS.py"
```
