🏠 Architecture Applicative — Plateforme Immobilière

Architecture microservices · Web + iOS + Android · Cloud-native · RGPD by design

🗺 Schéma Global
⚙️ Microservices
🛠 Stack Technique
🔒 Sécurité & RGPD
📋 ADR — Décisions Clés
🖥 Clients (Surfaces)
🌐
Web App
Next.js 14 App Router · SSR/SSG · PWA
Next.js TypeScript Tailwind
📱
iOS App
React Native · Expo · Offline-first
React Native Expo MMKV
🤖
Android App
React Native · Expo · Notifications FCM
React Native FCM WorkManager
🔧
Admin Panel
React SPA · Backoffice modération & analytics
React Recharts Role-based
🔌
API Publique
Partenaires Premium · Accès données marché
REST API Key Rate limit
↓ ↓ ↓ ↓ ↓HTTPS / TLS 1.3
🛡 CDN & Protection
☁️
CDN + WAF (Cloudflare)
Mise en cache statique · Protection DDoS · Règles WAF · Edge Functions
Cloudflare CDN WAF Rate Limiting DDoS Protection
⚖️
Load Balancer
Distribution du trafic · Health checks · SSL Termination
AWS ALB Round-robin Health check
↓ ↓ ↓Routage
🚪 API Gateway & BFF (Backend For Frontend)
🚪
API Gateway
Auth check · Rate limit · Routing · Logging
Kong / AWS API GW
🌐
BFF Web
GraphQL · SSR data fetching · Cache response
GraphQL Node.js
📱
BFF Mobile
REST optimisé · Payload réduit · Offline sync
REST Node.js
🔑
Auth Service
OAuth2 · JWT · Social login · MFA · RBAC
Keycloak JWT Redis
↓ ↓ ↓ ↓ ↓ ↓ ↓Internal Network (VPC privé)
🏗 Microservices Métier Core
👤
User Service
Profils · Préférences · Rôles · RGPD
PostgreSQL Redis
🏠
Listing Service
Annonces · CRUD · Validation · Statuts
PostgreSQL Redis
🔍
Search Service
Full-text · Géo · Filtres · Autocomplete
Elasticsearch Redis
💬
Messaging Service
Conversations · Temps réel · WebSocket
MongoDB Redis Pub/Sub
📅
Appointment Service
Visites · Agenda · Créneaux · Rappels
PostgreSQL
🔔
Notification Service
Push · Email · SMS · In-app · Templates
PostgreSQL Redis Queue
Review Service
Avis agences · Modération · Scores
PostgreSQL
💳
Payment Service
Abonnements · Boost · Facturation · Webhooks
PostgreSQL
📁
Document Service
Dossiers candidats · Chiffrement · RGPD
PostgreSQL S3 (chiffré)
🏘
Community Service
Forum quartier · Q&A · Modération
MongoDB
↓ ↓ ↓Internal API calls + Event Bus (Kafka)
🤖 Services IA & Data
🤖
Matching & IA Service
Score compatibilité · Recommandations · Embeddings · RAG
Pinecone (Vector DB) PostgreSQL
💰
Valuation Service
Estimation IA prix · Historique marché · Comparables
PostgreSQL Redis Cache
🗺
Geo & Quartier Service
Score quartier · Isochrone · Trajets · OpenData BE
PostGIS Redis GeoIndex
🕵️
Fraud Detection
Détection annonces fictives · Arnaques · Scoring
PostgreSQL
📊
Analytics Service
Events utilisateur · Heatmaps · Rapports agence · KPIs
ClickHouse
↓ ↓ ↓Event-driven (Kafka Topics)
🎬 Services Media & 3D
📸
Media Service
Upload photos · Compression · Resize · CDN delivery · Watermark
AWS S3 MongoDB (metadata)
Sharp.js CloudFront Lambda
🥽
Virtual Tour Service
Photos → Visite 360° · Plan 2D → 3D · Home Staging IA
AWS S3 PostgreSQL
Matterport API CubiCasa Three.js
🔔
Push Gateway
FCM (Android) · APNs (iOS) · Web Push
Firebase APNs
↓ ↓ ↓Kafka Event Bus
☁️ Infrastructure & DevOps
🐳
Kubernetes (EKS)
Orchestration · Auto-scaling · Rolling deploys
📨
Kafka
Event bus · Topics par domaine · Async messaging
👁
Observabilité
Logs (Loki) · Métriques (Prometheus) · Traces (Jaeger)
🔄
CI/CD Pipeline
GitHub Actions · Docker Build · ArgoCD deploy
🔐
Secrets Manager
AWS Secrets Manager · Vault · Rotation auto
↓ ↓ ↓Intégrations tierces
🔗 APIs & Services Externes
🗺
Mapbox / Google Maps
Tuiles carte · Geocoding · Isochrones
🏛
OpenData Belgique
SPF Finances · Cadastre · PEB · Données communes
💳
Stripe
Paiements · Abonnements · Facturation EU
📧
Resend / SendGrid
Emails transactionnels · Templates · Analytics
🤖
OpenAI / Anthropic
Chatbot IA · Analyse photos · Génération descriptions
🥽
Matterport / CubiCasa
Visite 3D · Conversion plan · Staging virtuel
🔑
Auth Service
MVP 1
Rôle
Authentification, autorisation RBAC, sessions, MFA
Endpoints
POST /auth/loginPOST /auth/refreshPOST /auth/logoutGET /auth/me
DB
Keycloak + PostgreSQLRedis (sessions)
Events
user.registereduser.loginuser.suspended
Tech
Keycloak · OAuth2 · OpenID Connect · JWT RS256
👤
User Service
MVP 1
Rôle
Profils utilisateurs, préférences, favoris, RGPD (droit à l'oubli)
Endpoints
GET /users/:idPUT /users/:idGET /users/:id/favoritesDELETE /users/:id (RGPD)
DB
PostgreSQL (profils)Redis (cache)
Events
user.profile.updateduser.deletedfavorite.added
🏠
Listing Service
MVP 1
Rôle
CRUD annonces, validation, statuts, historique prix
Endpoints
POST /listingsGET /listings/:idPUT /listings/:idGET /listings/:id/price-history
DB
PostgreSQLRedis (cache annonces)
Events
listing.publishedlisting.price.changedlisting.archived
🔍
Search Service
MVP 1
Rôle
Recherche full-text, filtres avancés, géospatiale, autocomplétion
Endpoints
GET /search?q=&filters=GET /search/geo?bbox=GET /search/suggest
DB
Elasticsearch (index)Redis (facets cache)
Events
Consomme listing.publishedlisting.updated
Note
MVP 1 : Algolia (SaaS) → Elasticsearch custom en MVP 2
💬
Messaging Service
MVP 1
Rôle
Conversations entre utilisateurs et agences, temps réel via WebSocket
Endpoints
GET /conversationsPOST /messagesWS /ws/chat
DB
MongoDB (messages)Redis Pub/Sub
Events
message.sentmessage.read
📅
Appointment Service
MVP 1
Rôle
Réservation de visites, gestion agenda, créneaux, rappels
Endpoints
GET /appointmentsPOST /appointmentsPUT /appointments/:id/status
DB
PostgreSQL
Events
appointment.bookedappointment.confirmedappointment.reminder
🗺
Geo & Quartier Service
MVP 2
Rôle
Score de quartier, isochrones, trajets, données OpenData Belgique
Endpoints
GET /geo/score?lat=&lng=GET /geo/isochroneGET /geo/commute
DB
PostGIS (géo)Redis GeoIndex
Sources
SPF Finances · OpenStreetMap · STIB · De Lijn · SNCB API
🤖
Matching & IA Service
MVP 2
Rôle
Score compatibilité /100, recommandations, embeddings vectoriels
Endpoints
GET /match/score/:userId/:listingIdGET /match/recommendations/:userId
DB
Pinecone (vectors)PostgreSQL (profiles)
Tech
Python · FastAPI · Sentence Transformers · LangChain
💰
Valuation Service
MVP 2
Rôle
Estimation IA prix au m², historique marché, comparables
Endpoints
POST /valuation/estimateGET /valuation/market/:zoneGET /valuation/history/:listingId
DB
PostgreSQL (historique)Redis (cache estimations)
Tech
Python · scikit-learn · XGBoost · Données cadastrales BE
📁
Document Service
MVP 3
Rôle
Dossiers candidats, stockage chiffré, envoi multi-agences, RGPD
Endpoints
POST /documents/uploadPOST /candidaturesGET /candidatures/:id/statusDELETE /documents/:id
DB
PostgreSQL (metadata)S3 AES-256 (fichiers)
Sécurité
Chiffrement AES-256 · Accès signé · Expiration auto · Audit log
🥽
Virtual Tour Service
MVP 3
Rôle
Génération visite 360°, plan 3D, home staging virtuel
Endpoints
POST /tours/generateGET /tours/:listingIdPOST /tours/staging
DB
S3 (assets 3D)PostgreSQL (metadata)
Tech
Matterport API · CubiCasa · Three.js · IA Staging
💳
Payment Service
MVP 4
Rôle
Abonnements agences, boost annonces, facturation, commissions
Endpoints
POST /subscriptionsPOST /boostsGET /invoicesPOST /webhooks/stripe
DB
PostgreSQL
Tech
Stripe · TVA belge · Facturation SEPA

🌐 Frontend Web

CoucheChoixJustification
FrameworkNext.js 14SSR/SSG natif → SEO critique pour l'immobilier · App Router · Edge-ready
LangageTypeScriptTypage fort partagé avec le backend (monorepo) · Moins de bugs runtime
UITailwind + Shadcn/uiDesign system rapide · Composants accessibles · Dark mode natif
StateZustand + React QueryState local léger (Zustand) + cache serveur automatique (React Query)
CarteMapbox GL JSPerformances supérieures à Google Maps · Clustering · Isochrones API
3D / VisiteThree.js + iframe MatterportFlexibilité 3D custom + intégration visite pro Matterport
PWAnext-pwaOffline partiel · Installation mobile · Cache stratégique

📱 Applications Mobiles

CoucheChoixJustification
FrameworkReact Native + ExpoCode partagé iOS/Android · Partage logique avec Web (monorepo) · OTA updates
NavigationExpo RouterFile-based routing · Deep linking natif · Cohérence avec Next.js
Cartereact-native-maps + MapboxPerformances natives · Clustering · Tuiles offline
Cache offlineMMKV + WatermelonDBMMKV = ultra-rapide pour préférences · WatermelonDB pour données structurées offline
NotificationsExpo NotificationsUnifie FCM (Android) + APNs (iOS) en une seule API
CameraExpo CameraScan documents pour dossier candidat · Accès galerie photos
Temps réelSocket.io clientMessages + notifications in-app · Reconnexion automatique

⚙️ Backend / Microservices

ServiceTechJustification
Services CRUD (User, Listing, Appointment…)Node.js + FastifyPerformances I/O élevées · TypeScript natif · Écosystème riche
Services IA (Matching, Valuation, Fraud)Python + FastAPIÉcosystème ML/IA imbattable · scikit-learn, LangChain, Transformers
Search ServiceNode.js + ElasticsearchIntégration ES client optimisée · Même langage que les autres services
Messaging (WebSocket)Node.js + Socket.ioWebSocket natif performant · Rooms par conversation
Media ProcessingNode.js + Sharp + LambdaSharp = compression ultra-rapide · Lambda pour scaling image processing
AuthKeycloak (Java)Solution OAuth2/OIDC enterprise · RGPD · MFA · Social login clés en main

🗄 Bases de Données

DBUsageJustification
PostgreSQL + PostGISUser, Listing, Appointments, PaymentsACID · Relations complexes · PostGIS pour requêtes géospatiales
MongoDBMessages, Forum, Logs événementsSchéma flexible · Documents imbriqués · Idéal pour messages/threads
RedisSessions, Cache, Pub/Sub, QueuesUltra-rapide · Sessions JWT · Cache annonces · Pub/Sub messaging temps réel
ElasticsearchIndex de recherche annoncesFull-text multilingue (FR/NL) · Géospatial · Facettes · Agrégations
PineconeEmbeddings matching IAVector DB managé · Similarité sémantique · Recommandations
ClickHouseAnalytics, Heatmaps, RapportsOLAP colonnaire · Billions d'events · Requêtes analytiques < 1s
AWS S3Photos, Documents, Assets 3DStockage objet infini · Signed URLs · Chiffrement SSE-S3

☁️ Infrastructure Cloud (AWS)

ComposantService AWSJustification
OrchestrationEKS (Kubernetes)Auto-scaling · Rolling deploys · Isolation services · Standard industrie
Event BusAmazon MSK (Kafka managé)Event-driven · Topics par domaine · Replay d'événements · Pas d'ops Kafka
CDNCloudFront + CloudflareCloudFront pour assets S3 · Cloudflare pour WAF + DDoS protection
Load BalancerALB (Application Load Balancer)SSL termination · Path-based routing vers microservices · Health checks
CI/CDGitHub Actions + ArgoCDGitOps · Déploiements automatisés · Rollback instantané
ObservabilitéPrometheus + Grafana + JaegerMétriques (Prometheus) · Dashboards (Grafana) · Traces distribuées (Jaeger)
LogsLoki + GrafanaAgrégation logs tous services · Corrélation avec métriques
SecretsAWS Secrets ManagerRotation automatique · Audit · Injection dans Kubernetes via External Secrets

📦 Monorepo — Partage de code

PackageContenuPartagé entre
@immo/typesTypes TypeScript (Listing, User, Search…)Web + Mobile + Backend Node.js
@immo/uiComposants UI (React Native Web)Web (Next.js) + Mobile (React Native)
@immo/api-clientSDK client API auto-généréWeb + Mobile
@immo/utilsFormatage, validation, i18n (FR/NL)Web + Mobile + Backend

🔑 Authentification & Autorisation

  • OAuth2 + OpenID Connect via Keycloak
  • JWT RS256 (asymétrique) — access token 15min, refresh 30j
  • MFA obligatoire pour les agences et admins
  • Social login : Google, Apple, Microsoft
  • RBAC : rôles Public / Particulier / Agence / Admin / SuperAdmin
  • Permissions granulaires par ressource (ses propres annonces uniquement)

📁 Sécurisation Documents Sensibles

  • Chiffrement AES-256 côté serveur (AWS SSE-S3)
  • URLs signées temporaires (15 min) — jamais d'URL permanente
  • Accès log complet : qui a consulté quel document, quand
  • Suppression automatique après 6 mois d'inactivité (RGPD)
  • Aucun document indexé dans les moteurs de recherche
  • Scan antivirus automatique à l'upload (ClamAV)

🛡 Conformité RGPD

  • Droit à l'oubli : suppression en cascade tous services via event user.deleted
  • Consentement explicite granulaire (analytics, marketing, partage)
  • Portabilité des données : export JSON/CSV à la demande
  • Rétention configurée par type de donnée (messages : 3 ans, docs : 6 mois)
  • DPO désigné avant MVP 3 (dossiers candidats)
  • Registre des traitements documenté (Article 30 RGPD)
  • Hébergement données dans l'UE (région AWS eu-west-1 Dublin)

🕵️ Détection Fraudes & Abus

  • Scoring IA des nouvelles annonces (images volées, prix aberrant, doublons)
  • Détection de comptes multiples par IP / device fingerprint
  • Vérification email + téléphone obligatoire pour publier
  • File d'attente modération pour annonces à risque élevé
  • Signalement communautaire avec workflow de traitement
  • Blacklist automatique des patterns d'arnaque connus

🌐 Protection Réseau

  • WAF Cloudflare : règles OWASP Top 10 activées
  • DDoS Protection L3/L4/L7 (Cloudflare Pro)
  • Rate limiting par IP, par user, par endpoint
  • TLS 1.3 minimum — TLS 1.0/1.1 désactivés
  • HSTS, CSP, X-Frame-Options headers
  • Network policies Kubernetes (zéro trust inter-services)

🔍 Audit & Monitoring Sécurité

  • Audit log immuable de toutes les actions sensibles
  • Alertes temps réel sur anomalies (pics de requêtes, erreurs 401/403)
  • Scan de vulnérabilités hebdomadaire (Trivy sur images Docker)
  • Pentest externe annuel recommandé
  • Rotation automatique des secrets (AWS Secrets Manager)
  • Backup chiffré quotidien · RTO 4h · RPO 1h

📋 ADR-001 · Microservices vs Modular Monolith

Contexte
Startup early-stage avec équipe réduite. Les microservices sont la cible long terme mais imposent une complexité opérationnelle élevée dès le départ.
Options
A) Microservices dès MVP 1 · B) Monolithe modulaire → migration progressive · C) Serverless Functions
Décision
→ Modular Monolith au MVP 1, extraction progressive en microservices à partir du MVP 2 pour les services IA et Media qui ont des besoins de scaling indépendants.
Conséquences
Démarrage plus rapide · Moins d'ops · Migration planifiée · Contrats d'API internes dès le départ pour faciliter l'extraction future.

📋 ADR-002 · React Native vs Flutter pour le Mobile

Contexte
La plateforme nécessite carte interactive, visite 3D, camera pour documents, notifications push. L'équipe maîtrise déjà React/TypeScript.
Options
A) React Native + Expo · B) Flutter · C) Applications natives Swift + Kotlin · D) Capacitor (Web-based)
Décision
→ React Native + Expo. Partage de code avec Next.js via monorepo (@immo/ui, @immo/types). OTA updates. Expo gère FCM + APNs unifiés. Compromis performances/vitesse acceptable.
Conséquences
Économie d'une équipe mobile dédiée · Partage 40-60% du code · Performances légèrement inférieures au natif pour la 3D (bridged) → Three.js via WebView pour les tours.

📋 ADR-003 · GraphQL vs REST pour les BFF

Contexte
Le Web a des besoins de données riches et flexibles (fiche bien = 15+ champs). Le mobile doit minimiser le payload pour économiser la batterie et les données.
Options
A) GraphQL unifié pour Web + Mobile · B) REST unifié · C) GraphQL pour Web + REST pour Mobile · D) tRPC
Décision
→ Pattern BFF : GraphQL pour le BFF Web (flexibilité, co-location queries) + REST optimisé pour le BFF Mobile (payloads contrôlés, cache HTTP natif, offline plus simple).
Conséquences
Deux BFF à maintenir · Mais chaque surface obtient exactement ce dont elle a besoin · Le SDK client (@immo/api-client) abstraite la différence.

📋 ADR-004 · Stratégie Search : Algolia vs Elasticsearch

Contexte
La recherche est le cœur du produit. Elle doit supporter : full-text FR+NL, géospatial, facettes, autocomplétion < 100ms. Budget serré au démarrage.
Options
A) Algolia (SaaS, coûteux) · B) Elasticsearch self-hosted · C) Typesense (open source) · D) PostgreSQL full-text (limité)
Décision
→ Algolia au MVP 1 (opérationnel en 1 jour, SLA garanti, < 500€/mois au démarrage) → Migration vers Elasticsearch managé (AWS OpenSearch) dès MVP 2 quand le volume justifie l'investissement.
Conséquences
Dette technique acceptée et planifiée · Interface Search Service abstraite = migration transparente pour le reste du système · Économie de 2-3 semaines de dev au MVP 1.

📋 ADR-005 · Hébergement : AWS vs GCP vs Azure

Contexte
Plateforme belge, données EU obligatoires (RGPD), besoin de services managés ML/IA, Kubernetes, stockage objet, CDN.
Options
A) AWS (eu-west-1 Dublin) · B) GCP (europe-west1 Belgium!) · C) Azure · D) Multi-cloud
Décision
→ AWS eu-west-1 (Dublin) comme cloud principal. Région européenne conforme RGPD. Écosystème le plus mature (EKS, MSK, S3, CloudFront, SageMaker). Crédits AWS Activate disponibles pour startups (~$100k).
Conséquences
Données 100% EU · Accès aux crédits startup · Stack AWS cohérente (EKS + MSK + S3 + CloudFront) · Coût estimé MVP 1 : ~800-1500€/mois · MVP 2-3 : ~3000-6000€/mois.
Clients
Gateway / BFF
Services Core
IA & Data
Media & 3D
Infrastructure
APIs Externes
Auth