====== Dossier d'industrialisation ====== ===== Objectif ===== Ce document définit les standards d'exploitation et de développement permettant : * Le développement collaboratif * Les déploiements automatisés * La qualité logicielle * L'observabilité * La scalabilité * La maintenance à long terme * L'exploitation SaaS ---- ====== Architecture des environnements ====== ===== Environnements ===== ^ Environnement ^ Objectif ^ | Local | Développement | | Dev | Intégration continue | | QA | Validation fonctionnelle | | Preprod | Recette | | Production | Exploitation | ---- ===== Architecture cible ===== Internet │ ▼ Cloudflare │ ▼ Load Balancer │ ▼ Kubernetes Cluster ├── Frontend ├── Backend API ├── Workers ├── Scheduler │ ▼ PostgreSQL │ ▼ Redis │ ▼ S3 Storage ---- ====== Sprint 0 ====== ===== Objectif ===== Préparer l'usine logicielle avant le développement métier. ---- ===== Backlog Sprint 0 ===== ==== Infrastructure ===== * Création dépôt Git * Création registry Docker * Création cluster Kubernetes * Création PostgreSQL * Création Redis * Création stockage S3 ---- ==== Qualité ===== * ESLint * Prettier * Husky * Commitlint * SonarQube ---- ==== CI/CD ===== * Build Frontend * Build Backend * Déploiement Dev * Déploiement QA ---- ==== Monitoring ===== * Prometheus * Grafana * Loki ---- ====== Plan Scrum ====== ===== Sprint 1 ===== Authentification * Login * Register * JWT * RBAC ---- ===== Sprint 2 ===== Gestion utilisateurs * Profil * Documents * Notifications ---- ===== Sprint 3 ===== Catalogue Biens * CRUD * Photos * Équipements ---- ===== Sprint 4 ===== Disponibilités * Calendrier * Blocages * Tarifs ---- ===== Sprint 5 ===== Recherche * Filtres * Carte * SEO ---- ===== Sprint 6 ===== Réservation * Création * Modification * Annulation ---- ===== Sprint 7 ===== Contrats * Génération PDF * Signature ---- ===== Sprint 8 ===== Paiements * Stripe * Facturation ---- ===== Sprint 9 ===== Portail propriétaire ---- ===== Sprint 10 ===== CRM ---- ===== Sprint 11 ===== Messagerie ---- ===== Sprint 12 ===== Notifications ---- ===== Sprint 13 ===== Reporting ---- ===== Sprint 14 ===== Administration ---- ===== Sprint 15 ===== Optimisations UX ---- ===== Sprint 16 ===== Sécurité avancée ---- ===== Sprint 17 ===== Tests de charge ---- ===== Sprint 18 ===== Recette ---- ===== Sprint 19 ===== Pré-production ---- ===== Sprint 20 ===== Mise en production ---- ====== Convention de développement ====== ===== Branches ===== main develop feature/* hotfix/* release/* ---- ===== Convention de nommage ===== ==== Features ===== feature/property-management feature/reservation-module ---- ==== Hotfix ===== hotfix/login-error ---- ====== GitFlow ====== ===== Cycle ===== feature ↓ develop ↓ release ↓ main ↓ tag ---- ====== Convention Commit ====== ===== Format ===== type(scope): description ---- ===== Exemples ===== feat(auth): add login endpoint feat(property): create property form fix(payment): stripe timeout refactor(crm): optimize queries test(reservation): add integration tests ---- ====== Pipeline CI/CD ====== ===== Pipeline Backend ===== Git Push ↓ Lint ↓ Unit Tests ↓ Build ↓ Docker Build ↓ Security Scan ↓ Deploy Dev ↓ Deploy QA ↓ Deploy Production ---- ===== Pipeline Frontend ===== Git Push ↓ Lint ↓ Type Check ↓ Unit Tests ↓ Build ↓ Deploy ---- ====== Docker ====== ===== Backend ===== FROM node:22-alpine WORKDIR /app COPY . . RUN npm install RUN npm run build CMD ["node","dist/main.js"] ---- ===== Frontend ===== FROM node:22-alpine RUN npm install RUN npm run build CMD ["npm","start"] ---- ====== Kubernetes ====== ===== Services ===== frontend backend postgres redis worker scheduler ---- ===== Autoscaling ===== minReplicas: 2 maxReplicas: 20 ---- ====== Stratégie de tests ====== ===== Pyramide ===== E2E ▲ Integration ▲ Unit Tests ---- ===== Couverture ===== ^ Type ^ Objectif ^ | Unit | 80 % | | Integration | 70 % | | E2E | Parcours critiques | ---- ===== Outils ===== Vitest Jest Playwright Supertest ---- ====== Observabilité ====== ===== Logs ===== ===== Format ===== { "timestamp": "", "level": "", "service": "", "message": "" } ---- ===== Centralisation ===== NestJS ↓ Loki ↓ Grafana ---- ====== Métriques ====== ===== Backend ===== * Temps réponse API * Nombre requêtes * Taux erreurs * Temps SQL ---- ===== Business ===== * Réservations * Contrats signés * Paiements * Revenus ---- ====== Traces ====== ===== OpenTelemetry ===== Frontend ↓ API ↓ Database ↓ Stripe ↓ SMTP ---- ====== Alerting ====== ===== Critique ===== * API indisponible * PostgreSQL indisponible * Redis indisponible * Erreurs Stripe ---- ===== Avertissement ===== * CPU > 80 % * RAM > 80 % * Temps réponse > 2s ---- ====== Sauvegardes ====== ===== PostgreSQL ===== * Quotidienne * Conservation 30 jours ---- ===== S3 ===== * Versionning activé * Réplication ---- ====== Sécurité ====== ===== Auth ===== * JWT * Refresh Token * Rotation ---- ===== Protection ===== * HTTPS * CSP * CORS * Rate Limiting * WAF ---- ===== Audit ===== Toutes les actions sont historisées : * Connexions * Paiements * Contrats * Modifications ---- ====== SaaS Multi-tenant ====== ===== Stratégie ===== Un tenant = une agence. ---- ===== Isolation ===== Option retenue : shared database + tenant_id Toutes les tables métiers : tenant_id UUID NOT NULL ---- ===== Avantages ===== * Faible coût * Maintenance simplifiée * Scalabilité horizontale ---- ====== Migration Microservices ====== ===== Monolithe modulaire ===== Version initiale : NestJS Modular Monolith ---- ===== Extraction future ===== Ordre recommandé : 1 - Notification Service 2 - CRM Service 3 - Reporting Service 4 - Payment Service 5 - Reservation Service ---- ====== Documentation d'exploitation ====== ===== Livrables ===== * Manuel administrateur * Manuel exploitation * Manuel sauvegarde * Manuel restauration * Procédure incidents * Procédure déploiement ---- ====== KPIs de production ====== ^ KPI ^ Objectif ^ | Disponibilité | 99.9 % | | Temps réponse API | < 2 sec | | Temps réponse DB | < 200 ms | | Taux erreur | < 1 % | | Couverture tests | > 80 % | ---- ====== Livrables finaux du projet ====== * Cahier des charges * Architecture fonctionnelle * Architecture technique * Schéma PostgreSQL * UML complet * Architecture Hexagonale * OpenAPI 3.1 * Backlog Agile * UX/UI * DevOps & Industrialisation ---- ====== Niveau de maturité atteint ====== Le projet dispose désormais d'un niveau de spécification comparable à celui attendu avant le lancement d'un développement professionnel : * Vision produit * Architecture logicielle * Architecture données * Architecture frontend * Architecture backend * Processus DevOps * Exploitation SaaS * Roadmap Scrum L'étape suivante, si l'objectif est de passer directement en production, consiste à générer les artefacts techniques : * Repository Git initial * Monorepo Frontend/Backend * Configuration NestJS * Configuration NextJS * Docker Compose * Helm Charts Kubernetes * OpenAPI YAML complet * DTO TypeScript * Entités PostgreSQL / Prisma / TypeORM * Pipelines GitHub Actions afin de démarrer le développement avec une base de code opérationnelle.