Skip to content

aygunbayirdev/ECommerceStock

Repository files navigation

🛡️ ECommerceStock: Project Manifesto

This document serves as the Single Source of Truth for the architectural decisions, technology stack, and development discipline of the ECommerceStock project.


🚀 1. General Vision

  • Scope: A high-performance system centered on inventory, warehouse, and operation management.
  • Architecture: Event-Driven Modular Monolith. Built with a microservices mindset but deployed as a scalable monolithic structure.
  • Design Philosophy: Domain-Driven Design (DDD).

🏛️ 2. Communication Strategy (Crucial Implementation)

  • Internal Module Communication (Synchronous/Transactional): Uses MediatR for Domain Events .
  • Automatic Dispatch: When an entity is saved, AppDbContext automatically dispatches events to local handlers (e.g., ProductCreatedEvent -> ProductCreatedEventHandler) .
  • External/Inter-Module Communication (Asynchronous): Uses RabbitMQ with MassTransit integration.
  • Integration Events: After a successful transaction, an Integration Event is published to the broker to notify other modules (e.g., notifying the Inventory module after a Catalog update).

🛠️ 3. Tech Stack

  • Framework: .NET 10 LTS.
  • Database: SQL Server 2022 (Running on Docker).
  • Message Broker: RabbitMQ with MassTransit.RabbitMQ.
  • Tooling: Visual Studio 2026, WSL 2 (Ubuntu), Docker Desktop.

⚙️ 4. Technical "Don't Forget" List (Key Learnings)

📂 Directory Structure

  • Separation: All source code is located under the src/ folder to separate business logic from configuration and documentation.

🏗️ Persistence & Migration Logic

  • AppDbContextFactory: Uses AppDomain.CurrentDomain.BaseDirectory to dynamically locate appsettings.json during design-time (migrations) .
  • Single Source of Truth: Ensures a shared connection string between the API and Infrastructure layers .
  • Automatic Auditing: An UpdateAuditableEntitiesInterceptor is registered to automatically populate CreatedAt and UpdatedAt fields for all entities deriving from BaseEntity .

🛡️ Domain Integrity

  • Rich Domain Models: Entities use private setters and encapsulated business methods (e.g., UpdatePrice, AddDomainEvent) to prevent invalid state changes .
  • Value Objects: Complex types like Money, Sku, and Address are implemented as Value Objects for structural equality and validation .

🏛️ 5. Domain Modules (Bounded Contexts)

The system is divided into 6 main modules, managing 38 entity types across dedicated database schemas:

  1. Catalog: Products, Brands, Categories, Variants/SKUs.
  2. Inventory (WMS): Warehouses, Bins, Stock Ledgers, Adjustments.
  3. Purchasing: Suppliers, Purchase Orders, Goods Receipts.
  4. Sales (OMS): Customers, Sales Orders, Invoices, Shipments.
  5. Pricing: Price Lists, Dynamic Discounts.
  6. Identity: User Management and IAM.

Last Updated: March 21, 2026

Releases

No releases published

Packages

 
 
 

Contributors

Languages