# mihaelbaranasic/weatheris architecture

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

- Interactive diagram: https://gitdiagram.com/mihaelbaranasic/weatheris
- Repository: https://github.com/mihaelbaranasic/weatheris

## Overview

WeatherIS collects public and simulated weather data, stores sensor observations and forecasts, and serves a React dashboard with live updates, alerts, and prediction evaluation. The principal workflow runs from sensor/weather acquisition through synchronization and persistence, then API queries or ML forecasting to dashboard views. Alert subscriptions and scheduled alert checks form a separate capability. The source excerpts show synchronization, prediction, and routing details; links for unsampled UI pages and live SignalR wiring rely on README statements or are omitted where evidence is insufficient.

Main entry points: [`WeatherISAPI/WeatherISAPI/Services/DataSyncService.cs`](https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WeatherISAPI/Services/DataSyncService.cs) (Scheduled sync), [`WeatherISAPI/WheatherISDB/Repositories/SensorRepository.cs`](https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WheatherISDB/Repositories/SensorRepository.cs) (Sensor repository), [`WeatherISAPI/WeatherISAPI/Controllers/WeatherController.cs`](https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WeatherISAPI/Controllers/WeatherController.cs) (Weather endpoints), [`WeatherISAPI/WeatherISAPI/Controllers/PredictionsController.cs`](https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WeatherISAPI/Controllers/PredictionsController.cs) (Prediction endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Dashboard"]
  node_app["Page routing<br/>[App.jsx]"]
  node_dashboard["Dashboard views"]
  node_clientapi["API client<br/>[api.js]"]
  node_evaluation["Model evaluation<br/>[Evaluation.jsx]"]
end

subgraph group_api["API and ingestion"]
  node_weatherctrl["Weather endpoints"]
  node_sensorctrl["Sensor endpoints"]
  node_predctrl["Prediction endpoints"]
  node_alertctrl["Alert endpoints"]
  node_subctrl["Subscription endpoints"]
  node_sync["Scheduled sync<br/>[DataSyncService.cs]"]
  node_simulator["IoT simulator"]
  node_openmeteo["Weather provider"]
  node_weatherhub["Weather stream<br/>[WeatherHub.cs]"]
  node_sensorhub["Sensor stream<br/>[SensorHub.cs]"]
  node_email["Email delivery<br/>[EmailService.cs]"]
end

subgraph group_domain["Forecasting and alerts"]
  node_ml["Forecast models"]
end

subgraph group_storage["Persistence"]
  node_sensorrepo["Sensor repository"]
  node_predictionrepo["Prediction repository"]
  node_alertrepo["Alert repository<br/>[AlertRepository.cs]"]
  node_subscriptionrepo["Subscription repository"]
  node_database[("Weather database<br/>[AppDbContext.cs]")]
end

node_user(("Weather user"))
node_externalweather(("Open-Meteo"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_dashboard
node_user -.->|"requests data"| node_clientapi
node_clientapi -.->|"calls API"| node_weatherctrl
node_clientapi -.->|"calls API"| node_predctrl
node_clientapi -->|"supplies data"| node_evaluation
node_weatherctrl -->|"fetches weather"| node_openmeteo
node_weatherctrl -->|"reads sensors"| node_sensorrepo
node_weatherctrl -->|"sends alerts"| node_email
node_weatherctrl -->|"records alerts"| node_alertrepo
node_sensorctrl -->|"queries sensors"| node_sensorrepo
node_predctrl -->|"loads sensors"| node_sensorrepo
node_predctrl -->|"reads forecasts"| node_predictionrepo
node_predctrl -->|"generates forecasts"| node_ml
node_predctrl -->|"fetches weather"| node_openmeteo
node_subctrl -->|"manages subscriptions"| node_subscriptionrepo
node_sync -->|"loads active sensors"| node_sensorrepo
node_sync -->|"fetches forecasts"| node_openmeteo
node_sync -->|"stores forecasts"| node_predictionrepo
node_sync -->|"checks alerts"| node_alertrepo
node_sync -->|"loads subscribers"| node_subscriptionrepo
node_sync -->|"sends notifications"| node_email
node_simulator -->|"writes readings"| node_sensorrepo
node_simulator -->|"broadcasts readings"| node_sensorhub
node_openmeteo -->|"requests data"| node_externalweather
node_sensorrepo -->|"reads and writes"| node_database
node_predictionrepo -->|"reads and writes"| node_database
node_alertrepo -->|"reads and writes"| node_database
node_subscriptionrepo -->|"reads and writes"| node_database
node_weatherhub -.->|"streams live updates"| node_dashboard
node_sensorhub -.->|"streams live updates"| node_dashboard
node_user -->|"views forecasts and alerts"| node_dashboard

click node_app "https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/weatheris-client/src/App.jsx"
click node_dashboard "https://github.com/mihaelbaranasic/weatheris/tree/main/WeatherISAPI/weatheris-client/src/pages"
click node_clientapi "https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/weatheris-client/src/services/api.js"
click node_evaluation "https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/weatheris-client/src/pages/Evaluation.jsx"
click node_weatherctrl "https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WeatherISAPI/Controllers/WeatherController.cs"
click node_sensorctrl "https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WeatherISAPI/Controllers/SensorsController.cs"
click node_predctrl "https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WeatherISAPI/Controllers/PredictionsController.cs"
click node_alertctrl "https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WeatherISAPI/Controllers/AlertsController.cs"
click node_subctrl "https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WeatherISAPI/Controllers/SubscriptionController.cs"
click node_sync "https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WeatherISAPI/Services/DataSyncService.cs"
click node_simulator "https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WeatherISAPI/Services/IoTSimulatorService.cs"
click node_openmeteo "https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WeatherISAPI/Services/OpenMeteoService.cs"
click node_weatherhub "https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WeatherISAPI/Hubs/WeatherHub.cs"
click node_sensorhub "https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WeatherISAPI/Hubs/SensorHub.cs"
click node_email "https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WeatherISAPI/Services/EmailService.cs"
click node_ml "https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WeatherISML/Services/WeatherPredictionService.cs"
click node_sensorrepo "https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WheatherISDB/Repositories/SensorRepository.cs"
click node_predictionrepo "https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WheatherISDB/Repositories/PredictionRepository.cs"
click node_alertrepo "https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WheatherISDB/Repositories/AlertRepository.cs"
click node_subscriptionrepo "https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WheatherISDB/Repositories/EmailSubscriptionRepository.cs"
click node_database "https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WheatherISDB/AppDbContext.cs"

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_dashboard,node_clientapi,node_evaluation,node_user toneBlue
class node_weatherctrl,node_sensorctrl,node_predctrl,node_alertctrl,node_subctrl,node_sync,node_simulator,node_openmeteo,node_weatherhub,node_sensorhub,node_email toneAmber
class node_ml toneMint
class node_sensorrepo,node_predictionrepo,node_alertrepo,node_subscriptionrepo,node_database toneRose
class node_externalweather toneIndigo
```

## Components

### Dashboard

- [Page routing](https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/weatheris-client/src/App.jsx): `WeatherISAPI/weatheris-client/src/App.jsx`
- [Dashboard views](https://github.com/mihaelbaranasic/weatheris/tree/main/WeatherISAPI/weatheris-client/src/pages): `WeatherISAPI/weatheris-client/src/pages`
- [API client](https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/weatheris-client/src/services/api.js): `WeatherISAPI/weatheris-client/src/services/api.js`
- [Model evaluation](https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/weatheris-client/src/pages/Evaluation.jsx): `WeatherISAPI/weatheris-client/src/pages/Evaluation.jsx`

### API and ingestion

- [Weather endpoints](https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WeatherISAPI/Controllers/WeatherController.cs): `WeatherISAPI/WeatherISAPI/Controllers/WeatherController.cs`
- [Sensor endpoints](https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WeatherISAPI/Controllers/SensorsController.cs): `WeatherISAPI/WeatherISAPI/Controllers/SensorsController.cs`
- [Prediction endpoints](https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WeatherISAPI/Controllers/PredictionsController.cs): `WeatherISAPI/WeatherISAPI/Controllers/PredictionsController.cs`
- [Alert endpoints](https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WeatherISAPI/Controllers/AlertsController.cs): `WeatherISAPI/WeatherISAPI/Controllers/AlertsController.cs`
- [Subscription endpoints](https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WeatherISAPI/Controllers/SubscriptionController.cs): `WeatherISAPI/WeatherISAPI/Controllers/SubscriptionController.cs`
- [Scheduled sync](https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WeatherISAPI/Services/DataSyncService.cs): `WeatherISAPI/WeatherISAPI/Services/DataSyncService.cs`
- [IoT simulator](https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WeatherISAPI/Services/IoTSimulatorService.cs): `WeatherISAPI/WeatherISAPI/Services/IoTSimulatorService.cs`
- [Weather provider](https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WeatherISAPI/Services/OpenMeteoService.cs): `WeatherISAPI/WeatherISAPI/Services/OpenMeteoService.cs`
- [Weather stream](https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WeatherISAPI/Hubs/WeatherHub.cs): `WeatherISAPI/WeatherISAPI/Hubs/WeatherHub.cs`
- [Sensor stream](https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WeatherISAPI/Hubs/SensorHub.cs): `WeatherISAPI/WeatherISAPI/Hubs/SensorHub.cs`
- [Email delivery](https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WeatherISAPI/Services/EmailService.cs): `WeatherISAPI/WeatherISAPI/Services/EmailService.cs`

### Forecasting and alerts

- [Forecast models](https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WeatherISML/Services/WeatherPredictionService.cs): `WeatherISAPI/WeatherISML/Services/WeatherPredictionService.cs`

### Persistence

- [Sensor repository](https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WheatherISDB/Repositories/SensorRepository.cs): `WeatherISAPI/WheatherISDB/Repositories/SensorRepository.cs`
- [Prediction repository](https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WheatherISDB/Repositories/PredictionRepository.cs): `WeatherISAPI/WheatherISDB/Repositories/PredictionRepository.cs`
- [Alert repository](https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WheatherISDB/Repositories/AlertRepository.cs): `WeatherISAPI/WheatherISDB/Repositories/AlertRepository.cs`
- [Subscription repository](https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WheatherISDB/Repositories/EmailSubscriptionRepository.cs): `WeatherISAPI/WheatherISDB/Repositories/EmailSubscriptionRepository.cs`
- [Weather database](https://github.com/mihaelbaranasic/weatheris/blob/main/WeatherISAPI/WheatherISDB/AppDbContext.cs): `WeatherISAPI/WheatherISDB/AppDbContext.cs`

### Other components

- **Weather user**
- **Open-Meteo**

## Connections

- Weather user → Page routing: uses
- Page routing → Dashboard views: routes to (evidence: `WeatherISAPI/weatheris-client/src/App.jsx`)
- Weather user → API client: requests data
- API client → Weather endpoints: calls API
- API client → Prediction endpoints: calls API
- API client → Model evaluation: supplies data (evidence: `WeatherISAPI/weatheris-client/src/pages/Evaluation.jsx`)
- Weather endpoints → Weather provider: fetches weather (evidence: `WeatherISAPI/WeatherISAPI/Controllers/WeatherController.cs`)
- Weather endpoints → Sensor repository: reads sensors (evidence: `WeatherISAPI/WeatherISAPI/Controllers/WeatherController.cs`)
- Weather endpoints → Email delivery: sends alerts (evidence: `WeatherISAPI/WeatherISAPI/Controllers/WeatherController.cs`)
- Weather endpoints → Alert repository: records alerts (evidence: `WeatherISAPI/WeatherISAPI/Controllers/WeatherController.cs`)
- Sensor endpoints → Sensor repository: queries sensors (evidence: `WeatherISAPI/WeatherISAPI/Controllers/SensorsController.cs`)
- Prediction endpoints → Sensor repository: loads sensors (evidence: `WeatherISAPI/WeatherISAPI/Controllers/PredictionsController.cs`)
- Prediction endpoints → Prediction repository: reads forecasts (evidence: `WeatherISAPI/WeatherISAPI/Controllers/PredictionsController.cs`)
- Prediction endpoints → Forecast models: generates forecasts (evidence: `WeatherISAPI/WeatherISAPI/Controllers/PredictionsController.cs`)
- Prediction endpoints → Weather provider: fetches weather (evidence: `WeatherISAPI/WeatherISAPI/Controllers/PredictionsController.cs`)
- Subscription endpoints → Subscription repository: manages subscriptions (evidence: `WeatherISAPI/WeatherISAPI/Controllers/SubscriptionController.cs`)
- Scheduled sync → Sensor repository: loads active sensors (evidence: `WeatherISAPI/WeatherISAPI/Services/DataSyncService.cs`)
- Scheduled sync → Weather provider: fetches forecasts (evidence: `WeatherISAPI/WeatherISAPI/Services/DataSyncService.cs`)
- Scheduled sync → Prediction repository: stores forecasts (evidence: `WeatherISAPI/WeatherISAPI/Services/DataSyncService.cs`)
- Scheduled sync → Alert repository: checks alerts (evidence: `WeatherISAPI/WeatherISAPI/Services/DataSyncService.cs`)
- Scheduled sync → Subscription repository: loads subscribers (evidence: `WeatherISAPI/WeatherISAPI/Services/DataSyncService.cs`)
- Scheduled sync → Email delivery: sends notifications (evidence: `WeatherISAPI/WeatherISAPI/Services/DataSyncService.cs`)
- IoT simulator → Sensor repository: writes readings (evidence: `WeatherISAPI/WeatherISAPI/Services/IoTSimulatorService.cs`)
- IoT simulator → Sensor stream: broadcasts readings (evidence: `WeatherISAPI/WeatherISAPI/Services/IoTSimulatorService.cs`)
- Weather provider → Open-Meteo: requests data (evidence: `WeatherISAPI/WeatherISAPI/Services/OpenMeteoService.cs`)
- Sensor repository → Weather database: reads and writes (evidence: `WeatherISAPI/WheatherISDB/Repositories/SensorRepository.cs`)
- Prediction repository → Weather database: reads and writes (evidence: `WeatherISAPI/WheatherISDB/Repositories/PredictionRepository.cs`)
- Alert repository → Weather database: reads and writes (evidence: `WeatherISAPI/WheatherISDB/Repositories/AlertRepository.cs`)
- Subscription repository → Weather database: reads and writes (evidence: `WeatherISAPI/WheatherISDB/Repositories/EmailSubscriptionRepository.cs`)
- Weather stream → Dashboard views: streams live updates (evidence: `README.md`)
- Sensor stream → Dashboard views: streams live updates (evidence: `README.md`)
- Weather user → Dashboard views: views forecasts and alerts (evidence: `README.md`)
