feat(api+web): merge REST API and Blazor UI into single process

Previously the API (heimdall-central) and Blazor UI (heimdall-web) ran as
separate containers with the Blazor Server making internal HTTP calls to
the API. This caused the Blazor circuit to disconnect when the API was
unreachable (network error → "Une erreur réseau est survenue").

Now both serve from the same .NET process on the same port:
- All 16 API controllers, ExceptionFilter, and SignalR hubs integrated
  into Heimdall.Web
- JWT auth, CORS, rate limiting configured in the unified Program.cs
- Dockerfile.central entrypoint runs web/Heimdall.Web.dll
- docker-compose simplified: heimdall-central service removed
- CI publishes heimdall-web image instead of heimdall-central

Also fixes timezone validation on Alpine/tzdata-less environments
and enables FluentValidation auto-validation in the API project.
This commit is contained in:
Arnaud Dartois committed 2026-07-20 10:30:01 +00:00
1 parent 892ca88de8
commit 562aabdfc8
30 files changed
+1969 -99

No files matched your search

@@ -0,0 +1,34 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Diagnostics.HealthChecks;
namespace Heimdall.Api.Controllers;
[ApiController]
public class HealthController : ControllerBase
{
/// <summary>
/// Liveness probe — always returns OK if the process is running.
/// </summary>
[HttpGet("/healthz")]
[ProducesResponseType(typeof(void), StatusCodes.Status200OK)]
public IActionResult Health() => Ok(new { status = "healthy", timestamp = DateTime.UtcNow });
/// <summary>
/// Readiness probe — checks if the database is reachable.
/// Uses ASP.NET Core health checks infrastructure.
/// </summary>
[HttpGet("/readyz")]
[ProducesResponseType(typeof(void), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(void), StatusCodes.Status503ServiceUnavailable)]
public async Task<IActionResult> Readiness(
[FromServices] HealthCheckService healthCheckService,
CancellationToken ct)
{
var report = await healthCheckService.CheckHealthAsync(
_ => true, ct);
return report.Status == HealthStatus.Healthy
? Ok(new { status = "healthy", timestamp = DateTime.UtcNow })
: StatusCode(503, new { status = "unhealthy", errors = report.Entries });
}
}