Getting Started
Relevant source files
The following files were used as context for generating this wiki page:
This project is a comprehensive learning platform for mastering Domain-Driven Design (DDD) and Event-Driven Architecture (EDA) using .NET 9. It provides a multi-service environment orchestrated by .NET Aspire, featuring microservices for Scheduling, Billing, and Identity, integrated with an Angular frontend.
The system utilizes a modern tech stack including SQL Server for persistence, RabbitMQ or Azure Service Bus for asynchronous messaging, and Duende IdentityServer for secure authentication.
Sources: claude.md:3-10, claude.md:144-158
Prerequisites and Infrastructure
Before running the application, ensure the following tools are installed and configured:
- .NET 9 SDK: The primary runtime for all backend services.
- Docker Desktop: Required for running the RabbitMQ message broker and other containerized resources.
- Node.js & npm: Necessary for the Angular frontend.
- SQL Server: Primary database (LocalDB is used for development).
Docker Configuration
Docker is managed primarily through .NET Aspire in the AppHost.cs project, but a docker-compose.yml file is maintained as a fallback. A safety check script (ensure-docker.ps1) prevents build hangs if Docker is not running.
Sources: claude.md:154-162, scripts/DOCKER_AUTOSTART_FIX.md:5-10, docker-compose.yml
System Architecture Overview
The project is structured into bounded contexts that communicate via an event bus. The orchestration is handled by .NET Aspire, which manages service discovery and inter-service dependencies.
The diagram shows the high-level relationship between the frontend, the microservices, and the infrastructure components managed by Aspire.
Sources: Aspire.AppHost/AppHost.cs:115-144, claude.md:104-129
Local Development Setup
1. Database Initialization
The project uses DatabaseMigrator hosted services in the Web APIs to automatically apply migrations on startup during development. This ensures that the SQL Server databases for Scheduling, Billing, and Identity are created without manual intervention.
Sources: WebApplications/Scheduling.WebApi/Program.cs:40-42, WebApplications/Identity.WebApi/Program.cs:111
2. Running with .NET Aspire (Recommended)
The easiest way to start the entire system is through the Aspire.AppHost project. This will start the APIs, the frontend, and the RabbitMQ container.
dotnet run --project Aspire.AppHost/Aspire.AppHost.csproj
3. Frontend Development
The Angular application requires local SSL certificates for HTTPS.
- Navigate to
Frontend/Angular/Scheduling.AngularApp/certs/. - Generate certificates named
local-cert.pemandlocal-key.pem. - Run
npm startorng serveto launch the frontend.
Sources: Frontend/Angular/Scheduling.AngularApp/README.md:10-18, Frontend/Angular/Scheduling.AngularApp/certs/README.md:1-5, Frontend/Angular/Scheduling.AngularApp/package.json:6-8
Configuration and Worktree Slots
The project supports "Worktree Slots," allowing developers to run multiple instances of the application simultaneously without port collisions. Ports and database names are dynamically offset based on the slot number.
Default Port Assignments (Slot 1)
| Resource | Port (HTTPS) | Description |
|---|---|---|
| Identity WebApi | 7010 | OIDC/OAuth2 Authority |
| Scheduling WebApi | 7001 | Healthcare scheduling service |
| Billing WebApi | 7002 | Billing and invoice service |
| Angular App | 7003 | SPA Frontend |
| Aspire Dashboard | 17254 | Observability and logs |
Sources: Aspire.AppHost/AppHost.cs:115-144, Aspire.AppHost/Properties/launchSettings.json:7-10
Messaging Frameworks
The system supports two messaging frameworks, configurable via the MessagingFramework setting in appsettings.json:
- MassTransit (Default): Used for robust integration with RabbitMQ or Azure Service Bus.
- Wolverine: An MIT-licensed alternative available for the Billing context.
Sources: WebApplications/Billing.WebApi/Program.cs:45-56, claude.md:148-151
Essential Commands
| Action | Command |
|---|---|
| Build Solution | dotnet build |
| Run All Services | dotnet run --project Aspire.AppHost |
| Run Frontend | cd Frontend/Angular/Scheduling.AngularApp && npm start |
| Skip Docker Check | $env:SKIP_DOCKER_CHECK = "1"; dotnet build |
| Run Unit Tests | dotnet test |
Sources: scripts/DOCKER_AUTOSTART_FIX.md:52-60, Frontend/Angular/Scheduling.AngularApp/package.json:5-12
Summary
To get started, ensure Docker is running and run the Aspire.AppHost project. This orchestrates the full DDD ecosystem, including automated database migrations, service discovery, and the Angular frontend. For advanced multi-worktree development, utilize the worktree-slot environment variable to isolate ports and resources.