Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 19, 2025

📋 Description

Adds .NET Aspire orchestration for Chapter 4, mirroring the implementation from Chapter 3 (PR #227). Provides local development orchestration for PostgreSQL and RabbitMQ.

AppHost Project

Created Fitnet.AppHost with orchestration for:

  • PostgreSQL 14.3 with pgAdmin
  • RabbitMQ with management plugin
  • Fitnet modular monolith
  • Contracts microservice
var postgres = builder.AddPostgres("postgres")
    .WithImage("postgres", "14.3")
    .WithPgAdmin();

var fitnetDatabase = postgres.AddDatabase("fitnetsdb", "fitnet");
var rabbitmq = builder.AddRabbitMQ("rabbitmq").WithManagementPlugin();

builder.AddProject<Fitnet>("fitnet-modular-monolith")
    .WithReference(fitnetDatabase, "Database__ConnectionString")
    .WithReference(rabbitmq, "EventBus__ConnectionString")
    .WaitFor(postgres)
    .WaitFor(rabbitmq);

EventBus Connection String Support

Updated EventBusModule.cs in both Fitnet.Passes.Api and Fitnet.Contracts to parse Aspire-provided connection strings:

var uri = options.Value.Uri;
var username = options.Value.Username;
var password = options.Value.Password;

if (!string.IsNullOrEmpty(uri))
{
    factoryConfigurator.Host(uri, h =>
    {
        if (!string.IsNullOrEmpty(username)) h.Username(username);
        if (!string.IsNullOrEmpty(password)) h.Password(password);
    });
}

Usage

cd Fitnet.AppHost
dotnet run

📦 PR Includes

  • Feature added 🆕
  • Bug fix 🐛
  • Code refactor 🔄
  • Documentation update 📚
  • Tests added/updated 🧪
  • Other: (describe)

🚫 PR Does Not Include

  • Breaking changes ❌
  • Major architectural changes 🏗️
  • Unrelated features/tasks 🚫

💡 Additional Notes

Fully backward compatible with docker-compose workflow. No changes to business logic, Program.cs, or tests. AppHost includes package versions directly to avoid conflicts with existing Central Package Management in subdirectories.

Stats: 6 files changed, 118 insertions(+)

Original prompt

#227 perform similar change with aspire in chapter 4 same change


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits December 19, 2025 14:04
Co-authored-by: kamilbaczek <74410956+kamilbaczek@users.noreply.github.com>
Co-authored-by: kamilbaczek <74410956+kamilbaczek@users.noreply.github.com>
Co-authored-by: kamilbaczek <74410956+kamilbaczek@users.noreply.github.com>
Copilot AI changed the title [WIP] Update chapter 4 with similar changes as in pull request 227 Implement .NET Aspire orchestration in Chapter 4 Dec 19, 2025
Copilot AI requested a review from kamilbaczek December 19, 2025 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants