Skip to content

Conversation

@danielmackay
Copy link
Member

@danielmackay danielmackay commented Oct 18, 2025

This pull request introduces FastEndpoints as the primary API framework for the SSW.VerticalSliceArchitecture template, replacing the previous Minimal APIs approach. It updates dependencies, refactors infrastructure and endpoint code to align with FastEndpoints 7.0, and documents the architectural decision and build status. The changes ensure improved structure, maintainability, and developer productivity while maintaining compatibility with existing domain patterns and event handling via MediatR.

Architectural Documentation and Guidelines:

  • Added comprehensive Copilot instructions for creating ADRs in .github/instructions/adrs.instructions.md, detailing file naming, structure, content guidelines, and project-specific conventions.
  • Added a new ADR (docs/adrs/20251018-api-use-fastendpoints-instead-of-minimal-apis.md) documenting the decision to adopt FastEndpoints over Minimal APIs, including context, drivers, options, outcomes, and consequences.

Dependency and Infrastructure Updates:

  • Updated Directory.Packages.props to add FastEndpoints (7.0.0) and FastEndpoints.Swagger as dependencies, ensuring the project uses the latest version and supports OpenAPI documentation. [1] [2]

Implementation and Code Refactoring:

  • Refactored infrastructure and endpoint files to use FastEndpoints 7.0 API, including updating processors to global interfaces, removing FastEndpoints event handler, and changing response handling to direct HttpContext.Response usage.
  • Updated event handling to route domain events exclusively through MediatR, removing incompatible FastEndpoints event publishing and handlers.

Documentation of Build and Implementation Status:

  • Added a detailed build success report in docs/cli-tasks/BUILD_SUCCESS.md, summarizing the changes, current implementation, testing instructions, and known limitations of the FastEndpoints integration.

…nd GetTeam endpoints to enhance API documentation
…am, CompleteMission, ExecuteMission, GetTeam, and UpdateHero
@danielmackay danielmackay requested a review from Copilot October 20, 2025 06:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request transitions the SSW.VerticalSliceArchitecture template from ASP.NET Core Minimal APIs to FastEndpoints 7.0 as the primary API framework. The change introduces FastEndpoints infrastructure (processors, event handling, endpoint base classes), refactors all Heroes and Teams endpoints to the new pattern, removes MediatR and Scalar dependencies, and documents the architectural decision. The implementation maintains compatibility with existing domain patterns, validation, and eventual consistency while providing improved structure and developer productivity.

Key Changes

  • FastEndpoints adoption: Complete migration from Minimal APIs/MediatR to FastEndpoints 7.0 with custom processors, global configuration, and Swagger integration
  • Endpoint refactoring: All Heroes and Teams endpoints converted to FastEndpoints pattern with simplified request/response handling and direct database access
  • Infrastructure updates: Removed MediatR behaviors, replaced with FastEndpoints processors (logging, performance, exception handling); updated event handling to route exclusively through FastEndpoints IEvent interface

Reviewed Changes

Copilot reviewed 71 out of 71 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
Directory.Packages.props Added FastEndpoints 7.0 package references
src/WebApi/WebApi.csproj Commented out MediatR/Scalar, added FastEndpoints packages
src/WebApi/Program.cs Replaced Minimal API setup with FastEndpoints middleware
src/WebApi/Host/DependencyInjection.cs Removed MediatR registration, added FastEndpoints services
src/WebApi/Host/Extensions/*.cs Deleted Minimal API helpers, added FastEndpoints configuration extensions
src/WebApi/Common/FastEndpoints/*.cs Added processors for logging, performance tracking, and exception handling
src/WebApi/Features/Heroes/Endpoints/*.cs Created FastEndpoints implementations replacing Commands/Queries
src/WebApi/Features/Teams/Endpoints/*.cs Created FastEndpoints implementations replacing Commands/Queries
src/WebApi/Features/Heroes/Commands/*.cs Deleted MediatR command files
src/WebApi/Features/Teams/Commands/*.cs Deleted MediatR command files
src/WebApi/Common/Domain/Base/*.cs Changed domain event interface from IDomainEvent to IEvent
src/WebApi/Common/Middleware/EventualConsistencyMiddleware.cs Updated to use FastEndpoints event publishing API
tests/WebApi.IntegrationTests/*.cs Updated tests to use FastEndpoints test client extensions
tests/WebApi.ArchitectureTests/*.cs Changed handler interface checks from MediatR to FastEndpoints
docs/adrs/20251018-api-use-fastendpoints-instead-of-minimal-apis.md Documented architectural decision with rationale
docs/cli-tasks/*.md Added comprehensive implementation documentation and guides
tmp/VERIFY_IMPLEMENTATION.sh Build verification script for FastEndpoints implementation

@danielmackay danielmackay self-assigned this Oct 21, 2025
@danielmackay
Copy link
Member Author

Fixes #199

@danielmackay danielmackay marked this pull request as ready for review October 21, 2025 11:05
@danielmackay danielmackay requested a review from a team October 21, 2025 11:07
@danielmackay danielmackay changed the title poc-fast-endpoints Migrate from Minimal APIs to FastEndpoints Oct 21, 2025
@danielmackay danielmackay changed the title Migrate from Minimal APIs to FastEndpoints ✨ Migrate from Minimal APIs to FastEndpoints Oct 21, 2025
Copy link
Member

@AntPolkanov AntPolkanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments

Copy link
Member

@AntPolkanov AntPolkanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@danielmackay danielmackay merged commit 042fe0f into main Oct 23, 2025
3 checks passed
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.

3 participants