# atemur/datacase architecture

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

- Interactive diagram: https://gitdiagram.com/atemur/datacase
- Repository: https://github.com/atemur/datacase

## Overview

DataCase is a Streamlit electricity-market analytics app backed by the EPİAŞ Transparency Platform. Users choose a dashboard, select organizations or units, and view retrieved market, real-time generation, or finalized daily production-plan data in tables and charts. The graph follows the documented and excerpted calls through page routing, organization matching or plant/UEVCB lookup, and API clients; authentication and date/endpoint settings are shared internal layers. Evidence is limited to the README and indexed excerpts; no other source was inspected.

Main entry points: [`config/settings.py`](https://github.com/atemur/datacase/blob/main/config/settings.py) (Dates and endpoints), [`core/auth.py`](https://github.com/atemur/datacase/blob/main/core/auth.py) (TGT authentication), [`streamlit_app/realtime_view.py`](https://github.com/atemur/datacase/blob/main/streamlit_app/realtime_view.py) (Realtime dashboard), [`streamlit_app/fdpp_view.py`](https://github.com/atemur/datacase/blob/main/streamlit_app/fdpp_view.py) (FDPP dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Streamlit dashboards"]
  node_router["Page selector<br/>[streamlit_run.py]"]
  node_market_view["Market dashboard<br/>[market_view.py]"]
  node_realtime_view["Realtime dashboard<br/>[realtime_view.py]"]
  node_fdpp_view["FDPP dashboard<br/>[fdpp_view.py]"]
end

subgraph group_domain["Organization and generation"]
  node_matching["GZU matching<br/>[matching.py]"]
  node_org_data["Plant and UEVCB lookup"]
end

subgraph group_api["EPİAŞ API clients"]
  node_market_client["Market data client<br/>[market.py]"]
  node_org_client["Organization client<br/>[organisation.py]"]
  node_generation_client["Generation client<br/>[generation.py]"]
end

subgraph group_shared["Shared configuration"]
  node_auth["TGT authentication<br/>[auth.py]"]
  node_settings["Dates and endpoints<br/>[settings.py]"]
end

node_user(("Dashboard user"))
node_epias{{"EPİAŞ platform"}}

node_user -->|"selects page"| node_router
node_router -->|"routes to"| node_market_view
node_router -->|"routes to"| node_realtime_view
node_router -->|"routes to"| node_fdpp_view
node_user -->|"selects organizations"| node_market_view
node_market_view -->|"fetches market data"| node_market_client
node_user -->|"selects organizations"| node_realtime_view
node_realtime_view -->|"matches GZUs"| node_matching
node_realtime_view -->|"fetches generation"| node_generation_client
node_matching -->|"fetches plant lists"| node_org_client
node_user -->|"selects organizations"| node_fdpp_view
node_fdpp_view -->|"looks up plants and UEVCBs"| node_org_data
node_fdpp_view -->|"fetches production plan"| node_generation_client
node_org_data -->|"fetches plants and UEVCBs"| node_org_client
node_market_client -->|"requests market data"| node_epias
node_org_client -->|"requests organization data"| node_epias
node_generation_client -->|"requests generation data"| node_epias
node_auth -->|"requests TGT"| node_epias
node_market_view -->|"uses token"| node_auth
node_realtime_view -->|"uses token"| node_auth
node_fdpp_view -->|"uses token"| node_auth
node_matching -->|"uses token"| node_auth
node_org_data -->|"uses token"| node_auth
node_market_client -->|"reads endpoints"| node_settings
node_org_client -->|"reads endpoints"| node_settings
node_generation_client -->|"reads endpoints"| node_settings
node_auth -->|"reads credentials"| node_settings
node_market_view -->|"reads dates and organizations"| node_settings
node_realtime_view -->|"reads dates and organizations"| node_settings
node_fdpp_view -->|"reads dates and organizations"| node_settings
node_matching -->|"reads dates"| node_settings
node_org_data -->|"reads dates"| node_settings

click node_router "https://github.com/atemur/datacase/blob/main/streamlit_run.py"
click node_market_view "https://github.com/atemur/datacase/blob/main/streamlit_app/market_view.py"
click node_realtime_view "https://github.com/atemur/datacase/blob/main/streamlit_app/realtime_view.py"
click node_fdpp_view "https://github.com/atemur/datacase/blob/main/streamlit_app/fdpp_view.py"
click node_matching "https://github.com/atemur/datacase/blob/main/utils/matching.py"
click node_org_data "https://github.com/atemur/datacase/blob/main/utils/organisation_data.py"
click node_market_client "https://github.com/atemur/datacase/blob/main/api/market.py"
click node_org_client "https://github.com/atemur/datacase/blob/main/api/organisation.py"
click node_generation_client "https://github.com/atemur/datacase/blob/main/api/generation.py"
click node_auth "https://github.com/atemur/datacase/blob/main/core/auth.py"
click node_settings "https://github.com/atemur/datacase/blob/main/config/settings.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_router,node_market_view,node_realtime_view,node_fdpp_view,node_user toneBlue
class node_matching,node_org_data toneAmber
class node_market_client,node_org_client,node_generation_client toneMint
class node_auth,node_settings toneRose
class node_epias toneIndigo
```

## Components

### Streamlit dashboards

- [Page selector](https://github.com/atemur/datacase/blob/main/streamlit_run.py): `streamlit_run.py`
- [Market dashboard](https://github.com/atemur/datacase/blob/main/streamlit_app/market_view.py): `streamlit_app/market_view.py`
- [Realtime dashboard](https://github.com/atemur/datacase/blob/main/streamlit_app/realtime_view.py): `streamlit_app/realtime_view.py`
- [FDPP dashboard](https://github.com/atemur/datacase/blob/main/streamlit_app/fdpp_view.py): `streamlit_app/fdpp_view.py`

### Organization and generation

- [GZU matching](https://github.com/atemur/datacase/blob/main/utils/matching.py): `utils/matching.py`
- [Plant and UEVCB lookup](https://github.com/atemur/datacase/blob/main/utils/organisation_data.py): `utils/organisation_data.py`

### EPİAŞ API clients

- [Market data client](https://github.com/atemur/datacase/blob/main/api/market.py): `api/market.py`
- [Organization client](https://github.com/atemur/datacase/blob/main/api/organisation.py): `api/organisation.py`
- [Generation client](https://github.com/atemur/datacase/blob/main/api/generation.py): `api/generation.py`

### Shared configuration

- [TGT authentication](https://github.com/atemur/datacase/blob/main/core/auth.py): `core/auth.py`
- [Dates and endpoints](https://github.com/atemur/datacase/blob/main/config/settings.py): `config/settings.py`

### Other components

- **Dashboard user**
- **EPİAŞ platform**

## Connections

- Dashboard user → Page selector: selects page (evidence: `streamlit_run.py`)
- Page selector → Market dashboard: routes to (evidence: `streamlit_run.py`)
- Page selector → Realtime dashboard: routes to (evidence: `streamlit_run.py`)
- Page selector → FDPP dashboard: routes to (evidence: `streamlit_run.py`)
- Dashboard user → Market dashboard: selects organizations (evidence: `streamlit_app/market_view.py`)
- Market dashboard → Market data client: fetches market data (evidence: `streamlit_app/market_view.py`)
- Dashboard user → Realtime dashboard: selects organizations (evidence: `streamlit_app/realtime_view.py`)
- Realtime dashboard → GZU matching: matches GZUs (evidence: `streamlit_app/realtime_view.py`)
- Realtime dashboard → Generation client: fetches generation (evidence: `streamlit_app/realtime_view.py`)
- GZU matching → Organization client: fetches plant lists (evidence: `utils/matching.py`)
- Dashboard user → FDPP dashboard: selects organizations (evidence: `streamlit_app/fdpp_view.py`)
- FDPP dashboard → Plant and UEVCB lookup: looks up plants and UEVCBs (evidence: `streamlit_app/fdpp_view.py`)
- FDPP dashboard → Generation client: fetches production plan (evidence: `streamlit_app/fdpp_view.py`)
- Plant and UEVCB lookup → Organization client: fetches plants and UEVCBs (evidence: `utils/organisation_data.py`)
- Market data client → EPİAŞ platform: requests market data (evidence: `api/market.py`)
- Organization client → EPİAŞ platform: requests organization data (evidence: `api/organisation.py`)
- Generation client → EPİAŞ platform: requests generation data (evidence: `api/generation.py`)
- TGT authentication → EPİAŞ platform: requests TGT (evidence: `core/auth.py`)
- Market dashboard → TGT authentication: uses token (evidence: `streamlit_app/market_view.py`)
- Realtime dashboard → TGT authentication: uses token (evidence: `streamlit_app/realtime_view.py`)
- FDPP dashboard → TGT authentication: uses token (evidence: `streamlit_app/fdpp_view.py`)
- GZU matching → TGT authentication: uses token (evidence: `utils/matching.py`)
- Plant and UEVCB lookup → TGT authentication: uses token (evidence: `utils/organisation_data.py`)
- Market data client → Dates and endpoints: reads endpoints (evidence: `api/market.py`)
- Organization client → Dates and endpoints: reads endpoints (evidence: `api/organisation.py`)
- Generation client → Dates and endpoints: reads endpoints (evidence: `api/generation.py`)
- TGT authentication → Dates and endpoints: reads credentials (evidence: `core/auth.py`)
- Market dashboard → Dates and endpoints: reads dates and organizations (evidence: `streamlit_app/market_view.py`)
- Realtime dashboard → Dates and endpoints: reads dates and organizations (evidence: `streamlit_app/realtime_view.py`)
- FDPP dashboard → Dates and endpoints: reads dates and organizations (evidence: `streamlit_app/fdpp_view.py`)
- GZU matching → Dates and endpoints: reads dates (evidence: `utils/matching.py`)
- Plant and UEVCB lookup → Dates and endpoints: reads dates (evidence: `utils/organisation_data.py`)
