How foxminchan/rookieshop works
Project Type and Purpose
• The project is an e-commerce web application built using .NET Core with Clean Architecture and Domain-Driven Design principles.
• It is structured to support both end-customer functionalities (storefront) and admin functionalities (back office), alongside supporting services such as identity management and API gateway/BFF.
• The README clearly states that RookieShop is part of a training assignment that demonstrates modern web development practices, including advanced patterns like Clean Architecture and DDD.
Project Structure
• The top-level directories clearly separate concerns:
• “src”: Contains multiple subprojects such as ApiService, Application, BackOffice, Bff, Domain, IdentityService, Infrastructure, Persistence, and StoreFront. Each of these corresponds to different layers or services in the overall architecture.
• “docs”: Contains design documentation and configuration for the documentation website (using VuePress).
• “tests”: Contains multiple test projects for architecture, functional tests, and unit tests, indicating that constraints like architecture testing (e.g., NetArchTest) have been applied.
• Build scripts, CI/CD pipelines (GitHub workflows, NUKE build files), and infrastructure manifests (aspirate-output with Kubernetes YAML files) reinforce that deployment and observability aspects are part of the design.
Understand the Key Components
• Back Office: Next.js-based admin website (located in src/RookieShop.BackOffice) – handles product, category, and customer management.
• Identity Server: A dedicated authentication service using Duende IdentityServer (located in src/RookieShop.IdentityService) – provides auth for the application.
• BFF (Backend For Frontend): Acts as an aggregator or proxy for the admin website, using Yarp (src/RookieShop.Bff).
• StoreFront: A customer-facing web application implemented using Razor Pages, htmx, Alpine.js, and ///_hyperscript (located in src/RookieShop.StoreFront) – displaying products and handling shopping interactions.
• Web API / ApiService: The service that exposes REST endpoints (src/RookieShop.ApiService) which are consumed by both storefront and back office.
• Application Layer: Contains business logic and commands/queries (src/RookieShop.Application) following use cases (e.g., operations for Baskets, Categories, Customers, Orders, Products, Reports, etc.).
• Domain Layer: Implements core entities, value objects, domain events and aggregation rules (src/RookieShop.Domain) – a central part of the DDD model.
• Infrastructure & Persistence: Handle cross-cutting concerns like caching (Redis), email (SMTP), storage (Azurite), distributed locks, logging, identity, swagger, and database mappings (src/RookieShop.Infrastructure and src/RookieShop.Persistence).
• Observability: OpenTelemetry and logging to Aspire Dashboard for monitoring (referenced in the README and supported by configuration files and assets in the project).
• AI Platform: Using OpenAI and Semantic Kernel (present via configuration in src/RookieShop.Infrastructure/Ai and references also in the README).
Determining Relationships and Interactions
• StoreFront and Back Office to the Web API (or via the BFF for admin).
• Identity Server providing authentication tokens to both clients.
• API Service calling the Application layer that, in turn, manipulates Domain Entities and uses Infrastructure/Persistence for data storage.
• Redis and Postgres (or Marten) as supporting services – the former for caching/session storage and the latter for persistent data.
• External integrations (Stripe webhook, OpenAI, and AI platforms) as external services connected by the Email, AI, and Infrastructure modules.
• That the BFF is using a reverse proxy (Yarp) and that the system supports both synchronous API calls and asynchronous messaging.
• Layered architecture (presentation layer, application layer, domain, and infrastructure) along with the clear boundaries enforced by the Clean Architecture.
Architectural Patterns and Technologies
• Clean Architecture and separation of concerns: presentation (BackOffice and StoreFront), API (Web API), business logic (Application), domain rules (Domain), and persistence/integration (Infrastructure/Persistence).
• Different patterns such as MVC (ASP.NET Core, Razor Pages, TagHelpers) for the web UI and microservices or modular monolith for separation between Identity, API, and BFF.
• That testing is applied at multiple levels and that deployment uses container orchestration (k3d, Docker) and aspirate manifests for Kubernetes.