Kodevy.Platform.API
4.2.2
See the version list below for details.
dotnet add package Kodevy.Platform.API --version 4.2.2
NuGet\Install-Package Kodevy.Platform.API -Version 4.2.2
<PackageReference Include="Kodevy.Platform.API" Version="4.2.2" />
<PackageVersion Include="Kodevy.Platform.API" Version="4.2.2" />
<PackageReference Include="Kodevy.Platform.API" />
paket add Kodevy.Platform.API --version 4.2.2
#r "nuget: Kodevy.Platform.API, 4.2.2"
#:package Kodevy.Platform.API@4.2.2
#addin nuget:?package=Kodevy.Platform.API&version=4.2.2
#tool nuget:?package=Kodevy.Platform.API&version=4.2.2
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 project —
Kodevy.Platform.API - Application project —
Kodevy.Platform.Application - Domain project —
Kodevy.Platform.Domain - Infrastructure project —
Kodevy.Platform.Infra
What's Included
Kodevy.Platform.API
- Global exception handling middleware
- Request context middleware
- JWT authentication strategy (configurable)
- Claims-based authorization strategy
ToHttpResultmapping that returns consistent API envelope metadata (statusCode,path,timestamp, and developmentstackTrace)- 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 handlingApiResult/ServiceResponseWrapper/PaginatedResponseWrapper— standard response wrappersICurrentUserService— access to current authenticated user context (UserId,Email,SessionId,Roles)GetRequiredUserId()— helper extension for strict user-id retrievalIUnitOfWork— persistence contractBaseApplicationSettings/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 saveRelationalDatabaseExtensions— 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": [],
"PrivateKeyPem": "",
"KeyId": "identity-key-1"
}
}
Compatibility notes:
- Existing HS256 consumers continue to work with
SigningAlgorithm: HS256(default). - For RS256, set
SigningAlgorithm: RS256and configure eitherAuthorityorJwksUri. - 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 = RS256Issuer,Audience- one of
AuthorityorJwksUri Secretis not required in RS256 mode
Token issuer extras (for auth/identity services):
PrivateKeyPem- RS256 private key (PEM) used for signingKeyId- JWKS key identifier (kid) published with issued tokens
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.0when 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=trueto 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 | Versions 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. |
-
net8.0
- Kodevy.Platform.Application (>= 4.2.2)
- Kodevy.Platform.Infra (>= 4.2.2)
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 8.0.8)
- Microsoft.AspNetCore.Mvc.Versioning (>= 5.1.0)
- Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer (>= 5.1.0)
- Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore (>= 8.0.0)
- Microsoft.IdentityModel.JsonWebTokens (>= 8.1.1)
- Microsoft.IdentityModel.Protocols (>= 8.1.1)
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 8.1.1)
- Microsoft.OpenApi (>= 1.6.14)
- Serilog (>= 4.3.0)
- Serilog.AspNetCore (>= 8.0.0)
- Swashbuckle.AspNetCore (>= 6.5.0)
- System.IdentityModel.Tokens.Jwt (>= 8.1.1)
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 |