All notable changes to the template are recorded here. Versions follow Semantic Versioning: breaking structure changes bump the major version.
First stable release. Projects created from 0.0.1 differ in structure and settings; see Upgrading from 0.0.1.
- Configuration from environment variables:
.envat the repository root (the API,dotnet efand Docker Compose read it; only.env.exampleis committed). Typed settings classes like pydanticBaseSettings([ConfigurationKeyName], defaults, data annotations), markedIEnvSettingsand discovered automatically, all validated at startup with every invalid variable reported by name. Raw reads with DotNetEnv (Env.GetString). APP_ENV(dev/stage/prod) sets the ASP.NET Core environment.- Email: typed emails (
EmailTemplate), Scriban templates with automatic HTML escaping, a shared layout, CSS inlining with PreMailer.Net, plain-text part, sending with MailKit (logged whenEMAIL_HOSTis empty), Mailpit inbox for local development, sample welcome email (ADR-0003). - Background jobs: Hangfire with PostgreSQL (schema
hangfire) for queued, delayed and recurring jobs with retries;/jobsdashboard (open in Development, basic auth elsewhere);APP_ROLE(all/api/worker);JOBS_ENABLEDto switch Hangfire off (jobs then run inline); welcome email and a sample recurring job (ADR-0004). - Production image with supervisor: API (8080) and job worker (8081) in one container, health check on both,
the container stops if a process can't stay up; supervisor config for VMs (
deploy/supervisor/). - One
docker-compose.ymlat the root with profiles:db+mailpitfor local development,dev(API withdotnet watchin Docker),prod(production image). PostgreSQL and Mailpit listen on127.0.0.1only. - Per-project ports picked at
dotnet newtime (DB_PORT,API_PORT,EMAIL_PORT,MAILPIT_UI_PORT), so several projects run side by side. - Swagger UI at
/swagger(Development) on the built-in OpenAPI document, with JWT Authorize and a lock only on endpoints that need a token. - Global exception handling:
ExceptionMappingturns bad JSON, missing bodies, unique/foreign-key and concurrency violations, aborted requests and unknown errors into the right status and a stable error code; client errors logged as one line, real failures with the stack trace;correlationIdin every error response. - Application exceptions sharing the error catalog:
RequestValidationException,UnauthorizedException,ForbiddenException,NotFoundException,ConflictException,BusinessRuleException(422),ExternalServiceException(502/503), andError.ToException(). - Production JSON settings (
JsonDefaults): strict reading (no numbers as strings, enum numbers, duplicate properties, comments), readable Unicode, dates always ISO 8601 UTC withZ, JSON path ininvalid_jsonerrors. - CORS for exact origins from
CORS_ALLOWED_ORIGINS, validated at startup (no wildcards). GET /with the API name, environment, version and useful links.- Optional feature auto-discovery:
dotnet new ... --auto-discovery truemaps everyIEndpointsclass and registers everyXService : IXService; manual registration stays the default. Route snapshot and wiring tests guard both modes. InitialCreatemigration shipped with the template; the Hangfire schema comes as a migration too.- NuGet lock files (
packages.lock.json) with locked restores in CI and the Docker build. - Dependency injection validated at startup (
ValidateOnBuild,ValidateScopes) in every environment. - Developer guides, one per topic (
docs/README.md): configuration and environments, adding a feature, database and migrations (including data migrations), request data (route, query strings, headers, JSON bodies, PATCH, file uploads), response shaping (the equivalent of Laravel API Resources), errors and exceptions, authentication, email, background jobs, CORS, JSON, Swagger, logging and correlation ids, testing, Docker and deployment, packages and dependencies. - ADRs for email (ADR-0003) and background jobs (ADR-0004).
- Template short name is
dotnet-api-template(wascode4mk-api); display name "Code4mk ASP.NET Core API Template". - The API never changes the database at startup: no
EnsureCreated, no automatic migrations; apply them withdotnet ef database update. - Endpoint classes implement
IEndpoints(were staticMapXEndpointsextension methods). JwtOptions/EmailOptionsareJwtSettings/EmailSettings, bound fromJWT_*/EMAIL_*.- The welcome email is sent from a background job (sign-up no longer waits for SMTP).
- ASP.NET Core and EF Core packages and
dotnet-ef10.0.12, Npgsql 10.0.3; central transitive pinning enabled. - Template repository workflows (
template-ci,publish) run manually;template-citests both wiring modes.
- Startup seeding of an admin user and sample products (
SEED_*settings). Register withPOST /api/users; promote an admin with SQL (see the authentication guide). docker/.env.exampleand the Compose files underdocker/(replaced by the root.env.exampleanddocker-compose.yml).appsettings.*.jsonconfiguration values (only logging remains there).
- The first
dotnet ef database updateon an empty database no longer logs a misleading "Failed executing DbCommand" for the missing history table. dotnet watchno longer fails readingobj\Debug/.../staticwebassets.development.jsonon macOS/Linux.- First-run docs build the project before
dotnet ef(it doesn't restore packages itself).
Microsoft.OpenApi2.0.0 → 2.12.0 (GHSA-v5pm-xwqc-g5wc).Newtonsoft.Jsonpinned to 13.0.4: Hangfire brings 11.0.1 (GHSA-5crp-9r3c-p9vr).- Hangfire dashboard basic auth with constant-time comparison; not served outside Development without credentials.
1.0.0 is a new baseline, not an in-place upgrade: create new projects with 1.0.0. For an existing 0.0.1 project, the main steps are:
- Update the template:
dotnet new install Code4mk.MinimalApi.Template::1.0.0(the command is nowdotnet new dotnet-api-template). - Move configuration to a root
.env(from.env.example): database, JWT and email settings are environment variables now (DB_*,JWT_*,EMAIL_*), notappsettings.*.json. - Create an initial migration if the project has none, and apply migrations with
dotnet ef database updatebefore starting the API: it no longer creates or seeds the database. - Copy the features you want from a freshly generated 1.0.0 project (for example
Infrastructure/Jobs,Infrastructure/Email,Common/Settings) and follow the matching developer guide.
First preview.
- Minimal API solution with feature folders and a service layer (short name
code4mk-api). - Sample features: Auth (JWT login), Users, Products.
Result<T>pattern, ProblemDetails errors, .NET 10 built-in validation.- EF Core with PostgreSQL, development seed data.
- Correlation id middleware, health checks, OpenAPI.
- Docker and Docker Compose, GitHub Actions for build/test and image publishing.
- Unit tests (EF Core in-memory) and integration tests (
WebApplicationFactory). - ADRs, architecture overview, API conventions and developer guides.