Files
Heimdall/Makefile
T
Arnaud Dartois 562aabdfc8 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.
2026-07-20 10:30:01 +00:00

72 lines
3.1 KiB
Makefile

# ─── Heimdall — Development & Deployment ──────────────────────────
.DEFAULT_GOAL := help
.PHONY: help build test docker-up docker-down docker-build clean dev
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
build: ## Build the .NET solution
dotnet build
test: ## Run all tests
dotnet test
test-watch: ## Run tests in watch mode
dotnet watch test --project tests/Heimdall.Domain.Tests
clean: ## Clean build artifacts
dotnet clean && rm -rf src/**/bin src/**/obj tests/**/bin tests/**/obj
# ─── Docker ──────────────────────────────────────────────────────
docker-up: ## Start all services (dev)
docker compose -f docker/docker-compose.yml -f docker/docker-compose.override.yml up -d
docker-down: ## Stop all services
docker compose -f docker/docker-compose.yml down -v
docker-build: ## Rebuild images without cache
docker compose -f docker/docker-compose.yml build --no-cache
docker-logs: ## Tail logs
docker compose -f docker/docker-compose.yml logs -f
docker-ps: ## List running services
docker compose -f docker/docker-compose.yml ps
docker-reset: ## Stop and remove everything
docker compose -f docker/docker-compose.yml down -v --rmi all
# ─── Deployment ──────────────────────────────────────────────────
deploy: docker-build docker-up ## Build and deploy
# ─── Database ────────────────────────────────────────────────────
migration-add: ## Add a new EF migration (usage: make migration-add NAME=xxx)
dotnet ef migrations add $(NAME) -p src/Heimdall.Infrastructure
migration-remove: ## Remove last migration
dotnet ef migrations remove -p src/Heimdall.Infrastructure
# ─── Dev helpers ─────────────────────────────────────────────────
dev-api: ## Run combined API+Web in development mode (API and Blazor UI in one process)
DATABASE_URL="Host=localhost;Port=5432;Database=heimdall;Username=heimdall;Password=heimdall" \
JWT__Key="ThisIsADevKeyThatIsAtLeast32BytesLong!!" \
ASPNETCORE_ENVIRONMENT=Development \
Cors__AllowedOrigins="*" \
dotnet run --project src/Heimdall.Web
dev-worker: ## Run workers in development mode
DATABASE_URL="Host=localhost;Port=5432;Database=heimdall;Username=heimdall;Password=heimdall" \
dotnet run --project src/Heimdall.Workers
dev-web: ## Run combined API+Web in development mode (no separate API needed)
DATABASE_URL="Host=localhost;Port=5432;Database=heimdall;Username=heimdall;Password=heimdall" \
JWT__Key="ThisIsADevKeyThatIsAtLeast32BytesLong!!" \
ASPNETCORE_ENVIRONMENT=Development \
Cors__AllowedOrigins="*" \
dotnet run --project src/Heimdall.Web