Skip to content

Commit b07a85a

Browse files
committed
feat: add aspire in chapter 4
1 parent 0eaa4d6 commit b07a85a

8 files changed

Lines changed: 87 additions & 3 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
var builder = DistributedApplication.CreateBuilder(args);
2+
3+
var postgres = builder.AddPostgres("postgres")
4+
.WithImage("postgres", "14.3")
5+
.WithPgAdmin();
6+
7+
var fitnetContractsDatabase = postgres.AddDatabase("fitnetcontractsdb", "fitnet");
8+
9+
var rabbitmq = builder.AddRabbitMQ("rabbitmq")
10+
.WithManagementPlugin();
11+
12+
builder.AddProject<Fitnet_Contracts>("fitnet-contracts")
13+
.WithEnvironment("ASPNETCORE_ENVIRONMENT", "Development")
14+
.WithReference(fitnetContractsDatabase, "Database__ConnectionString")
15+
.WithReference(rabbitmq, "EventBus__Uri")
16+
.WaitFor(postgres)
17+
.WaitFor(rabbitmq);
18+
19+
await builder.Build().RunAsync();
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<UserSecretsId>baa61b13-91c4-4b1d-b245-ea3f9d627edf</UserSecretsId>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<PackageReference Include="Aspire.Hosting.PostgreSQL" />
10+
<PackageReference Include="Aspire.Hosting.RabbitMQ" />
11+
</ItemGroup>
12+
13+
<ItemGroup>
14+
<ProjectReference Include="..\Fitnet.Contracts\Fitnet.Contracts.csproj" />
15+
</ItemGroup>
16+
17+
</Project>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"$schema": "https://json.schemastore.org/launchsettings.json",
3+
"profiles": {
4+
"https": {
5+
"commandName": "Project",
6+
"dotnetRunMessages": true,
7+
"launchBrowser": true,
8+
"applicationUrl": "https://localhost:17019;http://localhost:15170",
9+
"environmentVariables": {
10+
"ASPNETCORE_ENVIRONMENT": "Development",
11+
"DOTNET_ENVIRONMENT": "Development",
12+
"ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21109",
13+
"ASPIRE_DASHBOARD_MCP_ENDPOINT_URL": "https://localhost:23209",
14+
"ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22128"
15+
}
16+
},
17+
"http": {
18+
"commandName": "Project",
19+
"dotnetRunMessages": true,
20+
"launchBrowser": true,
21+
"applicationUrl": "http://localhost:15170",
22+
"environmentVariables": {
23+
"ASPNETCORE_ENVIRONMENT": "Development",
24+
"DOTNET_ENVIRONMENT": "Development",
25+
"ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:19174",
26+
"ASPIRE_DASHBOARD_MCP_ENDPOINT_URL": "http://localhost:18202",
27+
"ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:20245"
28+
}
29+
}
30+
}
31+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
}
8+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning",
6+
"Aspire.Hosting.Dcp": "Warning"
7+
}
8+
}
9+
}

Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Directory.Packages.props

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
<PackageVersion Include="EvolutionaryArchitecture.Fitnet.Common.Core" Version="4.2.0" />
99
<PackageVersion Include="EvolutionaryArchitecture.Fitnet.Common.Infrastructure" Version="4.2.0" />
1010
<PackageVersion Include="EvolutionaryArchitecture.Fitnet.Common.IntegrationTestsToolbox" Version="4.2.0" />
11-
<PackageVersion Include="Aspire.Hosting.AppHost" Version="13.0.0" />
12-
<PackageVersion Include="Aspire.Hosting.PostgreSQL" Version="13.0.0" />
13-
<PackageVersion Include="Aspire.Hosting.RabbitMQ" Version="13.0.0" />
11+
<PackageVersion Include="Aspire.Hosting.PostgreSQL" Version="13.1.0" />
12+
<PackageVersion Include="Aspire.Hosting.RabbitMQ" Version="13.1.0" />
1413
<PackageVersion Include="JetBrains.Annotations" Version="2025.2.2" />
1514
<PackageVersion Include="MassTransit.Abstractions" Version="8.3.2" />
1615
<PackageVersion Include="MassTransit" Version="8.3.2" />

Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.slnx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<Project Path="Fitnet.Contracts.Core.UnitTests/Fitnet.Contracts.Core.UnitTests.csproj" />
55
<Project Path="Fitnet.Contracts.IntegrationTests/Fitnet.Contracts.IntegrationTests.csproj" />
66
</Folder>
7+
<Project Path="AppHost/AppHost.csproj" />
78
<Project Path="Fitnet.Contracts.Api/Fitnet.Contracts.Api.csproj" />
89
<Project Path="Fitnet.Contracts.Application/Fitnet.Contracts.Application.csproj" />
910
<Project Path="Fitnet.Contracts.Core/Fitnet.Contracts.Core.csproj" />

Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/AppHost/AppHost.cs renamed to Chapter-4-applying-tactical-domain-driven-design/Fitnet/Src/AppHost/Program.cs

File renamed without changes.

0 commit comments

Comments
 (0)