diff --git a/Chapter-4-applying-tactical-domain-driven-design/Directory.Build.props b/Chapter-4-applying-tactical-domain-driven-design/Directory.Build.props
deleted file mode 100644
index faf2349b..00000000
--- a/Chapter-4-applying-tactical-domain-driven-design/Directory.Build.props
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/Chapter-4-applying-tactical-domain-driven-design/Directory.Packages.props b/Chapter-4-applying-tactical-domain-driven-design/Directory.Packages.props
deleted file mode 100644
index 6e28deb7..00000000
--- a/Chapter-4-applying-tactical-domain-driven-design/Directory.Packages.props
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
- true
-
-
-
-
-
-
-
diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.AppHost/Fitnet.AppHost.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.AppHost/Fitnet.AppHost.csproj
deleted file mode 100644
index 7f5fd06d..00000000
--- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.AppHost/Fitnet.AppHost.csproj
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
- Exe
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/AppHost/AppHost.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/AppHost/AppHost.csproj
new file mode 100644
index 00000000..0c138757
--- /dev/null
+++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/AppHost/AppHost.csproj
@@ -0,0 +1,17 @@
+
+
+
+ Exe
+ baa61b13-91c4-4b1d-b245-ea3f9d627edf
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/AppHost/Program.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/AppHost/Program.cs
new file mode 100644
index 00000000..be111819
--- /dev/null
+++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/AppHost/Program.cs
@@ -0,0 +1,21 @@
+using Projects;
+
+var builder = DistributedApplication.CreateBuilder(args);
+
+var postgres = builder.AddPostgres("postgres")
+ .WithImage("postgres", "14.3")
+ .WithPgAdmin();
+
+var fitnetContractsDatabase = postgres.AddDatabase("fitnetcontractsdb", "fitnet");
+
+var rabbitmq = builder.AddRabbitMQ("rabbitmq")
+ .WithManagementPlugin();
+
+builder.AddProject("fitnet-contracts")
+ .WithEnvironment("ASPNETCORE_ENVIRONMENT", "Development")
+ .WithReference(fitnetContractsDatabase, "Database__ConnectionString")
+ .WithReference(rabbitmq, "EventBus__Uri")
+ .WaitFor(postgres)
+ .WaitFor(rabbitmq);
+
+await builder.Build().RunAsync();
diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/AppHost/Properties/launchSettings.json b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/AppHost/Properties/launchSettings.json
new file mode 100644
index 00000000..bbc14253
--- /dev/null
+++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/AppHost/Properties/launchSettings.json
@@ -0,0 +1,31 @@
+{
+ "$schema": "https://json.schemastore.org/launchsettings.json",
+ "profiles": {
+ "https": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
+ "applicationUrl": "https://localhost:17019;http://localhost:15170",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development",
+ "DOTNET_ENVIRONMENT": "Development",
+ "ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21109",
+ "ASPIRE_DASHBOARD_MCP_ENDPOINT_URL": "https://localhost:23209",
+ "ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22128"
+ }
+ },
+ "http": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
+ "applicationUrl": "http://localhost:15170",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development",
+ "DOTNET_ENVIRONMENT": "Development",
+ "ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:19174",
+ "ASPIRE_DASHBOARD_MCP_ENDPOINT_URL": "http://localhost:18202",
+ "ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:20245"
+ }
+ }
+ }
+}
diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/AppHost/appsettings.Development.json b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/AppHost/appsettings.Development.json
new file mode 100644
index 00000000..0c208ae9
--- /dev/null
+++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/AppHost/appsettings.Development.json
@@ -0,0 +1,8 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ }
+}
diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.AppHost/appsettings.json b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/AppHost/appsettings.json
similarity index 65%
rename from Chapter-4-applying-tactical-domain-driven-design/Fitnet.AppHost/appsettings.json
rename to Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/AppHost/appsettings.json
index 7e1692a8..31c092aa 100644
--- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.AppHost/appsettings.json
+++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/AppHost/appsettings.json
@@ -3,7 +3,7 @@
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning",
- "Aspire.Hosting.DistributedApplication": "Information"
+ "Aspire.Hosting.Dcp": "Warning"
}
}
-}
\ No newline at end of file
+}
diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Directory.Packages.props b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Directory.Packages.props
index 11015fa7..7ac1efbd 100644
--- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Directory.Packages.props
+++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Directory.Packages.props
@@ -8,9 +8,8 @@
-
-
-
+
+
diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.slnx b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.slnx
index 5d06360a..f5519af6 100644
--- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.slnx
+++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.slnx
@@ -4,6 +4,7 @@
+
diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/AppHost/AppHost.csproj b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/AppHost/AppHost.csproj
new file mode 100644
index 00000000..162a313c
--- /dev/null
+++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/AppHost/AppHost.csproj
@@ -0,0 +1,17 @@
+
+
+
+ Exe
+ 836a29ab-7d3b-4f2e-b7d7-358e686637ab
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.AppHost/Program.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/AppHost/Program.cs
similarity index 64%
rename from Chapter-4-applying-tactical-domain-driven-design/Fitnet.AppHost/Program.cs
rename to Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/AppHost/Program.cs
index 19045535..74f48a10 100644
--- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.AppHost/Program.cs
+++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/AppHost/Program.cs
@@ -18,11 +18,4 @@
.WaitFor(postgres)
.WaitFor(rabbitmq);
-builder.AddProject("fitnet-contracts-microservice")
- .WithEnvironment("ASPNETCORE_ENVIRONMENT", "Development")
- .WithReference(fitnetDatabase, "Database__ConnectionString")
- .WithReference(rabbitmq, "EventBus__ConnectionString")
- .WaitFor(postgres)
- .WaitFor(rabbitmq);
-
-await builder.Build().RunAsync();
\ No newline at end of file
+await builder.Build().RunAsync();
diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/AppHost/Properties/launchSettings.json b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/AppHost/Properties/launchSettings.json
new file mode 100644
index 00000000..773cab32
--- /dev/null
+++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/AppHost/Properties/launchSettings.json
@@ -0,0 +1,31 @@
+{
+ "$schema": "https://json.schemastore.org/launchsettings.json",
+ "profiles": {
+ "https": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
+ "applicationUrl": "https://localhost:17212;http://localhost:15042",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development",
+ "DOTNET_ENVIRONMENT": "Development",
+ "ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21058",
+ "ASPIRE_DASHBOARD_MCP_ENDPOINT_URL": "https://localhost:23161",
+ "ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22008"
+ }
+ },
+ "http": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
+ "applicationUrl": "http://localhost:15042",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development",
+ "DOTNET_ENVIRONMENT": "Development",
+ "ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:19270",
+ "ASPIRE_DASHBOARD_MCP_ENDPOINT_URL": "http://localhost:18084",
+ "ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:20064"
+ }
+ }
+ }
+}
diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/AppHost/appsettings.Development.json b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/AppHost/appsettings.Development.json
new file mode 100644
index 00000000..0c208ae9
--- /dev/null
+++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/AppHost/appsettings.Development.json
@@ -0,0 +1,8 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ }
+}
diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/AppHost/appsettings.json b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/AppHost/appsettings.json
new file mode 100644
index 00000000..31c092aa
--- /dev/null
+++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/AppHost/appsettings.json
@@ -0,0 +1,9 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning",
+ "Aspire.Hosting.Dcp": "Warning"
+ }
+ }
+}
diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Directory.Packages.props b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Directory.Packages.props
index a3805567..3da1e64d 100644
--- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Directory.Packages.props
+++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Directory.Packages.props
@@ -3,8 +3,8 @@
true
-
-
+
+
diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet.slnx b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet.slnx
index a045e7cb..a51f03c4 100644
--- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet.slnx
+++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/Fitnet.slnx
@@ -20,5 +20,6 @@
+
diff --git a/Chapter-4-applying-tactical-domain-driven-design/docker-compose.yml b/Chapter-4-applying-tactical-domain-driven-design/docker-compose.yml
deleted file mode 100644
index 56b558fc..00000000
--- a/Chapter-4-applying-tactical-domain-driven-design/docker-compose.yml
+++ /dev/null
@@ -1,49 +0,0 @@
-version: '3.9'
-
-services:
- fitnet-modular-monolith:
- environment:
- - ASPNETCORE_ENVIRONMENT=Development
- build: ./Fitnet/Src
- ports:
- - "8080:80"
- depends_on:
- postgres:
- condition: service_healthy
- rabbitmq:
- condition: service_healthy
-
- fitnet-contracts-microservice:
- environment:
- - ASPNETCORE_ENVIRONMENT=Development
- build: ./Fitnet.Contracts/Src
- ports:
- - "8081:80"
- depends_on:
- postgres:
- condition: service_healthy
-
- postgres:
- image: postgres:14.3
- container_name: postgres
- ports:
- - 5432:5432
- environment:
- - POSTGRES_PASSWORD=mysecretpassword
- healthcheck:
- test: [ "CMD-SHELL", "pg_isready -U postgres" ]
- interval: 10s
- timeout: 5s
- retries: 5
-
- rabbitmq:
- container_name: rabbitmq
- image: rabbitmq:management
- ports:
- - "15672:15672"
- - "5672:5672"
- healthcheck:
- test: ["CMD", "rabbitmqctl", "ping"]
- interval: 10s
- timeout: 5s
- retries: 5
\ No newline at end of file