Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Domain Project

The Shopfoo.Product project implements domain workflows using the V4 Program.

Here is a simplified view from the solution explorer:

πŸ“‚ src/
β”œβ”€β”€πŸ“‚ Core/
β”‚  β”œβ”€β”€πŸ—ƒοΈ Shopfoo.Common
β”‚  β”œβ”€β”€πŸ—ƒοΈ Shopfoo.Domain.Types
β”‚  β””β”€β”€πŸ—ƒοΈ Shopfoo.Program
β”œβ”€β”€πŸ“‚ Feat/
β”‚  β”œβ”€β”€πŸ—ƒοΈ Shopfoo.Home
β”‚  β””β”€β”€πŸ—ƒοΈ Shopfoo.Product πŸ‘ˆπŸ‘ˆ
β”‚     β”œβ”€β”€πŸ“‚ Model/
β”‚     β”‚  β”œβ”€β”€πŸ“„ Product.fs       πŸ‘ˆ Validation logic
β”‚     β”‚  β”œβ”€β”€πŸ“„ Prices.fs
β”‚     β”‚  β””β”€β”€πŸ“„ Stock.fs
β”‚     β”œβ”€β”€πŸ“‚ Workflows/
β”‚     β”‚  β”œβ”€β”€πŸ“„ Prelude.fs       πŸ‘ˆ Instructions + helpers
β”‚     β”‚  β”œβ”€β”€πŸ“„ AddProduct.fs
β”‚     β”‚  β”œβ”€β”€πŸ“„ DetermineStock.fs
β”‚     β”‚  β”œβ”€β”€πŸ“„ MarkAsSoldOut.fs
β”‚     β”‚  β”œβ”€β”€πŸ“„ RemoveListPrice.fs
β”‚     β”‚  β”œβ”€β”€πŸ“„ SavePrices.fs
β”‚     β”‚  β”œβ”€β”€πŸ“„ SaveProduct.fs
β”‚     β”‚  β””β”€β”€πŸ“„ ...
β”‚     β”œβ”€β”€πŸ“‚ Data/
β”‚     β”œβ”€β”€πŸ“„ Api.fs
β”‚     β”œβ”€β”€πŸ“„ DependencyInjection.fs
β”‚     β””β”€β”€πŸ“„ Manifest.fs
β””β”€β”€πŸ“‚ UI/
   β”œβ”€β”€πŸ—ƒοΈ Shopfoo.Client
   β”œβ”€β”€πŸ—ƒοΈ Shopfoo.Server
   β””β”€β”€πŸ—ƒοΈ Shopfoo.Shared

We will examine each part separately:

  • Domain Model explains how the domain model is split between shared types (Domain.Types) and aggregates (Model/) following DDD principles.

  • Instructions describes how the instruction interface is defined, along with the ergonomic helpers for composing programs.

  • Workflows presents how to write domain workflows by analyzing typical use cases, including parallel execution and workflow cancellation with undo (saga pattern).

  • Data indicates a way to organize the data access layer, whether it is to access a database or call an external API.

  • Api describes how to define the project entry point, wire instructions to the data layer with undo strategies, and run workflows through the saga runner.

Last updated