How fer-dev-mx/eshopmicroservices works
Main Components
• BuildingBlocks Library:
• This common library (located under src/BuildingBlocks) defines shared behaviors (like LoggingBehavior and ValidationBehavior), interfaces (ICommand, IQuery, their handlers), and exception handling classes.
• It as a “Core Framework/Shared Libraries” component that is utilized by each microservice.
• Microservices:
• Basket.API (in src/Services/Basket): A RESTful API handling shopping cart operations. Highlight endpoints for deleting, retrieving, and storing baskets as distinct functions within the service.
• Catalog.API (in src/Services/Catalog): A RESTful service managing product catalog operations. It features endpoints for creating, updating, deleting, and searching products.
• Discount.Grpc (in src/Services/Discount): A gRPC-based service that provides discount or coupon-related functionalities. Its reliance on gRPC (seen with the .proto file) sets it apart.
• Data Access Components:
• Each service includes its own data layer (for example, BasketRepository and CachedBasketRepository for the Basket API, CatalogInitialData and Product models for Catalog, and DiscountContext for Discount) which may map to separate databases or storage modules.
• Deployment & Containerization:
• Dockerfiles for each service and docker-compose files that orchestrate the services. Represent a “Container/Orchestration” layer that shows how these services run in isolated containers.
Relationships and Interactions
• “Shared Libraries” (BuildingBlocks) as a foundation that supports the operations of each microservice.
• For Discount, demonstrate its role as a gRPC service. Indicate that other microservices or components might consume its API via gRPC calls.
• If applicable, indicate any inter-service communication (for example, if the Basket service needs to validate discount coupons, it might call the Discount service).
Architectural Patterns and Technologies
• The use of CQRS (as seen in the BuildingBlocks/CQRS folder) should be called out. Mark both command and query flows within the microservices where this pattern applies.
• Each service follows the API endpoint pattern where endpoints are defined (for example, in Basket/Basket.API/Basket subfolders and Catalog’s Products folders). Group these under the umbrella of “API Endpoints.”
• Docker and docker-compose indicate container orchestration; include these symbols to show deployment structure.