GPreviatti.Template.Hexagonal.Solution 10.13.0

dotnet new install GPreviatti.Template.Hexagonal.Solution@10.13.0
                    
This package contains a .NET Template Package you can call from the shell/command line.

Hexagonal architecture solution template

Publish template in Nuget.org Mutation testing badge

This repository provides a reusable .NET template package to bootstrap projects using Hexagonal Architecture (Ports and Adapters) and modern engineering practices.

It includes four templates for different scopes: a full application, a BFF-focused application, a Blazor Web UI application, and a contracts-only package.

Table of contents

What this project provides

The package GPreviatti.Template.Hexagonal.Solution lets you quickly create solutions with:

  • clear layering and separation of concerns;
  • HTTP and gRPC integration patterns;
  • observability and test-first tooling support;
  • examples that help accelerate initial development.

Available templates

  • hexagonal-solution-simple: streamlined hexagonal solution with Core, Infrastructure, and WebApp layers plus unit/integration/load test projects — ideal for straightforward applications.
  • hexagonal-solution-full: complete hexagonal solution with Domain, Application, Infrastructure, WebApp, and test/load test projects.
  • hexagonal-solution-bff: Backend-for-Frontend oriented solution with HTTP/gRPC adapters, integration tests, and load tests.
  • hexagonal-solution-webui: Blazor Web App oriented solution with contracts/infrastructure separation and bUnit component unit tests.
  • hexagonal-solution-contracts: lightweight contracts package for shared DTOs, request/response models, and protobuf definitions.

Template documentation

Each template has its own README with architecture details, structure, and helper commands:

Technologies included

  • FluentValidation
  • OpenTelemetry
  • Entity Framework Core
  • gRPC / Protobuf
  • xUnit, Moq, AutoFixture
  • Docker and Docker Compose
  • k6 (load testing)
  • Stryker (mutation testing)
  • GitHub Actions
  • Hybrid cache
  • RabbitMQ

Quick start

Install the template package:

dotnet new install GPreviatti.Template.Hexagonal.Solution

Create a new solution from each template:

dotnet new hexagonal-solution-simple -n HexagonalSolution
dotnet new hexagonal-solution-full -n HexagonalSolution
dotnet new hexagonal-solution-bff -n HexagonalSolution
dotnet new hexagonal-solution-webui -n HexagonalSolution
dotnet new hexagonal-solution-contracts -n HexagonalSolution

Template options and help

Use -h to list available options for each template:

dotnet new hexagonal-solution-simple -h
dotnet new hexagonal-solution-full -h
dotnet new hexagonal-solution-bff -h
dotnet new hexagonal-solution-webui -h
dotnet new hexagonal-solution-contracts -h

Update or uninstall

Update to the latest published template version:

dotnet new update GPreviatti.Template.Hexagonal.Solution

Uninstall the template package:

dotnet new uninstall GPreviatti.Template.Hexagonal.Solution

Recommendation

Keep the provided Order sample scenario in place until your own domain scenario is implemented. It serves as a reference for architecture, project organization, and tests.

Official template docs

https://github.com/dotnet/templating/wiki

Contributing

Have a feature request or found a bug? We'd love to hear from you!

  • net10.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.13.0 111 5/25/2026
10.12.0 113 5/23/2026
10.11.0 125 5/18/2026
10.10.0 139 5/8/2026
10.9.0 171 4/21/2026
10.8.0 160 4/21/2026
10.7.0 155 4/19/2026
10.6.0 158 4/18/2026
10.5.0 180 4/10/2026
10.4.0 172 4/8/2026
10.3.0 174 4/3/2026
10.2.0 174 4/3/2026
10.1.0 176 4/3/2026
10.0.3 267 12/31/2025
10.0.2 335 12/21/2025
10.0.1 346 12/20/2025
10.0.0 418 11/25/2025
9.5.0 546 11/21/2025
9.4.0 614 11/20/2025
9.3.0 464 9/24/2025
Loading failed

Highlights
     - Introduce a new Web UI template based on Blazor Web App, following hexagonal layering (Contracts, Infrastructure, WebApp).
     - Establish Web UI testing baseline with bUnit + xUnit component/unit tests.

     Template Catalog
     - Template set now includes four options: Full, BFF, WebUi, and Contracts.

     Branch Scope
     - Add complete WebUi template scaffolding: solution file, template metadata, build settings, VS Code launch/tasks, and Docker assets.
     - Implement Mock API order endpoints and supporting contracts (`OrderDto`, `ItemDto`) for local development.
     - Build Blazor app structure and UX updates: routing in `App.razor`, `NotFound` layout flow, improved `Home` page order rendering/loading state, and reconnect modal (`.razor`, `.css`, `.js`).
     - Configure observability assets for local environments (Grafana Alloy/Loki/Prometheus/Tempo and profiling support in docker files).
     - Add and refine unit/component test infrastructure for Web UI components (including base fixtures and logging helpers).

     Cross-Template and Maintenance Updates
     - Refresh package lock files and dependency metadata across templates.
     - Improve template and repository documentation (root and WebUi README updates).
     - Include coding-agent guidance (`AGENTS.md`) and remove obsolete endpoint wiring/components.