apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
metadata:
  name: api-aspnet-minimal
  title: C# — ASP.NET Core Minimal APIs (lightweight)
  description: |
    Compact C# HTTP API using ASP.NET Core Minimal APIs on the
    current LTS .NET runtime. Native AOT is available; opt in when
    startup/footprint justify the build-time cost.
  tags:
    - csharp
    - lightweight-api
    - aspnet
    - minimal-api
  links:
    - url: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/minimal-apis/overview
      title: ASP.NET Core Minimal APIs
    - url: https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/
      title: Native AOT
    - url: https://learn.microsoft.com/en-us/nuget/consume-packages/central-package-management
      title: Central Package Management
    - url: https://dotnet.microsoft.com/platform/support/policy/dotnet-core
      title: .NET support policy
spec:
  owner: abp
  type: service
  parameters:
    - title: Stack Configuration
      required:
        - database
      properties:
        backend:
          title: Backend
          type: string
          const: aspnet-minimal
        frontend:
          title: Frontend
          type: string
          const: api-only
        database:
          title: Database
          type: string
          enum:
            - postgres
            - sqlserver
            - sqlite
            - none
          enumNames:
            - 'Postgres — Npgsql provider'
            - 'SQL Server — first-party provider'
            - 'SQLite'
            - 'None — stateless service'
        persistence:
          title: Persistence
          type: string
          default: ef-core
          enum:
            - ef-core
            - dapper
            - none
          enumNames:
            - 'Entity Framework Core — full ORM'
            - 'Dapper — micro-ORM, hand-written SQL'
            - 'None — raw ADO.NET'
        background_jobs:
          title: Background Jobs
          type: string
          default: hosted-service
          enum:
            - hosted-service
            - hangfire
            - none
          enumNames:
            - 'IHostedService — built-in background tasks'
            - 'Hangfire — durable, dashboard, retries'
            - 'None'
        auth:
          title: Authentication
          type: string
          default: none
          enum:
            - none
            - jwt-bearer
          enumNames:
            - 'None'
            - 'JWT Bearer — Microsoft.AspNetCore.Authentication.JwtBearer'
        observability:
          title: Observability
          type: string
          default: none
          enum:
            - none
            - opentelemetry
          enumNames:
            - 'None'
            - 'OpenTelemetry'
        native_aot:
          title: Native AOT
          type: string
          default: disabled
          enum:
            - disabled
            - enabled
          enumNames:
            - 'Disabled — JIT runtime'
            - 'Enabled — Native AOT publish'
  tooling:
    package_manager: dotnet-nuget
    language_flavor: csharp
    test_runner: xunit
    lint_format: dotnet-format
    runtime_cli: dotnet
  smoke_test: |
    GET /health returns 200. One xUnit + WebApplicationFactory
    integration test asserts the response status.
  switch_when: |
    MVC features / filters / model binding extensibility / team
    familiarity with controllers / server-rendered Razor / Blazor →
    web-aspnet-mvc. Cross-platform native app → MAUI (future
    sibling).
