How james-phan/eshop works
Main Components
• Frontend/Client Applications:
• Web-based frontends (src/WebApp, src/HybridApp, src/WebhookClient, src/WebAppComponents)
• Mobile client and cross-platform apps (src/ClientApp, src/Mobile.Bff.Shopping)
• Backend/API Services:
• Catalog.API – manages product catalog data and image assets.
• Basket.API – handles shopping basket operations.
• Identity.API – provides authentication, authorization, and user profile management.
• Ordering.API – manages order creation, updates, and order lifecycle commands.
• PaymentProcessor – processes payments and related integration events.
• OrderProcessor – deals with background tasks and order processing workflows.
• Webhooks.API – handles webhook subscriptions and notifications.
• Integration and Messaging:
• EventBus libraries (src/EventBus, src/EventBusRabbitMQ) – responsible for broadcasting integration events between microservices.
• IntegrationEventLogEF – keeps track of integration events and provides resiliency.
• Shared and Infrastructure Components:
• Shared libraries (src/Shared, src/eShop.ServiceDefaults) containing helper methods and cross-cutting concerns.
• Various configuration files, code for dependency injection, extension methods, and migration scripts that support the architecture.
• CI/CD and Build:
• CI/workflow configuration (under .github/workflows, build scripts) that automates deployments, quality checks, and containerization (Docker).
Out Relationships and Data Flow
• Client Applications interact with backend APIs (Catalog, Basket, Identity, Ordering, etc.) over REST or gRPC.
• Shared infrastructure services and libraries (such as IntegrationEventLogEF) should be noted as a common resource to ensure reliable event processing and outbox pattern.
• External dependencies: Include components like Azure OpenAI integration (Azure Developer CLI steps in Azure) and Docker, which are used for deployment and runtime configuration.
• Optional: Show testing components (unit and functional tests) that validate the various microservices.
Architectural Patterns and Design Principles
• Microservices architecture: Each backend service is built as an independent project (e.g., Catalog.API, Basket.API, Identity.API, Ordering.API, etc.). Emphasize the separation and distinct database/migrations used by various services.
• Event-driven communication: Integration events and the centralized event bus (RabbitMQ) enable asynchronous inter-service communication.
• CI/CD and container-based deployment: Use Docker (as indicated in scripts and CI workflows) and configuration management to deploy the entire system.
• Clean separation between presentation (client UIs) and backend services with a possible API Gateway or BFF (see Mobile.Bff.Shopping).
Specific Elements
• API calls from client apps to backend services.
• Event flow between services via the EventBus.
• Data flow (for instance, the catalog service sending product data, basket service managing user baskets, etc.).
• Annotations: Annotate with key concepts like “gRPC communication,” “REST API,” “Integration Events,” and “CI/CD Pipelines.”
1. Client/Presentation Layer (showing WebApp, ClientApp, HybridApp, Mobile.Bff, WebhookClient).
2. Backend Services Layer (grouping Catalog.API, Basket.API, Identity.API, Ordering.API, PaymentProcessor, OrderProcessor, etc.).
3. Integration Layer (central EventBus, IntegrationEventLogEF, RabbitMQ).
4. Infrastructure/Shared Components (Shared libraries and service defaults).
• Next, drill down to illustrate how these layers interact; for example:
• Clients call the API endpoints.
• API services emit integration events that are consumed by other services/regulatory background processes.
• Identity API provides authentication tokens to secure API calls.
• Finally, detail any external services (Docker, Azure deployments, CI/CD pipelines) that interact with the system.