This repository demonstrates infrastructure-focused patterns using Redis for caching , RabbitMQ for messaging, Azure Key Vault for secrets and Serilog for logging in .NET REST APIs or Blazor App. These are built around a simplified Weather App use case, showing how infrastructure concerns can be modularized and cleanly integrated.
- Email: vishwa@vishwa.me
- GitHub: Vishwam
- LinkedIn: Vishwa Kumar
Vishwa is the primary developer and architect of this example app, responsible for the architecture and implementation of these features.
Project | Description |
---|---|
WeatherApp.RestApi.UsingBackgroundService |
Implements a background service for polling weather data at configurable intervals, with optional API-based triggering. |
WeatherApp.RestApi.RedisCache |
Implements Redis caching to store and retrieve weather data for optimized performance. |
WeatherApp.RestApi.RabbitMQ |
Implements RabbitMQ-based message queueing to asynchronously publish and process weather updates. |
WeatherApp.RestApi.Serilog |
Implements Serilog to log app log, transaction log and custom logs in a REST API. |
WeatherApp.BlazorApp.UsingSerilog |
Implements Serilog to log app log, transaction log and custom logs in a Blazor Web App. |
WeatherApp.BlazorApp.UsingAzureKeyVault |
Implements Azure Key Vault to get stored secrets, to be used into a sample Blazor Web App. |
Each project is self-contained and includes its own .sln
file for independent testing.
git clone https://github.com/vishwamkumar/weather-app.infrastructure.rest-apis.git
cd weather-app.infrastructure.rest-apis
## 🚀 Run a Project
Pick one of the projects to test. For example:
```bash
cd WeatherApp.RestApi.RedisCache
dotnet run
```
Replace RedisCache with RabbitMQ to test the other pattern.
## 🧪 Test Scenarios
Each project includes a Docs/TestMe.md file with example queries and test scenarios specific to the authentication scheme in use.
## 📂 Folder Structure
weather-app.infra-patterns.rest-apis/
├── WeatherApp.RestApi.UsingBackgroundService/
├── WeatherApp.RestApi.UsingRedisCache/
├── WeatherApp.RestApi.UsingRabbitMQ/
├── WeatherApp.RestApi.UsingSerilog/
├── WeatherApp.BlazorServer.UsingSerilog/
└── WeatherApp.BlazorServer.UsingAzureKeyVault/
## 🛠️ Tech Stack
1. .NET 9
2. ASP.NET Core Web API
3. Redis (via StackExchange.Redis)
4. RabbitMQ (via RabbitMQ.Client)
5. Serilog
6. Azure Key Vault
---
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.