Production-ready .NET 10 project templates: Minimal API, Aspire orchestration, and Full-Stack (React + API). Supports Keycloak or Microsoft Entra ID authentication, PostgreSQL, FusionCache, JSON:API, MediaKit, and Azure deployment.
$ dotnet add package DotnetForge.TemplatesProduction-ready .NET 10 project templates. One NuGet package, three templates.
dotnet new install DotnetForge.Templates
| Template | Command | What you get |
|---|---|---|
| Forge API | dotnet new forge-api -n MyApp | Standalone Minimal API with OpenTelemetry, health checks, resilience |
| Forge Aspire | dotnet new forge-aspire -n MyApp | API + .NET Aspire orchestration + Azure deployment |
| Forge Full-Stack | dotnet new forge-fullstack -n MyApp | API + Aspire + React frontend (Vite/Bun) + Docker deployment |
# Create a new project (Keycloak — default)
dotnet new forge-aspire -n MyApp
# Or with Microsoft Entra ID
dotnet new forge-aspire -n MyApp --auth-provider entra
# Optionally provide Entra IDs upfront
dotnet new forge-api -n MyApp --auth entra --entra-tenant-id abc123 --entra-client-id def456
# Build and run
cd MyApp
dotnet run --project src/MyApp.AppHost
| Flag | Default | Description |
|---|---|---|
-n, --name | MyApp | Project name (PascalCase). Auto-generates lowercase variants for config. |
--auth-provider / --auth | keycloak | Identity provider: keycloak or entra |
--entra-tenant-id | common | Microsoft Entra ID tenant ID (only when --auth entra) |
--entra-client-id | YOUR_CLIENT_ID | Microsoft Entra ID application (client) ID (only when --auth entra) |
--entra-domain | yourtenant.onmicrosoft.com | Microsoft Entra ID tenant domain (only when --auth entra) |
forge-api / forge-aspire / forge-fullstack)forge-aspire / forge-fullstack)azd upAspire.Hosting.Testingforge-fullstack only)WithBunPackageInstallation())When using --auth-provider entra, you need an Azure App Registration:
admin, author, reader) under App roles → Create app roleapi://<client-id>/access_as_user)http://localhost:5173appsettings.json with your Tenant ID, Client ID, and DomainThe Entra parameters are optional at project creation — you can leave the defaults and configure appsettings.json later:
# Minimal — configure in appsettings.json after project creation
dotnet new forge-api -n MyApp --auth entra
# Or provide values upfront
dotnet new forge-api -n MyApp --auth entra \
--entra-tenant-id your-tenant-id \
--entra-client-id your-client-id \
--entra-domain yourtenant.onmicrosoft.com
MyApp/
├── src/
│ ├── MyApp.Api/ # Minimal API
│ │ ├── Data/ # Repositories + cached decorators
│ │ ├── Entities/ # Domain entities (Book, Author, Category)
│ │ ├── Features/ # Feature slices (Admin, Public, Dev)
│ │ ├── Infrastructure/ # Auth, caching, validation, etc.
│ │ ├── Migrations/ # EF Core migrations
│ │ └── Services/ # Cross-cutting services
│ ├── MyApp.AppHost/ # Aspire orchestrator (aspire/fullstack)
│ ├── MyApp.AppHost.Extensions/ # Enterprise publisher
│ ├── MyApp.ServiceDefaults/ # Shared OTel + health + resilience
│ ├── MyApp.Web/ # React frontend (fullstack)
│ └── MyApp.KeycloakTheme/ # Keycloakify theme (fullstack, Keycloak only)
├── tests/
│ ├── MyApp.Api.UnitTests/ # xUnit v3 + NSubstitute
│ ├── MyApp.Api.FeatureTests/ # Aspire integration tests (aspire/fullstack)
│ └── MyApp.PerformanceTests/ # k6 load tests
├── MyApp.slnx # Solution file
├── docker-compose.api.yml # Production API deployment
└── docker-compose.api.build.yml # Local API build
azd init
azd up
docker compose -f docker-compose.api.build.yml up -d
azd (aspire/fullstack)The template includes a Books Management sample domain with:
This gives you working CRUD endpoints, relationships, media uploads, caching, and search — all wired up and ready to extend. See SAMPLE_DOMAIN.md for details.
dotnet-forge/
├── shared/ # Common files across all templates (edit here)
├── overrides/ # Template-specific file variants (edit here)
│ ├── forge-api/
│ ├── forge-aspire/
│ └── forge-fullstack/
├── template-configs/ # .template.config per template
├── templates/ # BUILD OUTPUT (git-ignored)
├── build.ps1 # Assembles templates from shared + overrides
└── DotnetForge.Templates.csproj
# Assemble templates
./build.ps1
# Install locally
dotnet new install ./templates/forge-api
dotnet new install ./templates/forge-aspire
dotnet new install ./templates/forge-fullstack
# Test
dotnet new forge-aspire -n TestApp
cd TestApp && dotnet build
# Package
dotnet pack DotnetForge.Templates.csproj
dotnet new uninstall DotnetForge.Templates