From 8c1a00a2072f721af6a2fc194eeff84c6743fd6a Mon Sep 17 00:00:00 2001 From: Edwin van den Houdt Date: Wed, 3 Jun 2026 13:35:22 +0200 Subject: [PATCH 1/3] test(bff): /health returns 200 Healthy (refs #28) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the BFF Api/Tests skeleton (.NET 10, ASP.NET Core minimal API, xUnit + WebApplicationFactory) and a failing test asserting GET /health returns 200 with a Healthy body. The endpoint does not exist yet — the test fails with NotFound, establishing red before the implementation. Co-Authored-By: Claude Opus 4.8 --- .gitignore | 27 +++++++++++++++++++ global.json | 6 +++++ services/bff/Bff.Api/Bff.Api.csproj | 9 +++++++ services/bff/Bff.Api/Program.cs | 9 +++++++ services/bff/Bff.Tests/Bff.Tests.csproj | 26 ++++++++++++++++++ services/bff/Bff.Tests/HealthEndpointTests.cs | 20 ++++++++++++++ services/bff/Bff.slnx | 4 +++ 7 files changed, 101 insertions(+) create mode 100644 .gitignore create mode 100644 global.json create mode 100644 services/bff/Bff.Api/Bff.Api.csproj create mode 100644 services/bff/Bff.Api/Program.cs create mode 100644 services/bff/Bff.Tests/Bff.Tests.csproj create mode 100644 services/bff/Bff.Tests/HealthEndpointTests.cs create mode 100644 services/bff/Bff.slnx diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1499030 --- /dev/null +++ b/.gitignore @@ -0,0 +1,27 @@ +# .NET build output +bin/ +obj/ +[Dd]ebug/ +[Rr]elease/ +*.user + +# Test results / coverage +[Tt]est[Rr]esults/ +*.trx +coverage*.json +coverage*.xml +*.coverage + +# Rider / VS / VS Code +.idea/ +.vs/ +.vscode/ + +# Node / Angular (added as the frontend lands) +node_modules/ +dist/ +.angular/ + +# OS +.DS_Store +Thumbs.db diff --git a/global.json b/global.json new file mode 100644 index 0000000..ab84b81 --- /dev/null +++ b/global.json @@ -0,0 +1,6 @@ +{ + "sdk": { + "version": "10.0.203", + "rollForward": "latestFeature" + } +} diff --git a/services/bff/Bff.Api/Bff.Api.csproj b/services/bff/Bff.Api/Bff.Api.csproj new file mode 100644 index 0000000..a3a34b6 --- /dev/null +++ b/services/bff/Bff.Api/Bff.Api.csproj @@ -0,0 +1,9 @@ + + + + net10.0 + enable + enable + + + diff --git a/services/bff/Bff.Api/Program.cs b/services/bff/Bff.Api/Program.cs new file mode 100644 index 0000000..5267f53 --- /dev/null +++ b/services/bff/Bff.Api/Program.cs @@ -0,0 +1,9 @@ +var builder = WebApplication.CreateBuilder(args); +var app = builder.Build(); + +app.MapGet("/", () => "BFF placeholder"); + +app.Run(); + +// Exposed so the test host (WebApplicationFactory) can boot the app. +public partial class Program; diff --git a/services/bff/Bff.Tests/Bff.Tests.csproj b/services/bff/Bff.Tests/Bff.Tests.csproj new file mode 100644 index 0000000..e6b2ace --- /dev/null +++ b/services/bff/Bff.Tests/Bff.Tests.csproj @@ -0,0 +1,26 @@ + + + + net10.0 + enable + enable + false + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/services/bff/Bff.Tests/HealthEndpointTests.cs b/services/bff/Bff.Tests/HealthEndpointTests.cs new file mode 100644 index 0000000..2244534 --- /dev/null +++ b/services/bff/Bff.Tests/HealthEndpointTests.cs @@ -0,0 +1,20 @@ +using System.Net; +using Microsoft.AspNetCore.Mvc.Testing; + +namespace Bff.Tests; + +public class HealthEndpointTests(WebApplicationFactory factory) + : IClassFixture> +{ + [Fact] + public async Task Health_endpoint_returns_200_and_reports_healthy() + { + var client = factory.CreateClient(); + + var response = await client.GetAsync("/health"); + + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + var body = await response.Content.ReadAsStringAsync(); + Assert.Contains("Healthy", body); + } +} diff --git a/services/bff/Bff.slnx b/services/bff/Bff.slnx new file mode 100644 index 0000000..5680319 --- /dev/null +++ b/services/bff/Bff.slnx @@ -0,0 +1,4 @@ + + + + -- 2.49.1 From b680b0f466fc1a70da16fc03e0bf0edaa694d41b Mon Sep 17 00:00:00 2001 From: Edwin van den Houdt Date: Wed, 3 Jun 2026 13:35:54 +0200 Subject: [PATCH 2/3] feat(bff): add /health endpoint (refs #28) Register ASP.NET Core health checks and map GET /health. The endpoint returns 200 with a "Healthy" body by default, making the red test pass. Smallest change to go green. Co-Authored-By: Claude Opus 4.8 --- services/bff/Bff.Api/Program.cs | 3 +++ .../Bff.Api/Properties/launchSettings.json | 23 +++++++++++++++++++ .../bff/Bff.Api/appsettings.Development.json | 8 +++++++ services/bff/Bff.Api/appsettings.json | 9 ++++++++ 4 files changed, 43 insertions(+) create mode 100644 services/bff/Bff.Api/Properties/launchSettings.json create mode 100644 services/bff/Bff.Api/appsettings.Development.json create mode 100644 services/bff/Bff.Api/appsettings.json diff --git a/services/bff/Bff.Api/Program.cs b/services/bff/Bff.Api/Program.cs index 5267f53..633eec0 100644 --- a/services/bff/Bff.Api/Program.cs +++ b/services/bff/Bff.Api/Program.cs @@ -1,7 +1,10 @@ var builder = WebApplication.CreateBuilder(args); +builder.Services.AddHealthChecks(); + var app = builder.Build(); app.MapGet("/", () => "BFF placeholder"); +app.MapHealthChecks("/health"); app.Run(); diff --git a/services/bff/Bff.Api/Properties/launchSettings.json b/services/bff/Bff.Api/Properties/launchSettings.json new file mode 100644 index 0000000..47e0b9f --- /dev/null +++ b/services/bff/Bff.Api/Properties/launchSettings.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "http://localhost:5249", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:7106;http://localhost:5249", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/services/bff/Bff.Api/appsettings.Development.json b/services/bff/Bff.Api/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/services/bff/Bff.Api/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/services/bff/Bff.Api/appsettings.json b/services/bff/Bff.Api/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/services/bff/Bff.Api/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} -- 2.49.1 From 1913aa5628047e8585bee127d0a7eab561e79631 Mon Sep 17 00:00:00 2001 From: Edwin van den Houdt Date: Wed, 3 Jun 2026 13:36:15 +0200 Subject: [PATCH 3/3] docs(prd): target .NET 10 LTS instead of 9 (refs #28) The PRD pinned ".NET 9 (LTS at iteration time)", but .NET 9 is STS and reaches end-of-life around now; the actual LTS at this iteration is .NET 10. The BFF (and the services to follow) target net10.0, pinned via global.json. Correct the PRD to match. Co-Authored-By: Claude Opus 4.8 --- docs/PRD.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/PRD.md b/docs/PRD.md index e72b176..57577ff 100644 --- a/docs/PRD.md +++ b/docs/PRD.md @@ -85,7 +85,7 @@ The five flows form the BDD acceptance backbone (Gherkin scenarios in `tests/acc - **Source control & collaboration:** **Gitea** (Respellion self-hosted) — repository, issues, milestones, labels, projects, releases, container registry, wiki, packages. - **CI/CD:** **Gitea Actions** running on Respellion-hosted `act_runner` instances. Workflow files live in `.gitea/workflows/`. Marketplace actions are referenced via absolute URLs (`uses: https://github.com/actions/checkout@v4` or Gitea-hosted equivalents where available) for reproducibility. -- **Backend:** .NET 9 (LTS at iteration time), C#, minimal APIs for BFF, MediatR for in-process messaging within Domain Service, EF Core for the projection store and domain DB. +- **Backend:** .NET 10 (LTS at iteration time), C#, minimal APIs for BFF, MediatR for in-process messaging within Domain Service, EF Core for the projection store and domain DB. - **Frontend:** Angular (latest LTS) + TypeScript, standalone components + signals, Nx monorepo, NL Design System component library, Angular Testing Library + Playwright. - **Workflow:** Flowable (BPMN + DMN) via Docker image; Postgres for engine store. - **Identity:** Keycloak with pre-seeded realms. -- 2.49.1