Files
Classeo/backend/Makefile
Mathias STRASSER 1fd256346a feat: Infrastructure multi-tenant avec isolation par sous-domaine
Une application SaaS éducative nécessite une séparation stricte des données
entre établissements scolaires. L'architecture multi-tenant par sous-domaine
(ecole-alpha.classeo.local) permet cette isolation tout en utilisant une
base de code unique.

Le choix d'une résolution basée sur les sous-domaines plutôt que sur des
headers ou tokens facilite le routage au niveau infrastructure (reverse proxy)
et offre une UX plus naturelle où chaque école accède à "son" URL dédiée.
2026-01-31 01:03:35 +01:00

30 lines
1.0 KiB
Makefile

.PHONY: help test arch lint warmup cache-clear
# Default PHP command (can be overridden)
PHP ?= docker run --rm -v "$$(pwd):/app" -w /app php:8.5-cli php
help: ## Display this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
test: ## Run PHPUnit tests
$(PHP) ./vendor/bin/phpunit --testdox
arch: ## Run architecture tests (PHPat via PHPStan)
$(PHP) ./vendor/bin/phpstan analyse tests/Architecture --configuration=phpstan.neon --level=1
lint: ## Run PHPStan static analysis
$(PHP) ./vendor/bin/phpstan analyse --configuration=phpstan.neon
warmup: ## Warmup Symfony cache (avoids timeout in web requests)
$(PHP) ./bin/console cache:warmup --env=dev
$(PHP) ./bin/console cache:warmup --env=prod
cache-clear: ## Clear Symfony cache
$(PHP) ./bin/console cache:clear --env=dev
$(PHP) ./bin/console cache:clear --env=prod
cs-fix: ## Run PHP-CS-Fixer
$(PHP) ./vendor/bin/php-cs-fixer fix
ci: lint arch test ## Run all CI checks (lint, arch, test)