Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ExchangeRateProvider
Intro
This project illustrates an example of API implementation, taking into account good design practices, Clean Architecture DDD and adhering to the CQRS principles. It could be considered a standalone microservice and deployed and scaled independently.
This exercise aims to implement a fully functional exchange rate provider based on the real-world public data source of the assigned bank. By default, the information is obtained from the Czech National Bank, but the system is designed to be easily extensible to other providers in the future.
Design justification
I'm aware that it can be solved more simply, without so much over-engineering, but I'm doing it this way precisely to be consistent with the topics discussed in the interview. I intend to illustrate some topics such as clean architecture, best practices in API design, SOLID principles or performance improvement.
For this reason, and because the exercise should be treated as production code, I have decided to spend some more time building an extensible and maintainable architecture and implementing more advanced aspects such as or securitization, caching, resilience or CQRS.
Requirements
How to run the application
API architecture
We design our service following the principles of Clean Architecture DDD. Then, we structure the code in 4 layers:
ExchangeRateUpdater.Domain layer and ExchangeRateUpdater.Application layer will be the core layers. And we have ExchangeRateUpdater.API layer, which is the presentation layer, and ExchangeRateUpdater.Infrastructure layer (we also call Periphery layers). The main idea behind Clean Architecture approach, is to separate the domain code from the application and infrastructure code, so that the core (business logic) of our software can evolve independently of the rest of the components. Regarding the DDD (Domain Drive Design) approach, it proposes a modeling based on business reality according to its use cases. The important thing is to organize the code so that it is aligned with the business problems and uses the same business terms (ubiquitous language).
Explaining the layers in more detail:
Design patterns and best practices
Third-party Nuget packages
Assumptions
Possible improvements