Skip to content

Latest commit

 

History

History
113 lines (78 loc) · 3.98 KB

File metadata and controls

113 lines (78 loc) · 3.98 KB

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 three templates for different scopes: a full application, a BFF-focused 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-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-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-full -n HexagonalSolution
dotnet new hexagonal-solution-bff -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-full -h
dotnet new hexagonal-solution-bff -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!