PANiXiDA.Templates.DotnetBackend
1.0.20
dotnet new install PANiXiDA.Templates.DotnetBackend@1.0.20
PANiXiDA .NET Backend Template
Reusable .NET backend service template for PANiXiDA-style modular services.
The template produces a ready-to-build solution with:
- ASP.NET Core host;
- modular Domain/Application/Infrastructure/Presentation projects;
- PostgreSQL persistence and EF migrator;
- empty module structure ready for the first real feature;
- unit, integration, functional, and architecture tests;
- Dockerfiles for API and migrator;
- Helm values for development and production;
- GitHub Actions CI/CD workflow;
- OpenTelemetry-ready configuration.
Purpose
Use this repository as the source for a dotnet new template package.
It is intended to create new backend services consistently from the command line,
Visual Studio, Rider, VS Code, or any IDE that can work with .NET SDK templates.
The generated service is not supposed to keep every template artifact forever.
After generation, follow TEMPLATE_FIRST_USE.md in the generated service or in
this repository to create the first real feature and fill project-specific documentation.
This repository keeps source examples for template maintainers under
RepositoryExamples folders. They are excluded from dotnet new output and
from the NuGet template package content. Marker and assembly files stay outside
that folder convention so generated services keep empty but valid projects.
Template Parameters
| Parameter | CLI option | Default | Replaces |
|---|---|---|---|
| Solution name | -n, --name |
current directory name | PANiXiDA.DotnetTemplate |
| Organization | --organization |
Organization |
Organization in namespaces and file names |
| Product | --product |
Product |
Product in namespaces and file names |
| Module | --module |
Module |
.Module namespace/project segment |
| Service slug | --service-slug |
dotnet-template |
Helm names, database names, service names |
| Repository name | --repository-name |
dotnet-backend-template |
container image repository path segment |
| Registry owner | --registry-owner |
panixida-templates |
container image owner path segment |
| README service name | --service-name |
<ServiceName> |
README service title placeholder |
Example:
dotnet new panixida-backend \
-n Acme.Billing \
--organization Acme \
--product Billing \
--module Payments \
--service-slug billing \
--repository-name billing-service \
--registry-owner acme
Install From The Repository
Install the template directly from a local checkout:
dotnet new install .
List installed templates:
dotnet new list panixida
Create a service:
dotnet new panixida-backend \
-n Acme.Billing \
--organization Acme \
--product Billing \
--module Payments \
--service-slug billing \
--repository-name billing-service \
--registry-owner acme \
-o Acme.Billing
Uninstall the local template:
dotnet new uninstall .
Pack And Publish As NuGet Template Package
Build a local NuGet package:
dotnet pack template/PANiXiDA.DotnetBackendTemplate.csproj --configuration Release
Install from the generated package:
dotnet new install template/bin/Release/PANiXiDA.Templates.DotnetBackend.*.nupkg
Package versions are generated by Nerdbank.GitVersioning from version.json.
Publishing to NuGet.org is handled by the publish-template job in
.github/workflows/ci.yml on push to main. It uses
PANiXiDA-Infrastructure/ci-cd/.github/workflows/dotnet-publish-global-nuget.yml.
The repository must have:
TEMPLATE_PROJECTvariable set totemplate/PANiXiDA.DotnetBackendTemplate.csproj;NUGET_API_KEYsecret with a NuGet.org API key.
After publishing, developers can install the template by package id:
dotnet new install PANiXiDA.Templates.DotnetBackend
Visual Studio And Other IDEs
This template uses the .NET SDK template engine, so the same package can be used from multiple IDEs.
Typical Visual Studio flow:
- Install the template package with
dotnet new install. - Restart Visual Studio if the template list was already open.
- Open
Create a new project. - Search for
PANiXiDAorBackend Service. - Fill template parameters in the UI.
- Create the solution.
Rider and VS Code can use the same template through terminal commands. IDEs that
read .NET SDK templates may also show the configured parameters from
.template.config/template.json and .template.config/ide.host.json.
Generated Service First Steps
After creating a service from this template:
- Open the generated solution.
- Read
TEMPLATE_FIRST_USE.md. - Create the first real feature slice and initial EF migration when the model is ready.
- Update appsettings, Helm values, CI/CD variables, README, and deployment names.
- Run restore, format, build, test, Docker build, and Helm validation.
Repository Layout
| Path | Purpose |
|---|---|
.template.config/template.json |
Main dotnet new template definition. |
.template.config/dotnetcli.host.json |
CLI aliases for template parameters. |
.template.config/ide.host.json |
IDE metadata for Visual Studio-style template UI. |
template/ |
NuGet template package project. |
icon.png |
NuGet package icon. |
version.json |
NuGet package versioning configuration. |
README.md |
Documentation for this template repository. |
README_TEMPLATE.md |
README generated as README.md in a new service. |
TEMPLATE_FIRST_USE.md |
First-use checklist for manual or generated service use. |
src/ |
Template service source projects and repository-only examples. |
tests/ |
Template service tests and repository-only example tests. |
tools/ |
EF migrator project. |
deploy/helm/ |
Helm deployment values. |
Development
Validate the template source solution:
dotnet restore PANiXiDA.DotnetTemplate.slnx
dotnet format PANiXiDA.DotnetTemplate.slnx --verify-no-changes
dotnet build PANiXiDA.DotnetTemplate.slnx --configuration Release
dotnet test PANiXiDA.DotnetTemplate.slnx --configuration Release
dotnet pack template/PANiXiDA.DotnetBackendTemplate.csproj --configuration Release
Validate template generation locally:
dotnet new uninstall . || true
dotnet new install .
dotnet new panixida-backend \
-n Acme.Billing \
--organization Acme \
--product Billing \
--module Payments \
--service-slug billing \
--repository-name billing-service \
--registry-owner acme \
-o .tmp/generated-service
Then inspect .tmp/generated-service and run:
dotnet restore .tmp/generated-service/Acme.Billing.slnx
Remove .tmp/ after validation.
Sources
The implementation follows the .NET template engine model documented by
Microsoft and the dotnet/templating project:
This package has 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.