Kodevy.Platform.API 4.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Kodevy.Platform.API --version 4.2.0
                    
NuGet\Install-Package Kodevy.Platform.API -Version 4.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Kodevy.Platform.API" Version="4.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Kodevy.Platform.API" Version="4.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Kodevy.Platform.API" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Kodevy.Platform.API --version 4.2.0
                    
#r "nuget: Kodevy.Platform.API, 4.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Kodevy.Platform.API@4.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Kodevy.Platform.API&version=4.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Kodevy.Platform.API&version=4.2.0
                    
Install as a Cake Tool

Kodevy Platform

Shared .NET 8 libraries for building microservices with Clean Architecture. These packages provide the foundational plumbing so your microservices stay consistent, production-ready, and free of boilerplate.


Packages

Package Description
Kodevy.Platform.API API plumbing — middleware, JWT authentication, authorization, Swagger, health checks, Serilog integration
Kodevy.Platform.Application Application layer primitives — API clients, configuration, current user service, request/response wrappers
Kodevy.Platform.Domain Domain abstractions — auditable entity interfaces and base types
Kodevy.Platform.Infra Infrastructure components — EF Core extensions (SQL Server, PostgreSQL), database providers, Serilog sinks

Installation

dotnet add package Kodevy.Platform.API
dotnet add package Kodevy.Platform.Application
dotnet add package Kodevy.Platform.Domain
dotnet add package Kodevy.Platform.Infra

Install only the layers your project needs. In a Clean Architecture setup:

  • API projectKodevy.Platform.API
  • Application projectKodevy.Platform.Application
  • Domain projectKodevy.Platform.Domain
  • Infrastructure projectKodevy.Platform.Infra

What's Included

Kodevy.Platform.API

  • Global exception handling middleware
  • Request context middleware
  • JWT authentication strategy (configurable)
  • Claims-based authorization strategy
  • API versioning via URL segment (/api/v{version}/...)
  • Swagger / OpenAPI configuration with per-version documents and JWT bearer support
  • Health check extensions (including EF Core database checks)
  • Serilog integration

Kodevy.Platform.Application

  • ApiClientBase — typed HTTP client with built-in auth token handling
  • ApiResult / ServiceResponseWrapper / PaginatedResponseWrapper — standard response wrappers
  • ICurrentUserService — access to the current authenticated user
  • IUnitOfWork — persistence contract
  • BaseApplicationSettings / AuthConfiguration / JwtSettings — configuration models

Kodevy.Platform.Domain

  • IAuditableEntity — interface for entities with created/modified tracking

Kodevy.Platform.Infra

  • DatabaseConnection / DatabaseProvider — multi-provider database setup (SQL Server, PostgreSQL)
  • AuditSaveChangesInterceptor — automatic audit field population on save
  • RelationalDatabaseExtensions — EF Core registration with environment-based migration behavior
  • Serilog database sinks (SQL Server, PostgreSQL)

Configuration

Authentication & Authorization

Configure in appsettings.json:

{
  "AuthConfiguration": {
    "AuthenticationStrategy": "Jwt",
    "AuthorizationStrategy": "Claims"
  },
  "JwtSettings": {
    "Secret": "your-secret-key",
    "Issuer": "your-issuer",
    "Audience": "your-audience",
    "SigningAlgorithm": "HS256",
    "Authority": "",
    "JwksUri": "",
    "RequireHttpsMetadata": true,
    "RefreshOnIssuerKeyNotFound": true,
    "ValidAlgorithms": []
  }
}

Compatibility notes:

  • Existing HS256 consumers continue to work with SigningAlgorithm: HS256 (default).
  • For RS256, set SigningAlgorithm: RS256 and configure either Authority or JwksUri.
  • Services validate tokens locally using cached signing keys; no per-request network call is required.

HS256 mode requirements:

  • SigningAlgorithm = HS256 (or omitted, default)
  • Secret (minimum 32 chars), Issuer, Audience

RS256 mode requirements:

  • SigningAlgorithm = RS256
  • Issuer, Audience
  • one of Authority or JwksUri
  • Secret is not required in RS256 mode

API Versioning (URL Segment)

In your API project startup:

builder.Services.AddControllers();
builder.Services.AddSwaggerConfiguration();
app.UseSwaggerConfiguration();
app.MapControllers();

Controller convention (template standard):

[ApiController]
[ApiVersion("1.0")]
[Route("api/v{version:apiVersion}/[controller]")]
public sealed class WeatherController : ControllerBase
{
}

Kodevy.Platform.API configures:

  • URL segment version reader (/api/v1/...)
  • default API version fallback to 1.0 when unspecified
  • one Swagger document per API version at /swagger/{groupName}/swagger.json

Database

{
  "DatabaseConfiguration": {
    "Provider": "PostgreSQL",
    "ConnectionString": "Host=localhost;Database=mydb;Username=user;Password=pass"
  }
}

Supported providers: SqlServer, PostgreSQL

Migration behavior:

  • Development — migrations are automatically applied on startup
  • Production — migrations are not applied automatically. Set RUN_MIGRATIONS_ONLY=true to apply migrations and exit

Used By

These packages are consumed by microservices generated with the Kodevy Microservice Templates:

dotnet new install Kodevy.Templates.Microservice.Init
dotnet new kodevy-microservice-init \
  --organization Contoso \
  --system Platform \
  --microservice Identity

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.4.1 103 8/18/2026
4.4.0 96 8/18/2026
4.3.1 151 4/6/2026
4.3.0 117 3/22/2026
4.2.2 131 3/16/2026
4.2.1 121 3/12/2026
4.2.0 110 3/12/2026
4.1.1 124 3/2/2026
4.1.0 114 3/2/2026
4.0.0 116 3/1/2026
3.0.1 127 2/8/2026
3.0.0 126 1/2/2026
2.1.0 180 12/26/2025
2.0.0 178 12/26/2025
1.0.0 206 12/24/2025