Skip to content

Latest commit

 

History

History
469 lines (345 loc) · 11.9 KB

File metadata and controls

469 lines (345 loc) · 11.9 KB

ScamGuard MVP - État du Projet

Date: 17 février 2026 Branche: feature/phase-4-compliance-fdp-integration Statut: ✅ DÉPLOYÉ EN PRODUCTION


📊 Vue d'ensemble

ScamGuard est une application web d'IA pour la détection et la prévention des arnaque, avec focus sur la protection des personnes âgées. L'application est entièrement déployée sur AWS avec infrastructure serverless.

URLs de Déploiement

Service URL
Frontend (CDN) https://dv04w7vjfnkg5.cloudfront.net
Backend API https://k4jjgkz8xj.execute-api.us-east-1.amazonaws.com
Région AWS us-east-1
Compte AWS 034362029181 (scamguard-dev)

🏗️ Architecture Infrastructure

Services AWS Déployés

┌─────────────────────────────────────┐
│     Frontend (S3 + CloudFront)      │
│  - React app avec accessibilité     │
│  - Cached au global CDN             │
└──────────────┬──────────────────────┘
               │
               ▼
┌─────────────────────────────────────┐
│   API Gateway (HTTP API)            │
│  - Endpoints REST pour l'app        │
│  - Intégration Lambda               │
└──────────────┬──────────────────────┘
               │
               ▼
┌─────────────────────────────────────┐
│     Lambda Functions                │
│  - LLM Integration (OpenAI/Gemini)  │
│  - Scenario Generation              │
│  - Analysis Engine                  │
│  - Image Processing                 │
└──────────────┬──────────────────────┘
               │
        ┌──────┴───────┐
        ▼              ▼
   ┌────────┐     ┌──────────────┐
   │DynamoDB│     │Secrets Manager│
   │ Data   │     │ API Keys      │
   └────────┘     └──────────────┘

Ressources CloudFormation

Ressource Type Statut
Frontend Bucket S3 ✅ Active
CloudFront Distribution CDN ✅ Deployed
Lambda Function Compute ✅ Active
API Gateway HTTP API Network ✅ Active
DynamoDB Table Database ✅ Active
Cognito User Pool Auth ✅ Configured
Secrets Manager Secrets ✅ Active
CloudWatch Alarms Monitoring ✅ Active

🎯 Fonctionnalités Actuelles

Frontend (React)

Emplacement: /frontend/src/

Pages/Vues

  1. Accueil (Home)

    • Menu principal avec 2 options
    • Texte de bienvenue en français
    • Boutons larges (60px) pour accessibilité tactile
  2. Scénario de Formation (Scenario)

    • Affichage d'un faux message de scam
    • Bouton pour relire le message (🔊)
    • Zone de réponse textuelle avec dictée vocale (🎙️)
    • Synthèse vocale du message pour accessibilité
  3. Analyse de Message (Detection)

    • Upload de photo du message suspect
    • Zone de description textuelle
    • Lancement de l'analyse IA
  4. Résultats (Result)

    • Affichage du score de sécurité (0-100)
    • Feedback coaching personnalisé
    • Badge XP gagné
    • Retour à l'accueil

Caractéristiques Accessibilité

  • ✅ Reconnaissance vocale (French - fr-FR)
  • ✅ Synthèse vocale/Text-to-Speech (French)
  • ✅ Grandes polices (18px base, 22px h2)
  • ✅ Contraste amélioré (bleu #0056b3)
  • ✅ Cibles tactiles larges (60px min)
  • ✅ Support caméra native (capture mobile)
  • ✅ ARIA labels pour accessibilité écran

Fichiers Clés

frontend/
├── src/
│   ├── App.jsx          (238 lignes - Composant principal)
│   ├── App.css          (198 lignes - Styling accessible)
│   ├── index.jsx        (11 lignes - Point d'entrée React)
│   └── index.html       (Public entry point)
├── package.json         (React 18.2.0, axios)
├── .env                 (REACT_APP_LAMBDA_URL configuré)
└── build/               (Build optimisé prêt pour production)

Statistiques du Build:

  • Taille JS: 47.21 kB (gzip)
  • Taille CSS: 1.08 kB (gzip)
  • Bundle taille: ~48 kB total

Backend (Lambda)

Emplacement: /backend/lambda/

Endpoints API

  1. POST /analyze

    • Analyse de scénario/message
    • Input: { action: 'analyze', scenario, userResponse, imageBase64 }
    • Output: { detection: { score }, coaching: { feedback, xp_earned } }
  2. POST /generate_scenario

    • Génération d'un faux scénario
    • Input: { action: 'generate_scenario', userId }
    • Output: { title, content }

LLM Integration

Stratégie: API HTTP directes (pas de SDK)

  • OpenAI (Primaire)

    • Modèle: GPT-3.5-turbo
    • Prompt engineering pour analyse de scam
    • Fallback vers Gemini si erreur
  • Google Gemini (Fallback)

    • API Google Generative AI
    • Analyse de contenu pour contexte
  • Fallback Heuristique

    • Détection de keywords de scam
    • Pattern matching si LLMs indisponibles

Gestion des Secrets

Stockés dans AWS Secrets Manager:

  • scamguard/openai-key → OPENAI_API_KEY
  • scamguard/gemini-key → GEMINI_API_KEY

Fichiers Clés

backend/lambda/
├── index.py             (Point d'entrée Lambda)
├── handler_llm.py       (Logique principale avec LLM)
├── requirements.txt     (boto3, requests, google-generativeai)
└── agents/              (Agents de détection, scénario, etc.)

Configuration Lambda

  • Runtime: Python 3.12
  • Timeout: 30s
  • Memory: 512MB
  • Env Vars: Secrets Manager ARNs

🔐 Sécurité & Authentification

État Actuel

  • ✅ Cognito User Pool configuré
  • ✅ API Gateway avec autorisation
  • ✅ Secrets Manager pour API keys
  • ✅ HTTPS enforced (CloudFront redirect)
  • ✅ CORS configuré

Credentials

Type Valeur Stockage
User Pool ID us-east-1_L35zaDPJn .env
Client ID tb4o4jblsbtekhtl9s611j4fg .env
OpenAI Key (Secrets Manager) AWS Secrets
Gemini Key (Secrets Manager) AWS Secrets

📦 Déploiement CDK

Stack CloudFormation

Nom: ScamGuardStack ARN: arn:aws:cloudformation:us-east-1:034362029181:stack/ScamGuardStack/fd4fe6d0-0c38-11f1-a950-0affecae193f

Outputs

✓ APIEndpoint = https://k4jjgkz8xj.execute-api.us-east-1.amazonaws.com/
✓ CloudFrontURL = https://dv04w7vjfnkg5.cloudfront.net
✓ FrontendBucketName = scamguardstack-frontendbucketefe2e19c-5zt0alq9uprw
✓ TableName = ScamGuardStack-DataTable447BC44E-1BID2SBGQEELH
✓ UserPoolId = us-east-1_L35zaDPJn
✓ CloudFront Distribution ID = E1C54UEBEPD83U
✓ Alarm Topic ARN = arn:aws:sns:us-east-1:034362029181:ScamGuardStack-AlarmTopicD01E77F9-X3HHofJpvWkJ

Fichiers CDK

backend/cdk/
├── app.py               (Point d'entrée CDK)
├── stacks/
│   └── scamguard_stack.py (238 lignes - Définition complète)
└── requirements.txt     (aws-cdk-lib, constructs)

📊 Base de Données

DynamoDB Table

Nom: ScamGuardStack-DataTable447BC44E-1BID2SBGQEELH

Partition Key: userId Sort Key: timestamp

Attributs Stockés:

  • userId
  • timestamp
  • scenario_id
  • user_response
  • detection_score
  • xp_earned
  • feedback

🚀 Processus de Déploiement

Frontend

# 1. Développement
cd frontend && npm start

# 2. Build
npm run build

# 3. Déploiement S3
aws s3 sync build/ s3://[BUCKET]/

# 4. Invalidation CloudFront
aws cloudfront create-invalidation --distribution-id E1C54UEBEPD83U --paths "/*"

Backend

# 1. CDK Synthesis
cdk synth -c account=034362029181 -c region=us-east-1

# 2. Déploiement
cdk deploy --require-approval never

# 3. Lambda Zip package (automatic via CDK)

Derniers Déploiements

Date Type Fichiers Statut
2026-02-17 19:44 Frontend Upgrade App.jsx, App.css ✅ Deployed
2026-02-17 19:42 CDK Stack scamguard_stack.py ✅ Updated
2026-02-17 19:30 Build React All components ✅ Optimized
2026-02-17 18:58 Initial Deploy Infrastructure ✅ Created

🐛 Versions & Dépendances

Frontend

{
  "dependencies": {
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "axios": "^1.6.0"
  },
  "devDependencies": {
    "react-scripts": "5.0.1"
  }
}

Vulnérabilités: 32 (24 moderate, 8 high) - À adresser

Backend

boto3              (AWS SDK)
requests           (HTTP calls)
google-generativeai (Gemini API)
openai            (OpenAI API)
python-dotenv     (Env config)

📋 Tests & QA

Backend Tests

Emplacement: /backend/tests/

  • test_handler.py - Tests API endpoints
  • test_agents.py - Tests agents IA
  • test_compliance_*.py - Tests conformité RGPD
  • test_elder_protection.py - Tests protection personnes âgées

État: ⚠️ À exécuter avant production complète

pytest /backend/tests/ -v

Frontend Testing

État: ⚠️ Pas de tests unitaires configurés

À ajouter:

  • Unit tests avec Jest
  • E2E tests avec Cypress
  • Accessibility tests avec axe

🎯 Prochaines Étapes Recommandées

Court Terme (1-2 jours)

  • Ajouter tests unitaires frontend (Jest)
  • Fixer les vulnérabilités NPM (npm audit fix)
  • Tests E2E avec scénarios réels
  • Implémenter logging complet côté frontend
  • Configuration de monitoring CloudWatch avancé

Moyen Terme (1-2 semaines)

  • Intégrer Cognito authentication complète
  • Ajouter persistance des résultats (DynamoDB)
  • Dashboard analytics des utilisateurs
  • Multi-langue support (FR/EN/ES)
  • Customisation des scénarios de formation

Long Terme

  • Mobile app native (iOS/Android)
  • Offline mode pour analyse
  • Integration WhatsApp/Telegram
  • Système de points communautaire
  • Partenariats bancaires/polices

📈 Coûts Estimés (Mensuel)

Service Estimation
Lambda $0.50 - $2.00
API Gateway $1.00
DynamoDB $1.00 - $5.00
S3 + CloudFront $0.50 - $1.00
Secrets Manager $0.40
CloudWatch $0.30
TOTAL ~$4-10/mois

Basé sur usage MVP faible. Peut augmenter avec scaling.


🔗 Ressources Connexes

Documentation

Accès & Credentials

AWS CLI Profile:

aws sts get-caller-identity --profile default  # Root access
aws sts get-caller-identity --profile scamguard-dev  # Limited user

Git Repository:

cd /Users/echetoui/scamguard-mvp
git branch -a
git log --oneline -10

📝 Notes Importantes

✅ Complété

  • Infrastructure AWS complète (CDK)
  • Frontend React avec accessibilité
  • Backend Lambda avec LLM integration
  • Déploiement automé S3 + CloudFront
  • Gestion des secrets AWS
  • Support voix français (speech recognition + TTS)
  • Optimisation des bundles

⚠️ En Cours

  • Tests automatisés complets
  • Monitoring & alertes avancées
  • Documentation utilisateur

❌ À Faire

  • Authentification Cognito complète
  • Tests de charge/stress
  • Conformité RGPD documentée
  • Performance optimization (< 2s load)
  • Backup & disaster recovery

📞 Contact & Support

Responsable: @echetoui Compte AWS: 034362029181 Région Primaire: us-east-1 Branche Développement: feature/phase-4-compliance-fdp-integration


Dernière mise à jour: 17 février 2026, 19:50 UTC