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.
This commit is contained in:
26
README.md
26
README.md
@@ -9,6 +9,14 @@ Application de gestion scolaire moderne - Backend Symfony 8 + Frontend SvelteKit
|
||||
- Docker Desktop 24+ avec Docker Compose 2.20+
|
||||
- Git
|
||||
|
||||
### Configuration /etc/hosts (multi-tenant)
|
||||
|
||||
Classeo utilise une architecture multi-tenant basée sur les sous-domaines. Ajoutez cette ligne à `/etc/hosts` :
|
||||
|
||||
```bash
|
||||
sudo sh -c 'echo "127.0.0.1 classeo.local ecole-alpha.classeo.local ecole-beta.classeo.local" >> /etc/hosts'
|
||||
```
|
||||
|
||||
### Lancement
|
||||
|
||||
```bash
|
||||
@@ -21,15 +29,27 @@ docker compose up -d
|
||||
|
||||
# Verifier le statut
|
||||
docker compose ps
|
||||
|
||||
# Verifier que les tenants répondent
|
||||
make check-tenants
|
||||
```
|
||||
|
||||
### URLs
|
||||
|
||||
#### Multi-tenant (recommandé)
|
||||
|
||||
| Service | URL | Description |
|
||||
|---------|-----|-------------|
|
||||
| Frontend Alpha | http://ecole-alpha.classeo.local:5174 | Tenant ecole-alpha |
|
||||
| Frontend Beta | http://ecole-beta.classeo.local:5174 | Tenant ecole-beta |
|
||||
| API Alpha | http://ecole-alpha.classeo.local:18000/api | API tenant ecole-alpha |
|
||||
| API Beta | http://ecole-beta.classeo.local:18000/api | API tenant ecole-beta |
|
||||
| API Docs | http://ecole-alpha.classeo.local:18000/api/docs | Documentation OpenAPI |
|
||||
|
||||
#### Services partagés
|
||||
|
||||
| Service | URL | Description |
|
||||
|---------|-----|-------------|
|
||||
| Frontend | http://localhost:5174 | Application SvelteKit |
|
||||
| Backend API | http://localhost:18000/api | API REST (API Platform) |
|
||||
| API Docs | http://localhost:18000/api/docs | Documentation OpenAPI |
|
||||
| RabbitMQ | http://localhost:15672 | Admin (guest/guest) |
|
||||
| Meilisearch | http://localhost:7700 | Dashboard recherche |
|
||||
| Mailpit | http://localhost:8025 | Emails de test |
|
||||
|
||||
Reference in New Issue
Block a user