Choose a template
Three compositions of the same business code, a monolith, a modular monolith and a service, and what sets them apart.
What they are
PouryaKit.Templates holds three Project templates. Each starts a new application from the Proving Sample's business code; they differ only in how that code is composed into a Host.
The same business code in every template
Moving from one composition to another leaves the business code as it is: What each composition composes.
When to use each
| Template | Short name | Choose it when |
|---|---|---|
| Monolith | pouryakit-monolith | You start with one Module and no need for Modularity yet |
| Modular monolith | pouryakit-modular-monolith | You have, or soon will have, several Modules in one Host |
| Service | pouryakit-service | One Module runs in a Host of its own and receives another Host's Integration Events and Snapshots over RabbitMQ |
Template choice walks through the questions that decide it.
Install and generate
Install the template package
dotnet new install PouryaKit.Templates@0.1.0-preview.2Generate the one you chose
dotnet new pouryakit-monolith -n Acme.Shop
dotnet new pouryakit-modular-monolith -n Acme.Shop
dotnet new pouryakit-service -n Acme.StockWhat every template holds
| Stated in | |
|---|---|
| The Host's composition and startup checks, the same in each | What each composition composes |
| A smoke test that hosts the generated Host against PostgreSQL in a container | The smoke test |
| The service defaults recipes, as the application's own code | The optional recipes |
| Every Kit package pinned at the template package's version | Install and generate |
Next steps
Host recipes
The service defaults a Kit Host composes: OpenTelemetry that exports the Kit's telemetry, liveness and readiness endpoints, service discovery, one resilience pipeline for every client, and Serilog.
Monolith
pouryakit-monolith, the single-Module start that grows into the modular monolith when a second Module arrives.