Stack Technique Détaillé
La solution de cashback nouvelle génération
INTRODUCTION
1.1 Objectif du Document
Ce document présente en détail l'ensemble des technologies, frameworks, outils et services utilisés pour développer et exploiter la plateforme REWAPP. Il constitue la référence technique pour l'équipe de développement et les parties prenantes techniques du projet.
1.2 Principes de Sélection
Les choix technologiques de REWAPP ont été guidés par les principes suivants :
- Performance : Temps de réponse API < 200ms, fluidité des applications
- Scalabilité : Architecture capable de supporter 300 000 utilisateurs à 3 ans
- Sécurité : Protection des données bancaires et personnelles (PCI DSS, RGPD)
- Maintenabilité : Technologies matures avec écosystème riche
- Coût : Optimisation des coûts d'infrastructure et de développement
1.3 Vue d'Ensemble de l'Écosystème
Technologies Principales par Composante
| Composante | Technologie Principale | Version |
|---|---|---|
| Application Mobile | Angular + Ionic |
17.x / 7.x |
| Site Vitrine | Angular + Tailwind CSS |
17.x |
| Dashboard Admin | React + Material-UI |
18.x / 5.x |
| Dashboard Partenaire | React (PWA) + Vite |
18.x |
| Backend API | Node.js + NestJS |
20 LTS / 10.x |
| Base de données | PostgreSQL |
15+ |
| Cache | Redis |
7+ |
| Message Queue | RabbitMQ |
3.12+ |
| Infrastructure | CapRover + Docker |
- |
STACK FRONTEND
2.1 Application Mobile
2.1.1 Technologies Principales
Stack Mobile Angular + Ionic
| Technologie | Version | Justification |
|---|---|---|
Angular |
17.x | Framework enterprise-grade, architecture modulaire, écosystème complet |
Ionic Framework |
7.x | Composants UI natifs, cross-platform iOS/Android, performance optimisée |
Capacitor |
5.x | Build natif iOS/Android, accès APIs natives, plugins officiels |
TypeScript |
5.x | Typage statique, meilleure maintenabilité, détection erreurs |
NgRx / Services Angular |
17.x | Gestion d'état réactive, services injectables |
Ionic Router |
7.x | Navigation native performante, deep linking, animations |
2.1.2 Bibliothèques et Plugins Clés
HttpClient Angular: Client HTTP natif avec intercepteurs pour authentificationRxJS(7.x) : Programmation réactive, gestion des flux de données@capacitor/camera: Scan QR code et capture photo native@capacitor/push-notifications: Notifications FCM/APNsIonic Storage: Persistance locale des données (SQLite/IndexedDB)@capacitor/secure-storage: Stockage sécurisé des tokens (Keychain/Keystore)@capacitor/geolocation: Géolocalisation native
2.1.3 Outils de Développement
- Angular CLI : Outil de développement et build Angular
- Ionic CLI : Gestion des projets Ionic et builds
- Angular DevTools : Debugging et inspection des composants
- Capacitor : Build natif iOS (Xcode) et Android (Android Studio)
2.1.4 Compatibilité
| Plateforme | Version Minimum | Version Cible |
|---|---|---|
| iOS | 14.0 | 17.x |
| Android | 10 (API 29) | 14 (API 34) |
2.2 Site Vitrine
2.2.1 Technologies Principales
Stack Angular
| Technologie | Version | Justification |
|---|---|---|
Angular |
17.x | SSG/SSR, performance SEO, optimisation images |
React |
18.x | Bibliothèque UI standard, Server Components |
TypeScript |
5.x | Typage statique, maintenabilité |
Tailwind CSS |
3.4+ | Styling utility-first, responsive rapide |
2.2.2 Bibliothèques Clés
next/image: Optimisation automatique des images (WebP, lazy loading)next-seo: Gestion des meta tags et SEOFramer Motion: Animations et micro-interactionsReact Hook Form: Gestion des formulairesZod: Validation des données
2.2.3 Optimisations SEO
CORE WEB VITALS OPTIMISÉS
LCP < 2.5s | FID < 100ms | CLS < 0.1
- Static Site Generation (SSG) pour toutes les pages
- Sitemap XML automatique
- Structured Data (JSON-LD)
2.3 Dashboard Admin
2.3.1 Technologies Principales
Stack React Admin
| Technologie | Version | Justification |
|---|---|---|
React |
18.x | Composants réutilisables, écosystème riche |
TypeScript |
5.x | Typage statique, refactoring sécurisé |
Material-UI (MUI) |
5.x | Composants professionnels, thème personnalisable |
Vite |
5.x | Build rapide, HMR instantané |
2.3.2 Bibliothèques Clés
Angular HttpClient: Cache et synchronisation données serveurAngular Router: Navigation SPAChart.js + react-chartjs-2: Visualisations de donnéesAG Grid: Tableaux de données avancésSocket.io-client: WebSocket pour temps réeldate-fns: Manipulation des dates
2.3.3 Fonctionnalités Spécifiques
- Authentification 2FA obligatoire
- Gestion des rôles (Super Admin, Admin, Support)
- Export des données (CSV, Excel, PDF)
- Tableaux de bord personnalisables
2.4 Dashboard Partenaire
2.4.1 Technologies Principales
| Technologie | Version | Justification |
|---|---|---|
React |
18.x | Cohérence avec l'écosystème |
TypeScript |
5.x | Typage statique |
Vite |
5.x | Build optimisé, PWA support |
Material-UI |
5.x | Composants professionnels |
2.4.2 Fonctionnalités PWA
PROGRESSIVE WEB APP
Application installable avec support offline et notifications push
- Service Worker pour mode offline
- Installation sur écran d'accueil
- Notifications push via Web Push API
- Cache des données critiques
- Responsive design mobile/desktop
2.4.3 Bibliothèques Clés
Workbox: Service Worker et cachinghtml5-qrcode: Scan QR code via caméra webAngular Services: Synchronisation donnéesChart.js: Statistiques et graphiques
STACK BACKEND
3.1 API et Framework
3.1.1 Technologies Principales
Stack Backend Node.js
| Technologie | Version | Justification |
|---|---|---|
Node.js |
20 LTS | Runtime JavaScript performant, écosystème npm |
NestJS |
10.x | Framework modulaire, architecture scalable, TypeScript natif |
TypeScript |
5.x | Typage statique, maintenabilité |
Prisma |
5.x | ORM moderne, type-safe, migrations |
3.1.2 Justification de NestJS
- Architecture modulaire inspirée d'Angular
- Injection de dépendances native
- Support natif TypeScript
- Intégration OpenAPI/Swagger automatique
- Middleware, Guards, Interceptors, Pipes
- Support microservices et WebSockets
3.1.3 Bibliothèques Backend
| Package | Utilisation |
|---|---|
@nestjs/passport | Authentification (JWT, OAuth2) |
@nestjs/swagger | Documentation API automatique |
@nestjs/bull | Gestion des queues de tâches |
@nestjs/websockets | WebSocket pour temps réel |
class-validator | Validation des DTOs |
class-transformer | Transformation des données |
bcrypt | Hashage des mots de passe |
jsonwebtoken | Génération et validation JWT |
helmet | Headers de sécurité HTTP |
compression | Compression gzip des réponses |
3.1.4 API Gateway
Kong API Gateway
| Technologie | Version | Utilisation |
|---|---|---|
Kong |
3.4+ | Gateway principal, rate limiting, auth |
Traefik (CapRover) |
- | Reverse proxy intégré |
RATE LIMITING
100 req/min par utilisateur | 1000 req/min par IP | Circuit Breaker actif
3.2 Bases de Données
3.2.1 PostgreSQL (Base Principale)
Configuration PostgreSQL
| Paramètre | Valeur | Justification |
|---|---|---|
| Version | 15+ | Performances améliorées, JSON, partitioning |
| Extensions | uuid-ossp, PostGIS |
UUID natifs, données géographiques |
| Réplication | Master-Slave | Haute disponibilité, read replicas |
| Connection Pool | PgBouncer |
Optimisation des connexions |
Utilisation :
- Données utilisateurs et authentification
- Transactions et historique
- Points de fidélité et mouvements
- Partenaires et campagnes
- QR codes et validations
3.2.2 MongoDB (Données Non Structurées)
| Paramètre | Valeur | Justification |
|---|---|---|
| Version | 7.x | Performances, transactions ACID |
| Réplication | Replica Set | Haute disponibilité |
Utilisation :
- Logs d'audit et événements système
- Analytics et métriques temps réel
- Documents et médias partenaires
- Préférences utilisateurs flexibles
3.3 Cache et Sessions
3.3.1 Redis
Configuration Redis
| Paramètre | Valeur | Justification |
|---|---|---|
| Version | 7+ | Performances, cluster mode |
| Mode | Cluster | Haute disponibilité, scalabilité |
| Persistance | AOF + RDB | Durabilité des données |
Utilisation :
- Sessions utilisateurs (TTL 24h)
- Cache API responses (TTL variable)
- QR codes temporaires (TTL 60s)
- Rate limiting counters
- Pub/Sub pour WebSocket
- Queues Bull pour jobs asynchrones
3.4 Message Queue
3.4.1 RabbitMQ
Configuration RabbitMQ
| Paramètre | Valeur | Justification |
|---|---|---|
| Version | 3.12+ | Stabilité, performances |
| Protocole | AMQP 0.9.1 | Standard industriel |
| Clustering | Oui | Haute disponibilité |
Utilisation :
- Communication asynchrone entre microservices
- Traitement des transactions en arrière-plan
- Envoi d'emails et notifications push
- Calcul des points et paliers
Événements Principaux
user.registered → Nouvel utilisateur inscrit
transaction.detected → Transaction détectée
points.credited → Points crédités sur un compte
qr_code.scanned → QR code scanné et validé
campaign.created → Nouvelle campagne partenaire
INFRASTRUCTURE CLOUD
4.1 Services Infrastructure CapRover
4.1.1 Compute
Services de Calcul
| Service | Utilisation | Configuration |
|---|---|---|
Docker CapRover |
Container orchestration | Auto-scaling 2-10 tasks |
EC2 |
Serveurs applicatifs (fallback) | t3.medium (prod) |
Lambda |
Fonctions serverless | Tâches ponctuelles |
4.1.2 Stockage
Services de Stockage
| Service | Utilisation | Configuration |
|---|---|---|
PostgreSQL Container |
Base de données principale | db.t3.medium, Multi-AZ |
Redis Container |
Cache et sessions | cache.t3.micro, Cluster |
MinIO / Volume local |
Stockage objets (images, docs) | Versioning, Lifecycle policies |
Backup distant |
Archivage long terme | Logs, backups anciens |
4.1.3 Réseau et Distribution
| Service | Utilisation | Configuration |
|---|---|---|
Nginx/Traefik |
Reverse proxy + cache | HTTPS, compression |
ALB |
Load Balancer | Health checks, SSL termination |
Route 53 |
DNS | Failover routing |
VPC |
Réseau privé | Multi-AZ, subnets isolés |
4.1.4 Sécurité et Monitoring
Services de Sécurité
| Service | Utilisation | Configuration |
|---|---|---|
WAF |
Firewall applicatif | Protection OWASP |
Shield |
Protection DDoS | Standard (inclus) |
Secrets Manager |
Gestion des secrets | Rotation 90 jours |
Prometheus/Grafana |
Logs et métriques | Alertes automatiques |
GuardDuty |
Détection menaces | Analyse continue |
4.2 Réseau et Sécurité
4.2.1 Architecture VPC
VPC CIDR : 10.0.0.0/16
Subnets publics : 10.0.1.0/24, 10.0.2.0/24 (Multi-AZ)
Subnets privés : 10.0.10.0/24, 10.0.11.0/24 (Multi-AZ)
Subnets database : 10.0.20.0/24, 10.0.21.0/24 (Multi-AZ)
NAT Gateway : Accès internet sortant
Docker Network : Réseau interne containers
4.2.2 Security Groups
Règles de Sécurité Réseau
| Groupe | Ports | Source |
|---|---|---|
| ALB | 443 | 0.0.0.0/0 |
| App Servers | 3000 | ALB uniquement |
| Database | 5432 | App Servers uniquement |
| Redis | 6379 | App Servers uniquement |
| RabbitMQ | 5672 | App Servers uniquement |
INTÉGRATIONS TIERCES
5.1 Solution Bancaire
5.1.1 Card Linking (OpenBanking)
Fournisseurs OpenBanking
| Fournisseur | Statut | Fonctionnalités |
|---|---|---|
Budget Insight |
Recommandé | Liaison carte, détection transactions, agrégation |
Plaid |
Alternative | Large couverture bancaire |
Tink |
Alternative | API moderne, couverture européenne |
CONFORMITÉ
PSD2 / DSP2 | OAuth 2.0 | Webhooks temps réel | Tokenisation PCI DSS
5.1.2 Virements SEPA
| Fournisseur | Statut | Fonctionnalités |
|---|---|---|
Treezor |
Recommandé | BaaS complet, virements SEPA |
Swan |
Alternative | API moderne, compte bancaire |
Mangopay |
Alternative | Paiements marketplace |
5.2 Notifications
5.2.1 Push Notifications
| Service | Plateforme | Utilisation |
|---|---|---|
Firebase Cloud Messaging (FCM) |
Android/iOS | Notifications push |
Apple Push Notification Service (APNs) |
iOS | Fallback iOS |
- Topics pour segmentation (merchants, users, premium)
- Analytics de delivery et engagement
- Notifications riches (images, actions)
- Fallback vers notification in-app
5.3 Emails et SMS
5.3.1 Emails Transactionnels
| Service | Utilisation |
|---|---|
SendGrid |
Emails transactionnels principaux |
Brevo (ex-Sendinblue) |
Alternative/Backup |
Types d'emails :
- Confirmation d'inscription
- Réinitialisation de mot de passe
- Notification de transaction
- Points sur le point d'expirer
- Newsletter et promotions
5.3.2 SMS
| Service | Utilisation | Volume |
|---|---|---|
Twilio |
SMS transactionnels | 2FA, alertes critiques |
USAGE LIMITÉ AUX
• Authentification 2FA
• Alertes de sécurité (connexion suspecte)
• Confirmation de virement important
5.4 Analytics
5.4.1 Analytics Utilisateur
| Service | Utilisation | Plateforme |
|---|---|---|
Google Analytics 4 |
Tracking web et mobile | Toutes |
Mixpanel |
Funnels et cohortes | Mobile + Dashboards |
Hotjar |
Heatmaps et recordings | Site Vitrine |
5.4.2 Monitoring Technique
| Service | Utilisation | Plateforme |
|---|---|---|
Sentry |
Error tracking | Toutes |
Datadog APM |
Tracing distribué | Backend |
Prometheus + Grafana |
Métriques système | Infrastructure |
OUTILS DE DÉVELOPPEMENT
6.1 Versioning et CI/CD
6.1.1 Gestion du Code Source
| Outil | Version | Utilisation |
|---|---|---|
Git |
2.x | Versioning |
GitHub |
- | Hébergement repositories |
GitHub Actions |
- | CI/CD pipelines |
6.1.2 Pipeline CI/CD
Étapes du Pipeline
| Étape | Outils | Déclencheur |
|---|---|---|
| Lint & Format | ESLint, Prettier |
Chaque commit |
| Tests Unitaires | Jest |
Chaque commit |
| Tests Intégration | Jest + Supertest |
Chaque PR |
| Build | TypeScript, Webpack, Vite |
Chaque PR |
| Security Scan | npm audit, Snyk |
Chaque PR |
| Docker Build | Docker, ECR |
Merge main |
| Deploy Staging | Docker, CapRover |
Merge main |
| Tests E2E | Cypress |
Staging |
| Deploy Production | Docker, CapRover |
Tag release |
6.1.3 Infrastructure as Code
| Outil | Version | Utilisation |
|---|---|---|
Terraform |
1.6+ | Provisioning infrastructure CapRover |
Docker Compose |
3.x | Alternative IaC |
Docker |
24.x | Containerisation |
Docker Compose |
2.x | Développement local |
6.2 Monitoring et Observabilité
6.2.1 Stack de Monitoring
Outils de Monitoring
| Composant | Outil | Utilisation |
|---|---|---|
| Métriques | Prometheus + Grafana |
Dashboards, alertes |
| Logs | ELK Stack |
Centralisation, recherche |
| Tracing | Datadog APM |
Tracing distribué |
| Errors | Sentry |
Error tracking, alerting |
6.2.2 Alertes
Seuils d'Alertes
| Métrique | Seuil | Action |
|---|---|---|
| API Latency | > 500ms | Warning Slack |
| Error Rate | > 1% | PagerDuty Critical |
| CPU Usage | > 80% | Auto-scaling trigger |
| Database Connections | > 80% | Investigation immédiate |
| Disk Usage | > 85% | Alerte équipe ops |
6.3 Tests et Qualité
6.3.1 Outils de Test
| Type | Outil | Couverture |
|---|---|---|
| Unit Tests | Jest |
80% minimum |
| Integration Tests | Jest + Supertest |
60% endpoints |
| E2E Tests | Cypress |
Scénarios critiques |
| Performance Tests | k6, Artillery |
Endpoints critiques |
| Security Tests | OWASP ZAP |
Vulnérabilités |
6.3.2 Qualité du Code
| Outil | Version | Utilisation |
|---|---|---|
ESLint |
8.x | Linting JavaScript/TypeScript |
Prettier |
3.x | Formatage automatique |
Husky |
8.x | Git hooks pre-commit |
SonarQube |
- | Analyse qualité et sécurité |
JUSTIFICATION DES CHOIX TECHNOLOGIQUES
7.1 Angular/Ionic vs React Native
Comparaison Framework Mobile
| Critère | Angular + Ionic | React Native |
|---|---|---|
| Language | TypeScript |
JavaScript/TypeScript |
| Architecture | Modulaire, structurée (DI native) | Flexible, composants |
| Build natif | Capacitor (iOS/Android) | Metro + natif |
| Composants UI | Ionic (complets, thémables) | RN Elements / Paper |
| Performance | Excellente (WebView optimisé) | Excellente (natif) |
| DÉCISION | CHOISI | - |
JUSTIFICATION
Angular + Ionic offre une architecture enterprise-grade avec injection de dépendances native, une bibliothèque de composants UI complète et thémable, et Capacitor pour un accès aux APIs natives. L'architecture modulaire d'Angular facilite la maintenance à long terme du projet.
7.2 NestJS vs Express
Comparaison Framework Backend
| Critère | NestJS | Express |
|---|---|---|
| Architecture | Modulaire, structurée | Flexible, minimal |
| TypeScript | Natif | À configurer |
| DI (Injection) | Native | Manuelle |
| Documentation API | Swagger intégré | À ajouter |
| Courbe apprentissage | Moyenne | Faible |
| DÉCISION | CHOISI | - |
JUSTIFICATION
NestJS offre une architecture structurée et modulaire idéale pour une application d'entreprise. L'injection de dépendances native et l'intégration Swagger facilitent le développement et la maintenance.
7.3 PostgreSQL vs MySQL
Comparaison Base de Données
| Critère | PostgreSQL | MySQL |
|---|---|---|
| Conformité SQL | Excellente | Bonne |
| Types JSON | Natif, performant | Basique |
| Extensions | Très riche | Limitées |
| Transactions | ACID complet | ACID |
| Géospatial | PostGIS excellent | Basique |
| DÉCISION | CHOISI | - |
JUSTIFICATION
PostgreSQL offre une meilleure conformité SQL, des types JSON natifs performants et l'extension PostGIS pour les données géographiques (localisation partenaires).
7.4 CapRover vs Cloud Providers
Comparaison Cloud Providers
| Critère | CapRover | GCP | Azure |
|---|---|---|---|
| Maturité | Très mature | Mature | Mature |
| Services | Très complet | Complet | Complet |
| Présence France | Région Paris | Région Paris | Région Paris |
| Prix | Compétitif | Compétitif | Variable |
| Écosystème | Très riche | Riche | Riche |
| DÉCISION | CHOISI | - | - |
JUSTIFICATION
CapRover offre une solution auto-hébergée économique (~500€/mois) avec Docker containers. L'hébergement en France garantit la conformité RGPD et une latence optimale.
CONFIGURATION PAR ENVIRONNEMENT
8.1 Environnements
| Environnement | URL | Description |
|---|---|---|
| Développement | localhost:3000 |
Développement local |
| Staging | staging.rewapp.fr |
Tests et validation |
| Production | api.rewapp.fr |
Environnement live |
8.2 Configuration Infrastructure
Ressources par Environnement
| Ressource | DEV | STAGING | PRODUCTION |
|---|---|---|---|
| Docker Container | 1 container | t3.small x2 | t3.medium x4 |
| PostgreSQL Container | db.t3.micro | db.t3.small | db.t3.medium Multi-AZ |
| Redis Container | 1 container | cache.t3.micro | cache.t3.small Cluster |
| MinIO/Volume | Volume unique | Bucket dédié | Bucket + réplication |
8.3 Configuration Applicative
Paramètres par Environnement
| Paramètre | DEV | STAGING | PRODUCTION |
|---|---|---|---|
LOG_LEVEL |
debug | info | warn |
JWT_EXPIRY |
1h | 15min | 15min |
RATE_LIMIT |
Désactivé | 1000 req/min | 100 req/min |
CACHE_TTL |
60s | 300s | 600s |
SSL |
Non | Oui | Oui |
8.4 Gestion des Secrets
GESTION DES SECRETS
Tous les secrets sont gérés via les variables d'environnement CapRover avec accès sécurisé.
DATABASE_URL → URL de connexion PostgreSQL
REDIS_URL → URL de connexion Redis
JWT_SECRET → Clé de signature JWT (RS256)
BANKING_API_KEY → Clé API solution bancaire
SENDGRID_API_KEY → Clé API SendGrid
TWILIO_AUTH_TOKEN → Token Twilio
FCM_SERVER_KEY → Clé serveur Firebase
CONCLUSION
9.1 Récapitulatif du Stack
Stack Technique Complet
| Couche | Technologies |
|---|---|
| Frontend Mobile | Angular, Ionic, Capacitor, TypeScript |
| Frontend Web | Angular, Ionic, Tailwind CSS, Angular Material |
| Backend | Node.js, NestJS, TypeScript, Prisma |
| Bases de données | PostgreSQL, MongoDB, Redis |
| Message Queue | RabbitMQ |
| Infrastructure | CapRover (Docker, PostgreSQL, Redis, MinIO, Traefik) |
| CI/CD | GitHub Actions, Docker, Terraform |
| Monitoring | Prometheus, Grafana, ELK, Sentry, Datadog |
9.2 Points Clés
Le stack technique de REWAPP a été conçu pour répondre aux exigences suivantes :
-
Scalabilité
Architecture microservices avec auto-scaling horizontal permettant de supporter 30 000 à 300 000 utilisateurs
-
Performance
Temps de réponse API < 200ms grâce au cache multi-niveaux (Redis, CDN)
-
Sécurité
Protection des données bancaires avec chiffrement AES-256, JWT RS256, conformité RGPD et PCI DSS
-
Maintenabilité
Code TypeScript, architecture modulaire NestJS, tests automatisés et documentation OpenAPI
-
Disponibilité
Déploiement CapRover avec SLA 99.9%, circuit breakers et health checks
9.3 Évolutions Prévues
9.3.1 Court Terme (6 mois)
- GraphQL : API GraphQL pour les clients mobiles (flexibilité des requêtes)
- gRPC : Communication inter-services plus performante
- WebSocket : Amélioration du temps réel pour les notifications
9.3.2 Moyen Terme (12 mois)
- Kubernetes : Migration vers K8s pour orchestration avancée
- Service Mesh : Istio pour observabilité et sécurité
- Machine Learning : Détection de fraude et recommandations personnalisées
9.3.3 Long Terme (24 mois)
- Event Sourcing : Traçabilité complète des événements métier
- CQRS : Séparation lecture/écriture pour scalabilité maximale
- Multi-région : Déploiement européen pour latence réduite
9.4 Références
Documents complémentaires :