# emirhannavdar/ges_depolama architecture

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

- Interactive diagram: https://gitdiagram.com/emirhannavdar/ges_depolama
- Repository: https://github.com/emirhannavdar/ges_depolama

## Overview

ScadaWatt EMS provides real-price battery scheduling and virtual solar-plus-storage simulation, alongside a forecast-driven digital-twin workflow surfaced in the dashboard. The primary flow is scenario setup, weather and price acquisition, planning or preview, then simulated operation and reporting. The graph preserves both product paths and the optional session-history store. Some backend modules are represented from the source index and README rather than inspected excerpts, so uncertain internal links are omitted.

Main entry points: [`api/api.py`](https://github.com/emirhannavdar/ges_depolama/blob/main/api/api.py) (FastAPI Router), [`api/pricing.py`](https://github.com/emirhannavdar/ges_depolama/blob/main/api/pricing.py) (Price Matching), [`ges-ems-dashboard/src/App.tsx`](https://github.com/emirhannavdar/ges_depolama/blob/main/ges-ems-dashboard/src/App.tsx) (Dashboard App), [`api/optimizer.py`](https://github.com/emirhannavdar/ges_depolama/blob/main/api/optimizer.py) (Schedule Optimizer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Dashboard"]
  node_app["Dashboard App<br/>[App.tsx]"]
  node_twinui["Twin View<br/>[DigitalTwin.tsx]"]
  node_client["API Client<br/>[api.ts]"]
  node_uihelpers["Scenario Helpers<br/>[ems.ts]"]
end

subgraph group_market["Market Data"]
  node_epias["EPİAŞ Prices<br/>[epias.py]"]
  node_weather["Weather Service<br/>[visual_crossing.py]"]
  node_forecast["Solar Forecast<br/>[forecast.py]"]
  node_pricing["Price Matching<br/>[pricing.py]"]
end

subgraph group_planning["Planning"]
  node_battery["Battery Model<br/>[battery.py]"]
  node_optimizer["Schedule Optimizer<br/>[optimizer.py]"]
  node_emsbridge["EMS Bridge<br/>[ems_bridge.py]"]
end

subgraph group_runtime["Simulation"]
  node_apiroot["FastAPI Router<br/>[api.py]"]
  node_simapi["Simulation API<br/>[simulator_api.py]"]
  node_simulator["Virtual Simulator<br/>[simulator.py]"]
  node_storage[("Session Store")]
end

subgraph group_twin["Digital Twin"]
  node_twincore["Twin Engine<br/>[digital_twin.py]"]
  node_report["Daily Reports"]
end

node_operator(("Operator"))
node_externalweather{{"Visual Crossing"}}
node_browser(("Browser"))

node_operator -->|"configures"| node_app
node_app -->|"uses"| node_uihelpers
node_app -->|"requests"| node_client
node_twinui -->|"requests"| node_client
node_browser -.->|"calls"| node_apiroot
node_apiroot -->|"mounts"| node_epias
node_apiroot -->|"mounts"| node_weather
node_apiroot -->|"mounts"| node_forecast
node_apiroot -->|"mounts"| node_pricing
node_apiroot -->|"mounts"| node_optimizer
node_apiroot -->|"mounts"| node_simapi
node_apiroot -->|"mounts"| node_emsbridge
node_apiroot -->|"mounts"| node_twincore
node_pricing -->|"fetches prices"| node_epias
node_pricing -->|"fetches weather"| node_weather
node_pricing -->|"builds forecast"| node_forecast
node_optimizer -->|"gets prices"| node_pricing
node_optimizer -->|"uses model"| node_battery
node_simapi -->|"runs"| node_simulator
node_simapi -->|"persists sessions"| node_storage
node_emsbridge -->|"uses credentials"| node_epias
node_twincore -->|"fetches hourly data"| node_externalweather
node_twincore -->|"creates reports"| node_report
node_client -->|"sends requests"| node_apiroot

click node_app "https://github.com/emirhannavdar/ges_depolama/blob/main/ges-ems-dashboard/src/App.tsx"
click node_twinui "https://github.com/emirhannavdar/ges_depolama/blob/main/ges-ems-dashboard/src/DigitalTwin.tsx"
click node_client "https://github.com/emirhannavdar/ges_depolama/blob/main/ges-ems-dashboard/src/api.ts"
click node_uihelpers "https://github.com/emirhannavdar/ges_depolama/blob/main/ges-ems-dashboard/src/ems.ts"
click node_apiroot "https://github.com/emirhannavdar/ges_depolama/blob/main/api/api.py"
click node_epias "https://github.com/emirhannavdar/ges_depolama/blob/main/api/epias.py"
click node_weather "https://github.com/emirhannavdar/ges_depolama/blob/main/api/visual_crossing.py"
click node_forecast "https://github.com/emirhannavdar/ges_depolama/blob/main/api/forecast.py"
click node_pricing "https://github.com/emirhannavdar/ges_depolama/blob/main/api/pricing.py"
click node_battery "https://github.com/emirhannavdar/ges_depolama/blob/main/api/battery.py"
click node_optimizer "https://github.com/emirhannavdar/ges_depolama/blob/main/api/optimizer.py"
click node_emsbridge "https://github.com/emirhannavdar/ges_depolama/blob/main/api/ems_bridge.py"
click node_simapi "https://github.com/emirhannavdar/ges_depolama/blob/main/api/simulator_api.py"
click node_simulator "https://github.com/emirhannavdar/ges_depolama/blob/main/api/simulator.py"
click node_storage "https://github.com/emirhannavdar/ges_depolama/blob/main/api/simulation_storage.py"
click node_twincore "https://github.com/emirhannavdar/ges_depolama/blob/main/api/digital_twin.py"
click node_report "https://github.com/emirhannavdar/ges_depolama/blob/main/api/digital_twin_report.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_app,node_twinui,node_client,node_uihelpers,node_browser toneBlue
class node_epias,node_weather,node_forecast,node_pricing toneAmber
class node_battery,node_optimizer,node_emsbridge toneMint
class node_apiroot,node_simapi,node_simulator,node_storage toneRose
class node_twincore,node_report,node_operator,node_externalweather toneIndigo
```

## Components

### Dashboard

- [Dashboard App](https://github.com/emirhannavdar/ges_depolama/blob/main/ges-ems-dashboard/src/App.tsx): `ges-ems-dashboard/src/App.tsx`
- [Twin View](https://github.com/emirhannavdar/ges_depolama/blob/main/ges-ems-dashboard/src/DigitalTwin.tsx): `ges-ems-dashboard/src/DigitalTwin.tsx`
- [API Client](https://github.com/emirhannavdar/ges_depolama/blob/main/ges-ems-dashboard/src/api.ts): `ges-ems-dashboard/src/api.ts`
- [Scenario Helpers](https://github.com/emirhannavdar/ges_depolama/blob/main/ges-ems-dashboard/src/ems.ts): `ges-ems-dashboard/src/ems.ts`

### Market Data

- [EPİAŞ Prices](https://github.com/emirhannavdar/ges_depolama/blob/main/api/epias.py): `api/epias.py`
- [Weather Service](https://github.com/emirhannavdar/ges_depolama/blob/main/api/visual_crossing.py): `api/visual_crossing.py`
- [Solar Forecast](https://github.com/emirhannavdar/ges_depolama/blob/main/api/forecast.py): `api/forecast.py`
- [Price Matching](https://github.com/emirhannavdar/ges_depolama/blob/main/api/pricing.py): `api/pricing.py`

### Planning

- [Battery Model](https://github.com/emirhannavdar/ges_depolama/blob/main/api/battery.py): `api/battery.py`
- [Schedule Optimizer](https://github.com/emirhannavdar/ges_depolama/blob/main/api/optimizer.py): `api/optimizer.py`
- [EMS Bridge](https://github.com/emirhannavdar/ges_depolama/blob/main/api/ems_bridge.py): `api/ems_bridge.py`

### Simulation

- [FastAPI Router](https://github.com/emirhannavdar/ges_depolama/blob/main/api/api.py): `api/api.py`
- [Simulation API](https://github.com/emirhannavdar/ges_depolama/blob/main/api/simulator_api.py): `api/simulator_api.py`
- [Virtual Simulator](https://github.com/emirhannavdar/ges_depolama/blob/main/api/simulator.py): `api/simulator.py`
- [Session Store](https://github.com/emirhannavdar/ges_depolama/blob/main/api/simulation_storage.py): `api/simulation_storage.py`

### Digital Twin

- [Twin Engine](https://github.com/emirhannavdar/ges_depolama/blob/main/api/digital_twin.py): `api/digital_twin.py`
- [Daily Reports](https://github.com/emirhannavdar/ges_depolama/blob/main/api/digital_twin_report.py): `api/digital_twin_report.py`

### Other components

- **Operator**
- **Visual Crossing**
- **Browser**

## Connections

- Operator → Dashboard App: configures (evidence: `README.md`)
- Dashboard App → Scenario Helpers: uses (evidence: `ges-ems-dashboard/src/App.tsx`)
- Dashboard App → API Client: requests (evidence: `ges-ems-dashboard/src/App.tsx`)
- Twin View → API Client: requests (evidence: `ges-ems-dashboard/src/DigitalTwin.tsx`)
- Browser → FastAPI Router: calls
- FastAPI Router → EPİAŞ Prices: mounts (evidence: `api/api.py`)
- FastAPI Router → Weather Service: mounts (evidence: `api/api.py`)
- FastAPI Router → Solar Forecast: mounts (evidence: `api/api.py`)
- FastAPI Router → Price Matching: mounts (evidence: `api/api.py`)
- FastAPI Router → Schedule Optimizer: mounts (evidence: `api/api.py`)
- FastAPI Router → Simulation API: mounts (evidence: `api/api.py`)
- FastAPI Router → EMS Bridge: mounts (evidence: `api/api.py`)
- FastAPI Router → Twin Engine: mounts (evidence: `api/api.py`)
- Price Matching → EPİAŞ Prices: fetches prices (evidence: `api/pricing.py`)
- Price Matching → Weather Service: fetches weather (evidence: `api/pricing.py`)
- Price Matching → Solar Forecast: builds forecast (evidence: `api/pricing.py`)
- Schedule Optimizer → Price Matching: gets prices (evidence: `api/optimizer.py`)
- Schedule Optimizer → Battery Model: uses model (evidence: `api/optimizer.py`)
- Simulation API → Virtual Simulator: runs (evidence: `api/simulator_api.py`)
- Simulation API → Session Store: persists sessions (evidence: `api/simulator_api.py`)
- EMS Bridge → EPİAŞ Prices: uses credentials (evidence: `api/ems_bridge.py`)
- Twin Engine → Visual Crossing: fetches hourly data (evidence: `api/digital_twin.py`)
- Twin Engine → Daily Reports: creates reports (evidence: `api/digital_twin.py`)
- API Client → FastAPI Router: sends requests (evidence: `ges-ems-dashboard/src/api.ts`)
