BMI Calculator is a demonstration of a distributed .NET microservices application, utilizing Docker for orchestration. This project highlights the use of asynchronous programming, fault isolation via the Polly library, and demonstrates the effectiveness of microservices in handling complex tasks. The application consists of two microservices: "Collector" for data gathering and validation, and "Calculator" for BMI calculation based on height and weight, determining BMI status (e.g., Overweight, Underweight, etc.). It also features a GUI (MVC) for displaying the calculator interface.
- Asynchronous Communication: Seamless interaction between the Collector and Calculator services.
- Fault Isolation: Incorporation of the Polly library for robust retry patterns, ensuring resilience.
- Logging: Implementation of Seq for efficient tracking and visualization of logs.
- User Interface: An MVC architecture-based service that serves as the domain interacting with the Collector service.
- Collector Service: Gathers and validates user data for BMI calculation.
- Calculator Service: Computes the BMI based on height and weight and determines the corresponding health status.
- User Interface: A front-end solution presenting a user-friendly BMI calculator.
- Monitoring: Includes logging mechanisms for tracking and analysis.
- .NET: Utilized for building microservices and the UI.
- Docker: Employed for containerization and orchestration of services.
- Polly: Integrated for implementing resilience patterns.
- Seq: Used for visualizing and managing logs.
- Install Dependencies:
- Collector: Newtonsoft.json, Polly, Microsoft.Extensions.Http.Polly
- Calculator: No additional dependencies.
- Monitoring: Serilog, Serilog.Enrichers.Span, Serilog.Sinks.Seq, Serilog.Sinks.Console
- UI: Polly, Microsoft.Extensions.Http.Polly, Newtonsoft.json
- Run: Execute
docker compose up –build ui-service
to start the application. - Access:
- UI: localhost:8000
- Seq: localhost:5342
Contributions are welcome. Special thanks to Wehba Korouni for the cooperation. This project is maintained by Said Mansour.
For any inquiries or contributions, please open an issue on the project's GitHub page.