Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dotnetbackendtraining/realtime-weather-monitoring-system
C# console application that simulates a real-time weather monitoring and reporting service.
https://github.com/dotnetbackendtraining/realtime-weather-monitoring-system
csharp design-patterns extensible real-time unit-testing
Last synced: 1 day ago
JSON representation
C# console application that simulates a real-time weather monitoring and reporting service.
- Host: GitHub
- URL: https://github.com/dotnetbackendtraining/realtime-weather-monitoring-system
- Owner: DotNetBackendTraining
- Created: 2024-03-13T00:59:39.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2024-05-29T16:30:42.000Z (6 months ago)
- Last Synced: 2024-05-30T06:33:30.573Z (6 months ago)
- Topics: csharp, design-patterns, extensible, real-time, unit-testing
- Language: C#
- Homepage:
- Size: 1.8 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Real-time Weather Monitoring and Reporting Service
[![.NET](https://github.com/izzat5233/realtime-weather-monitoring-system/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/izzat5233/realtime-weather-monitoring-system/actions/workflows/build-and-test.yml)
## **Architecture**
![ComponentDiagram](RealTimeWeatherMonitoringApp/designs/Excalidraw-ComponentDiagram.png)
Explore it interactively [here](https://excalidraw.com/#json=CVKpuN2xIuhagiU4Zzap5,54ASRDZiKyOArV1QHFei5A).
## **General Task Description**
Design and implement a C# console application that simulates a real-time weather monitoring and reporting service. The system should be capable of receiving and processing raw weather data in multiple formats (JSON, XML, etc.) from various weather stations for different locations. The application should include different types of 'weather bots' each of which is configured to behave differently based on the weather updates it receives.
## **Supported Input Formats:**
### **JSON Format**
```
{
"Location": "City Name",
"Temperature": 23.0,
"Humidity": 85.0
}
```### **XML Format**
```
City Name
23.0
85.0```
The system should allow for the addition of new data formats with minimal changes to the existing code, demonstrating the Open-Closed principle of SOLID design principles.
## **Different Bot Types:**
RainBot: This bot gets activated when the humidity level exceeds a certain limit specified in its configuration. Upon activation, it performs a specific action which involves printing a pre-configured message. SunBot: This bot gets activated when the temperature rises above a certain limit specified in its configuration. Upon activation, it performs a specific action which involves printing a pre-configured message. SnowBot: This bot is activated when the temperature drops below a certain limit specified in its configuration. Upon activation, it performs a specific action which involves printing a pre-configured message.
## **Example on How to Interact with the Application:**
User starts the application, the system prompts: Enter weather data:. User enters data in JSON format: `{"Location": "City Name", "Temperature": 32, "Humidity": 40}` or XML format: `City Name3240`
The system responds by activating the bots according to the provided weather data and the bots' configurations. If SunBot is enabled and its temperature threshold is lower than the given temperature, the system may respond with: vbnetCopy code
SunBot activated!
SunBot: "Wow, it's a scorcher out there!"### **Configuration Details:**
All the bot's settings should be controlled via a configuration file, including whether it is enabled, the threshold that activates it, and the message it outputs when activated. The configuration file should be in a JSON format. Here is an example:
```
{
"RainBot": {
"enabled": true,
"humidityThreshold": 70,
"message": "It looks like it's about to pour down!"
},
"SunBot": {
"enabled": true,
"temperatureThreshold": 30,
"message": "Wow, it's a scorcher out there!"
},
"SnowBot": {
"enabled": false,
"temperatureThreshold": 0,
"message": "Brrr, it's getting chilly!"
}
}
```In this example, the enabled property turns the bot on or off, the humidityThreshold or temperatureThreshold sets the limit that will activate the bot, and message is what the bot will output when it is activated. Interns need to implement functionality to read this configuration file at the start of the application, and adjust the behavior of the bots according to the given settings.
## **Additional Notes:**
The complexity of this task involves understanding and applying the Observer and Strategy design patterns, handling file input/output operations, and data manipulation for multiple formats (JSON, XML). This task simulates real-world scenarios where applications need to react to real-time data and perform different actions based on the received data and the given configuration. The application should be designed in such a way that adding new types of bots or weather data formats should not require significant changes to the existing code.