# mohammed-hatem/weather_monitoring_station architecture

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

- Interactive diagram: https://gitdiagram.com/mohammed-hatem/weather_monitoring_station
- Repository: https://github.com/mohammed-hatem/weather_monitoring_station

## Overview

This is a distributed weather-monitoring product: station simulators and an optional Open-Meteo adapter publish status events to Kafka; the central service consumes them, archives every event to partitioned Parquet, and keeps the latest non-drop reading in BitCask for REST queries. A separate Kafka Streams detector emits rain alerts. README also documents Parquet shipping to Elasticsearch/Kibana. The excerpts show the station, ingestion, storage, REST, and Open-Meteo paths; shipper and detector links follow README descriptions, and infrastructure wiring is not inferred.

Main entry points: [`central-station/src/main/java/com/ddia/centralstation/consumer/KafkaWeatherConsumer.java`](https://github.com/mohammed-hatem/weather_monitoring_station/blob/main/central-station/src/main/java/com/ddia/centralstation/consumer/KafkaWeatherConsumer.java) (Weather Consumer), [`open-meteo-integration/src/main/java/com/ddia/openmeteo/config/IntegrationConfig.java`](https://github.com/mohammed-hatem/weather_monitoring_station/blob/main/open-meteo-integration/src/main/java/com/ddia/openmeteo/config/IntegrationConfig.java) (Open-Meteo Adapter), [`central-station/src/main/java/com/ddia/centralstation/bitcask/BitCask.java`](https://github.com/mohammed-hatem/weather_monitoring_station/blob/main/central-station/src/main/java/com/ddia/centralstation/bitcask/BitCask.java) (BitCask Store), [`weather-station/src/main/java/com/ddia/weatherstation/WeatherStationApp.java`](https://github.com/mohammed-hatem/weather_monitoring_station/blob/main/weather-station/src/main/java/com/ddia/weatherstation/WeatherStationApp.java) (Station Simulator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_producers["Weather Producers"]
  node_stations["Station Simulator"]
  node_station_models["Station Messages"]
  node_meteo["Open-Meteo Adapter"]
  node_meteo_models["Virtual Station Models"]
end

subgraph group_streaming["Kafka Streams"]
  node_rain_detector["Rain Detector"]
end

subgraph group_central["Central Station"]
  node_central_consumer["Weather Consumer"]
  node_central_models["Weather Status Model"]
  node_bitcask[("BitCask Store<br/>[BitCask.java]")]
  node_keydir["Key Directory Entry<br/>[KeyDirEntry.java]"]
  node_archiver["Parquet Archiver"]
  node_rest["BitCask REST API"]
end

subgraph group_analytics["Analytics"]
  node_shipper["Parquet Shipper<br/>[shipper.py]"]
end

node_kafka["Kafka Topics"]
node_meteo_api["Open-Meteo API"]
node_alerts["Rain Alerts"]
node_parquet[("Partitioned Parquet")]
node_client(("BitCask Client<br/>[bitcask_client.sh]"))
node_elasticsearch[("Elasticsearch")]
node_kibana["Kibana"]

node_stations -->|"builds messages"| node_station_models
node_stations -->|"publishes status"| node_kafka
node_meteo_api -->|"provides weather"| node_meteo
node_meteo -->|"transforms response"| node_meteo_models
node_meteo -->|"publishes status"| node_kafka
node_kafka -->|"delivers status"| node_central_consumer
node_central_consumer -->|"deserializes"| node_central_models
node_central_consumer -->|"writes latest"| node_bitcask
node_bitcask -->|"indexes locations"| node_keydir
node_central_consumer -->|"archives events"| node_archiver
node_archiver -->|"writes batches"| node_parquet
node_rest -->|"queries and compacts"| node_bitcask
node_client -->|"calls endpoints"| node_rest
node_kafka -->|"streams status"| node_rain_detector
node_rain_detector -->|"emits rain alerts"| node_alerts
node_parquet -->|"ships files"| node_shipper
node_shipper -->|"indexes batches"| node_elasticsearch
node_elasticsearch -->|"visualizes data"| node_kibana

click node_stations "https://github.com/mohammed-hatem/weather_monitoring_station/blob/main/weather-station/src/main/java/com/ddia/weatherstation/WeatherStationApp.java"
click node_station_models "https://github.com/mohammed-hatem/weather_monitoring_station/blob/main/weather-station/src/main/java/com/ddia/weatherstation/model/WeatherStatusMessage.java"
click node_meteo "https://github.com/mohammed-hatem/weather_monitoring_station/blob/main/open-meteo-integration/src/main/java/com/ddia/openmeteo/config/IntegrationConfig.java"
click node_meteo_models "https://github.com/mohammed-hatem/weather_monitoring_station/blob/main/open-meteo-integration/src/main/java/com/ddia/openmeteo/model/WeatherStatusMessage.java"
click node_rain_detector "https://github.com/mohammed-hatem/weather_monitoring_station/blob/main/kafka-processor/src/main/java/com/ddia/kafkaprocessor/RainDetectorProcessor.java"
click node_central_consumer "https://github.com/mohammed-hatem/weather_monitoring_station/blob/main/central-station/src/main/java/com/ddia/centralstation/consumer/KafkaWeatherConsumer.java"
click node_central_models "https://github.com/mohammed-hatem/weather_monitoring_station/blob/main/central-station/src/main/java/com/ddia/centralstation/model/WeatherStatusMessage.java"
click node_bitcask "https://github.com/mohammed-hatem/weather_monitoring_station/blob/main/central-station/src/main/java/com/ddia/centralstation/bitcask/BitCask.java"
click node_keydir "https://github.com/mohammed-hatem/weather_monitoring_station/blob/main/central-station/src/main/java/com/ddia/centralstation/bitcask/KeyDirEntry.java"
click node_archiver "https://github.com/mohammed-hatem/weather_monitoring_station/blob/main/central-station/src/main/java/com/ddia/centralstation/archiver/ParquetArchiver.java"
click node_rest "https://github.com/mohammed-hatem/weather_monitoring_station/blob/main/central-station/src/main/java/com/ddia/centralstation/controller/BitCaskController.java"
click node_client "https://github.com/mohammed-hatem/weather_monitoring_station/blob/main/bitcask_client.sh"
click node_shipper "https://github.com/mohammed-hatem/weather_monitoring_station/blob/main/parquet-shipper/shipper.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_stations,node_station_models,node_meteo,node_meteo_models,node_client toneBlue
class node_rain_detector,node_parquet,node_elasticsearch toneAmber
class node_central_consumer,node_central_models,node_bitcask,node_keydir,node_archiver,node_rest,node_meteo_api toneMint
class node_shipper toneRose
class node_kafka,node_alerts,node_kibana toneIndigo
```

## Components

### Weather Producers

- [Station Simulator](https://github.com/mohammed-hatem/weather_monitoring_station/blob/main/weather-station/src/main/java/com/ddia/weatherstation/WeatherStationApp.java): `weather-station/src/main/java/com/ddia/weatherstation/WeatherStationApp.java`
- [Station Messages](https://github.com/mohammed-hatem/weather_monitoring_station/blob/main/weather-station/src/main/java/com/ddia/weatherstation/model/WeatherStatusMessage.java): `weather-station/src/main/java/com/ddia/weatherstation/model/WeatherStatusMessage.java`
- [Open-Meteo Adapter](https://github.com/mohammed-hatem/weather_monitoring_station/blob/main/open-meteo-integration/src/main/java/com/ddia/openmeteo/config/IntegrationConfig.java): `open-meteo-integration/src/main/java/com/ddia/openmeteo/config/IntegrationConfig.java`
- [Virtual Station Models](https://github.com/mohammed-hatem/weather_monitoring_station/blob/main/open-meteo-integration/src/main/java/com/ddia/openmeteo/model/WeatherStatusMessage.java): `open-meteo-integration/src/main/java/com/ddia/openmeteo/model/WeatherStatusMessage.java`

### Kafka Streams

- [Rain Detector](https://github.com/mohammed-hatem/weather_monitoring_station/blob/main/kafka-processor/src/main/java/com/ddia/kafkaprocessor/RainDetectorProcessor.java): `kafka-processor/src/main/java/com/ddia/kafkaprocessor/RainDetectorProcessor.java`

### Central Station

- [Weather Consumer](https://github.com/mohammed-hatem/weather_monitoring_station/blob/main/central-station/src/main/java/com/ddia/centralstation/consumer/KafkaWeatherConsumer.java): `central-station/src/main/java/com/ddia/centralstation/consumer/KafkaWeatherConsumer.java`
- [Weather Status Model](https://github.com/mohammed-hatem/weather_monitoring_station/blob/main/central-station/src/main/java/com/ddia/centralstation/model/WeatherStatusMessage.java): `central-station/src/main/java/com/ddia/centralstation/model/WeatherStatusMessage.java`
- [BitCask Store](https://github.com/mohammed-hatem/weather_monitoring_station/blob/main/central-station/src/main/java/com/ddia/centralstation/bitcask/BitCask.java): `central-station/src/main/java/com/ddia/centralstation/bitcask/BitCask.java`
- [Key Directory Entry](https://github.com/mohammed-hatem/weather_monitoring_station/blob/main/central-station/src/main/java/com/ddia/centralstation/bitcask/KeyDirEntry.java): `central-station/src/main/java/com/ddia/centralstation/bitcask/KeyDirEntry.java`
- [Parquet Archiver](https://github.com/mohammed-hatem/weather_monitoring_station/blob/main/central-station/src/main/java/com/ddia/centralstation/archiver/ParquetArchiver.java): `central-station/src/main/java/com/ddia/centralstation/archiver/ParquetArchiver.java`
- [BitCask REST API](https://github.com/mohammed-hatem/weather_monitoring_station/blob/main/central-station/src/main/java/com/ddia/centralstation/controller/BitCaskController.java): `central-station/src/main/java/com/ddia/centralstation/controller/BitCaskController.java`

### Analytics

- [Parquet Shipper](https://github.com/mohammed-hatem/weather_monitoring_station/blob/main/parquet-shipper/shipper.py): `parquet-shipper/shipper.py`

### Other components

- **Kafka Topics**
- **Open-Meteo API**
- **Rain Alerts**
- **Partitioned Parquet**
- [BitCask Client](https://github.com/mohammed-hatem/weather_monitoring_station/blob/main/bitcask_client.sh): `bitcask_client.sh`
- **Elasticsearch**
- **Kibana**

## Connections

- Station Simulator → Station Messages: builds messages (evidence: `weather-station/src/main/java/com/ddia/weatherstation/WeatherStationApp.java`)
- Station Simulator → Kafka Topics: publishes status (evidence: `weather-station/src/main/java/com/ddia/weatherstation/WeatherStationApp.java`)
- Open-Meteo API → Open-Meteo Adapter: provides weather (evidence: `open-meteo-integration/src/main/java/com/ddia/openmeteo/config/IntegrationConfig.java`)
- Open-Meteo Adapter → Virtual Station Models: transforms response (evidence: `open-meteo-integration/src/main/java/com/ddia/openmeteo/config/IntegrationConfig.java`)
- Open-Meteo Adapter → Kafka Topics: publishes status (evidence: `open-meteo-integration/src/main/java/com/ddia/openmeteo/config/IntegrationConfig.java`)
- Kafka Topics → Weather Consumer: delivers status (evidence: `central-station/src/main/java/com/ddia/centralstation/consumer/KafkaWeatherConsumer.java`)
- Weather Consumer → Weather Status Model: deserializes (evidence: `central-station/src/main/java/com/ddia/centralstation/consumer/KafkaWeatherConsumer.java`)
- Weather Consumer → BitCask Store: writes latest (evidence: `central-station/src/main/java/com/ddia/centralstation/consumer/KafkaWeatherConsumer.java`)
- BitCask Store → Key Directory Entry: indexes locations (evidence: `central-station/src/main/java/com/ddia/centralstation/bitcask/BitCask.java`)
- Weather Consumer → Parquet Archiver: archives events (evidence: `central-station/src/main/java/com/ddia/centralstation/consumer/KafkaWeatherConsumer.java`)
- Parquet Archiver → Partitioned Parquet: writes batches (evidence: `central-station/src/main/java/com/ddia/centralstation/archiver/ParquetArchiver.java`)
- BitCask REST API → BitCask Store: queries and compacts (evidence: `central-station/src/main/java/com/ddia/centralstation/controller/BitCaskController.java`)
- BitCask Client → BitCask REST API: calls endpoints (evidence: `central-station/src/main/java/com/ddia/centralstation/controller/BitCaskController.java`)
- Kafka Topics → Rain Detector: streams status (evidence: `README.md`)
- Rain Detector → Rain Alerts: emits rain alerts (evidence: `README.md`)
- Partitioned Parquet → Parquet Shipper: ships files (evidence: `README.md`)
- Parquet Shipper → Elasticsearch: indexes batches (evidence: `README.md`)
- Elasticsearch → Kibana: visualizes data (evidence: `README.md`)
