How vietnam-devs/coolstore-microservices works
Main Components
• API Gateway: Show the API gateway component (in src/dotnet/api-gateway) which routes incoming HTTP requests and uses reverse proxying (YARP) to forward requests to respective backend services.
• Identity Service: Represent the identity service (in src/dotnet/identity-server) based on IdentityServer4 that handles authentication and access control.
• Product Catalog Service (src/dotnet/…/ProductCatalogService.Api),
• Inventory Service (src/dotnet/…/InventoryService.Api),
• Shopping Cart Service (src/dotnet/…/ShoppingCartService.Api),
• Sale Service (referenced by Go and possibly through additional language-specific directories).
• Supporting Services & Libraries: Include building blocks such as the “N8T.Core” and “N8T.Infrastructure” libraries which encapsulate cross-cutting concerns like logging, caching (using Redis), data access (EF Core), and messaging.
• Dapr Runtime: Highlight the Dapr components (in the components directory with appconfig.yaml, pubsub.yaml, statestore.yaml) that provide the foundational building blocks (service invocation, state management, pub/sub, resource bindings, etc.) across all microservices.
• Infrastructure & Deployment: Represent the deployment units through Docker (Dockerfiles in various parts), Tye configuration (tye.yaml), and Kubernetes/Helm charts (deploys/charts, deploys/bicep) that are used to containerize and orchestrate the services.
Relationships & Data Flow
• API Gateway routing requests to the appropriate microservices. Mark how these services interact using Dapr’s service invocation pattern.
• Pub/Sub messaging: For example, when a user clicks the checkout button in the shopping cart, an event flows through a pub/sub channel (supported by Dapr) across services (shopping cart, sale, identity).
• External communications from backend services to databases or external caches (like Redis for caching and possibly a messaging layer like Kafka as suggested in the building blocks).
Architectural Patterns & Design Principles
• Microservices architecture: each service is independently deployable within a container.
• Separation between front-end and back-end services, and how the API gateway centralizes routing and cross-cutting concerns like authentication.
• How Dapr abstracts inter-service communication, allowing the microservices to communicate in a loosely coupled fashion.
• If space allows, annotate that the project leverages Domain-Driven Design patterns (as mentioned in the README and related links) with building blocks for domain logic, repository patterns, and application services.
Relevant Technologies & Frameworks
• .NET Core for backend microservices (with EF Core, MediatR, FluentValidation, Serilog).
• React and TypeScript for the front-end.
• Dapr for service-to-service invocation, state management, pub/sub, etc.
• Tye for local development orchestration.
• Docker and Kubernetes/Helm for containerization and production deployment.
• Azure pipelines, Travis, and CI/CD scripts for continuous integration and deployment.