- Add hybrid deployment modes: local_dev (MVP) and production_pwa (optional) - Integrate WarFactory engine reuse with hot-reload 0.4ms - Define multi-target compilation strategy (DLL/SO/WASM) - Detail both deployment modes with cost analysis - Add progressive roadmap: Phase 1 (local), Phase 2 (POC WASM), Phase 3 (cloud) - Budget clarified: $10-20/mois (local) vs $13-25/mois (cloud) - Document open questions for technical validation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
912 lines
26 KiB
Markdown
912 lines
26 KiB
Markdown
# Analyse des Alternatives Techniques - AISSIA
|
|
|
|
**Date:** 27 octobre 2025
|
|
**Contexte:** Analyse comparative de toutes les options techniques discutées pour le développement d'AISSIA
|
|
|
|
---
|
|
|
|
## Table des Matières
|
|
|
|
1. [Résumé Exécutif](#résumé-exécutif)
|
|
2. [Alternatives Backend](#alternatives-backend)
|
|
3. [Alternatives Frontend](#alternatives-frontend)
|
|
4. [Alternatives Architecture](#alternatives-architecture)
|
|
5. [Alternatives Déploiement](#alternatives-déploiement)
|
|
6. [Matrice de Décision](#matrice-de-décision)
|
|
7. [Décision Finale et Justifications](#décision-finale-et-justifications)
|
|
|
|
---
|
|
|
|
## Résumé Exécutif
|
|
|
|
### Besoin Principal
|
|
Assistant personnel proactif avec :
|
|
- Détection hyperfocus en temps réel
|
|
- Interventions vocales contextuelles
|
|
- Planning intelligent avec IA
|
|
- Monitoring applicatif natif
|
|
- Cross-platform (Windows/Mac/Linux en priorité)
|
|
|
|
### Décision Finale Retenue
|
|
**C++ Modulaire (WarFactory Engine) + ImGui + Claude Haiku 4.5**
|
|
|
|
**Raisons clés :**
|
|
1. ✅ Réutilisation moteur existant déjà développé
|
|
2. ✅ Types stricts C++ (pas de wildcode)
|
|
3. ✅ Hot-reload ultra-rapide (0.4ms)
|
|
4. ✅ Architecture modulaire éprouvée
|
|
5. ✅ Tout local (privacy, $0 hosting, offline-first)
|
|
|
|
---
|
|
|
|
## Alternatives Backend
|
|
|
|
### Option 1 : Node.js Pur (Sans C++)
|
|
|
|
**Architecture :**
|
|
```
|
|
Electron/Tauri Frontend
|
|
↓
|
|
Node.js Backend (localhost)
|
|
↓ active-win (npm)
|
|
Monitoring Apps
|
|
```
|
|
|
|
**✅ Avantages :**
|
|
- Rapide à développer (écosystème npm riche)
|
|
- Pas de complexité build C++
|
|
- Hot-reload natif (nodemon)
|
|
- Cross-platform via packages npm (`active-win`, etc.)
|
|
- Debugging simple (Chrome DevTools)
|
|
|
|
**❌ Inconvénients :**
|
|
- Pas de types stricts (TypeScript aide mais pas natif)
|
|
- "Wildcode" JavaScript (moins structuré que C++)
|
|
- Performance inférieure au C++ natif
|
|
- Monitoring apps limité (dépend de packages npm)
|
|
- Pas de réutilisation du moteur WarFactory
|
|
|
|
**Verdict :** ❌ Rejeté - Manque de types stricts et pas de réutilisation code existant
|
|
|
|
---
|
|
|
|
### Option 2 : C++ Core + Node.js Wrapper (N-API)
|
|
|
|
**Architecture :**
|
|
```
|
|
Frontend (React/Vue)
|
|
↓ WebSocket
|
|
Node.js Backend
|
|
↓ N-API binding
|
|
C++ Core Modules (.node addons)
|
|
↓ Win32/AppKit/X11
|
|
Native OS APIs
|
|
```
|
|
|
|
**✅ Avantages :**
|
|
- Performance native C++ pour monitoring critique
|
|
- Écosystème Node.js pour glue code
|
|
- N-API stable et bien documenté
|
|
- Cross-platform (compile .node pour chaque OS)
|
|
- Bon compromis performance/productivité
|
|
|
|
**❌ Inconvénients :**
|
|
- Complexité build (node-gyp + CMake)
|
|
- Debugging complexe (C++ crash + JS context)
|
|
- Maintenance deux langages (C++ + JS/TS)
|
|
- Setup environnement compliqué (Python, build tools)
|
|
- Pas de réutilisation directe moteur WarFactory
|
|
|
|
**Verdict :** ⚠️ Viable mais complexe - Bonne option si besoin écosystème Node.js
|
|
|
|
---
|
|
|
|
### Option 3 : Rust + Node (N-API)
|
|
|
|
**Architecture :**
|
|
```
|
|
Frontend (React/Vue)
|
|
↓ WebSocket
|
|
Node.js Backend
|
|
↓ N-API (neon-bindings)
|
|
Rust Core Modules
|
|
↓ Windows/macOS/Linux APIs
|
|
Native OS APIs
|
|
```
|
|
|
|
**✅ Avantages :**
|
|
- Sécurité mémoire Rust (moins de segfaults que C++)
|
|
- Performance native équivalente C++
|
|
- N-API via `neon-bindings` bien maintenu
|
|
- Écosystème cargo moderne
|
|
- Moins de bugs mémoire qu'en C++
|
|
|
|
**❌ Inconvénients :**
|
|
- Courbe d'apprentissage Rust (ownership, lifetimes)
|
|
- Pas de réutilisation moteur WarFactory (écrit en C++)
|
|
- Complexité build similaire à C++
|
|
- Debugging Rust + Node.js complexe
|
|
- Temps de compilation Rust élevé
|
|
|
|
**Verdict :** ❌ Rejeté - Pas de réutilisation code existant + courbe apprentissage
|
|
|
|
---
|
|
|
|
### Option 4 : C++ Pur (WarFactory Engine Réutilisé)
|
|
|
|
**Architecture :**
|
|
```
|
|
ImGui UI (C++)
|
|
↓ IPC (IntraIO)
|
|
WarFactory Engine Core
|
|
↓ DLL/SO Loader
|
|
AISSIA Modules (.dll/.so)
|
|
- MonitoringModule.dll
|
|
- SchedulerModule.dll
|
|
- AIModule.dll
|
|
- VoiceModule.dll
|
|
- StorageModule.dll
|
|
↓ Win32/AppKit/X11
|
|
Native OS APIs
|
|
```
|
|
|
|
**✅ Avantages :**
|
|
- ✅ **Réutilisation moteur existant** (WarFactory déjà développé et testé)
|
|
- ✅ **Types stricts C++** (pas de wildcode)
|
|
- ✅ **Hot-reload ultra-rapide** (0.4ms iteration)
|
|
- ✅ **Architecture modulaire éprouvée** (IModule, IIO, IEngine)
|
|
- ✅ **Performance maximale** (natif C++)
|
|
- ✅ **Cross-platform** (DLL/SO loader Windows/Linux/Mac)
|
|
- ✅ **Build autonome** (chaque module : `cmake .`)
|
|
- ✅ **Développement parallèle** (multiples modules simultanés)
|
|
- ✅ **ImGui intégré** (déjà dans WarFactory)
|
|
- ✅ **Zéro coût backend** (tout local)
|
|
|
|
**❌ Inconvénients :**
|
|
- Courbe apprentissage C++ si pas expert
|
|
- Debugging segfaults plus compliqué que JS
|
|
- UI ImGui moins moderne que React/Vue (mais suffisant MVP)
|
|
- Mobile difficile (mais pas priorité MVP)
|
|
|
|
**Verdict :** ✅ **RETENU** - Meilleur rapport réutilisation/performance/types stricts
|
|
|
|
---
|
|
|
|
### Option 5 : C# .NET + Electron.NET
|
|
|
|
**Architecture :**
|
|
```
|
|
Electron.NET (C# backend)
|
|
↓ .NET Core
|
|
C# Modules
|
|
↓ Win32 API (P/Invoke)
|
|
Native Windows APIs
|
|
```
|
|
|
|
**✅ Avantages :**
|
|
- Types stricts C# (fortement typé)
|
|
- Win32 API facile via P/Invoke
|
|
- Écosystème .NET riche
|
|
- Debugging Visual Studio excellent
|
|
- UI moderne via Electron
|
|
|
|
**❌ Inconvénients :**
|
|
- Electron.NET moins mature que Electron classique
|
|
- Cross-platform limité (Win32 spécifique Windows)
|
|
- Pas de réutilisation moteur WarFactory (écrit en C++)
|
|
- Performance inférieure au C++ natif
|
|
- Dépendance .NET Runtime
|
|
|
|
**Verdict :** ❌ Rejeté - Pas de réutilisation WarFactory + moins performant que C++
|
|
|
|
---
|
|
|
|
### Option 6 : FastAPI (Python) + Flutter
|
|
|
|
**Architecture :**
|
|
```
|
|
Flutter Frontend (Mobile + Desktop)
|
|
↓ REST API / WebSocket
|
|
FastAPI Backend (Python)
|
|
↓ pywin32 / AppKit bindings
|
|
Native OS APIs
|
|
```
|
|
|
|
**✅ Avantages :**
|
|
- Développement rapide (Python + Flutter)
|
|
- UI moderne cross-platform (Flutter)
|
|
- Intégration IA facile (Python)
|
|
- Mobile natif (Android/iOS)
|
|
|
|
**❌ Inconvénients :**
|
|
- Pas de types stricts (Python dynamique)
|
|
- Performance médiocre (Python)
|
|
- Nécessite backend séparé (complexité déploiement)
|
|
- Pas de réutilisation WarFactory
|
|
- Coût hosting backend ($10-50/mois)
|
|
|
|
**Verdict :** ❌ Rejeté - Pas de types stricts + coût hosting + pas réutilisation
|
|
|
|
---
|
|
|
|
## Alternatives Frontend
|
|
|
|
### Option 1 : Dear ImGui (C++ Intégré)
|
|
|
|
**Architecture :**
|
|
```cpp
|
|
// ui-imgui.dll module
|
|
class UIModule : public IModule {
|
|
void Render() {
|
|
ImGui::Begin("AISSIA Dashboard");
|
|
// Render planning, tasks, settings
|
|
ImGui::End();
|
|
}
|
|
};
|
|
```
|
|
|
|
**✅ Avantages :**
|
|
- ✅ Déjà intégré dans WarFactory
|
|
- ✅ Natif C++ (même langage que modules)
|
|
- ✅ Hot-reloadable comme les autres modules
|
|
- ✅ Rapide à prototyper
|
|
- ✅ Performance native
|
|
- ✅ Pas de dépendance externe
|
|
|
|
**❌ Inconvénients :**
|
|
- UI moins moderne que React/Vue
|
|
- Styling limité (look "debug tool")
|
|
- Pas mobile-friendly
|
|
|
|
**Verdict :** ✅ **RETENU pour MVP** - Rapidité prototypage + intégration parfaite
|
|
|
|
---
|
|
|
|
### Option 2 : Electron (React/Vue)
|
|
|
|
**Architecture :**
|
|
```
|
|
Electron App (React/Vue UI)
|
|
↓ WebSocket
|
|
C++ Backend (WarFactory Engine)
|
|
↓ ui-websocket.dll module
|
|
IPC Bridge
|
|
```
|
|
|
|
**✅ Avantages :**
|
|
- UI moderne et professionnelle
|
|
- Écosystème riche (React components)
|
|
- Hot-reload frontend natif
|
|
- Design système avancé (Tailwind, Material UI)
|
|
- Cross-platform desktop
|
|
|
|
**❌ Inconvénients :**
|
|
- Complexité accrue (2 processus : Electron + C++ backend)
|
|
- Build plus lourd (Electron bundle ~150MB)
|
|
- Latence IPC WebSocket
|
|
- Maintenance deux stacks (JS + C++)
|
|
|
|
**Verdict :** ⚠️ **Phase 2** - Si besoin UX premium après MVP
|
|
|
|
---
|
|
|
|
### Option 3 : Tauri (Rust/JS)
|
|
|
|
**Architecture :**
|
|
```
|
|
Tauri App (React/Vue UI)
|
|
↓ IPC (Rust bindings)
|
|
C++ Backend via FFI
|
|
```
|
|
|
|
**✅ Avantages :**
|
|
- Léger (~10MB vs 150MB Electron)
|
|
- Sécurité accrue (Rust backend)
|
|
- UI moderne (React/Vue)
|
|
- Performance native
|
|
|
|
**❌ Inconvénients :**
|
|
- FFI C++ ↔ Rust complexe
|
|
- Tauri moins mature qu'Electron
|
|
- Pas de réutilisation directe WarFactory
|
|
- Courbe apprentissage Tauri
|
|
|
|
**Verdict :** ❌ Rejeté - Complexité FFI + pas mature
|
|
|
|
---
|
|
|
|
### Option 4 : Flutter Desktop
|
|
|
|
**Architecture :**
|
|
```
|
|
Flutter Desktop App
|
|
↓ Platform Channels
|
|
C++ Backend (WarFactory Engine)
|
|
```
|
|
|
|
**✅ Avantages :**
|
|
- UI moderne cross-platform
|
|
- Performance native (compiled)
|
|
- Hot-reload Flutter
|
|
- Mobile future facile
|
|
|
|
**❌ Inconvénients :**
|
|
- Platform Channels C++ ↔ Dart complexe
|
|
- Flutter Desktop moins mature que Web/Mobile
|
|
- Build setup compliqué
|
|
- Dépendance Dart/Flutter toolchain
|
|
|
|
**Verdict :** ❌ Rejeté pour MVP - Complexité intégration
|
|
|
|
---
|
|
|
|
### Option 5 : Qt (C++)
|
|
|
|
**Architecture :**
|
|
```cpp
|
|
QApplication app;
|
|
MainWindow window; // Qt Widgets
|
|
// Intégré directement dans C++ backend
|
|
```
|
|
|
|
**✅ Avantages :**
|
|
- Natif C++ (même langage)
|
|
- UI professionnelle
|
|
- Cross-platform mature
|
|
- Intégration parfaite avec WarFactory
|
|
|
|
**❌ Inconvénients :**
|
|
- Licence Qt (GPL ou commercial $$$)
|
|
- Complexité Qt framework
|
|
- Build setup lourd (qmake/CMake)
|
|
- Courbe apprentissage élevée
|
|
|
|
**Verdict :** ❌ Rejeté - Licence + complexité vs ImGui
|
|
|
|
---
|
|
|
|
## Alternatives Architecture
|
|
|
|
### Option 1 : Monolithe (Tout dans un exécutable)
|
|
|
|
**Architecture :**
|
|
```cpp
|
|
// aissia.exe - tout en un
|
|
int main() {
|
|
MonitoringSystem monitor;
|
|
SchedulerSystem scheduler;
|
|
AISystem ai;
|
|
VoiceSystem voice;
|
|
UISystem ui;
|
|
|
|
while (running) {
|
|
monitor.update();
|
|
scheduler.update();
|
|
ai.update();
|
|
// ...
|
|
}
|
|
}
|
|
```
|
|
|
|
**✅ Avantages :**
|
|
- Simple à déployer (1 fichier .exe)
|
|
- Pas de complexité DLL/SO
|
|
- Debugging simple (tout dans un processus)
|
|
|
|
**❌ Inconvénients :**
|
|
- Pas de hot-reload
|
|
- Rebuild complet à chaque modification (5+ min)
|
|
- Impossible de développer modules en parallèle
|
|
- Couplage fort entre systèmes
|
|
- Pas de réutilisation composants
|
|
|
|
**Verdict :** ❌ Rejeté - Pas de hot-reload + temps dev long
|
|
|
|
---
|
|
|
|
### Option 2 : Microservices (Services séparés)
|
|
|
|
**Architecture :**
|
|
```
|
|
monitoring-service.exe (Port 3001)
|
|
scheduler-service.exe (Port 3002)
|
|
ai-service.exe (Port 3003)
|
|
voice-service.exe (Port 3004)
|
|
↓ HTTP REST
|
|
API Gateway (Port 3000)
|
|
↓
|
|
Frontend
|
|
```
|
|
|
|
**✅ Avantages :**
|
|
- Scaling horizontal facile
|
|
- Déploiement indépendant services
|
|
- Isolation complète
|
|
- Technologie différente par service
|
|
|
|
**❌ Inconvénients :**
|
|
- Complexité déploiement (5+ processus)
|
|
- Latence réseau entre services
|
|
- Orchestration complexe (Docker, K8s)
|
|
- Overkill pour usage personnel
|
|
- Debugging distribué difficile
|
|
|
|
**Verdict :** ❌ Rejeté - Over-engineering pour MVP
|
|
|
|
---
|
|
|
|
### Option 3 : Architecture Modulaire DLL/SO (WarFactory)
|
|
|
|
**Architecture :**
|
|
```
|
|
aissia-core.exe (Engine WarFactory)
|
|
↓ DLL/SO Loader
|
|
modules/
|
|
monitoring.dll
|
|
scheduler.dll
|
|
ai.dll
|
|
voice.dll
|
|
storage.dll
|
|
ui.dll
|
|
```
|
|
|
|
**✅ Avantages :**
|
|
- ✅ **Hot-reload ultra-rapide** (0.4ms)
|
|
- ✅ **Build autonome** par module (`cmake .`)
|
|
- ✅ **Développement parallèle** (multiples devs/modules)
|
|
- ✅ **Isolation** (crash module ≠ crash app)
|
|
- ✅ **Réutilisation** (modules entre projets)
|
|
- ✅ **Architecture éprouvée** (WarFactory)
|
|
- ✅ **Testing isolé** par module
|
|
|
|
**❌ Inconvénients :**
|
|
- Setup initial DLL loader (déjà fait dans WarFactory)
|
|
- Gestion version modules (résolu par gameconfig.json)
|
|
|
|
**Verdict :** ✅ **RETENU** - Meilleur compromis modularité/performance
|
|
|
|
---
|
|
|
|
### Option 4 : Plugin System (Shared Libraries)
|
|
|
|
**Architecture :**
|
|
Similaire à Option 3 mais sans l'architecture complète WarFactory (IEngine, IModuleSystem, IIO, etc.)
|
|
|
|
**✅ Avantages :**
|
|
- Modularité
|
|
- Hot-reload possible
|
|
|
|
**❌ Inconvénients :**
|
|
- Réinventer la roue (WarFactory existe déjà)
|
|
- Pas de pub/sub IIO
|
|
- Pas de task scheduler
|
|
- Pas de configuration IDataTree
|
|
|
|
**Verdict :** ❌ Rejeté - WarFactory fait mieux
|
|
|
|
---
|
|
|
|
## Alternatives Déploiement
|
|
|
|
### Option 1 : Local-Only (Tout sur machine utilisateur)
|
|
|
|
**Architecture :**
|
|
```
|
|
User Machine
|
|
├── aissia-core.exe
|
|
├── modules/*.dll
|
|
├── aissia.db (SQLite)
|
|
└── gameconfig.json
|
|
```
|
|
|
|
**✅ Avantages :**
|
|
- ✅ **$0 coût hosting**
|
|
- ✅ **Privacy maximale** (données jamais uploaded)
|
|
- ✅ **Offline-first** (fonctionne sans internet)
|
|
- ✅ **Latence zéro** (tout local)
|
|
- ✅ **Simple à déployer** (copier dossier)
|
|
|
|
**❌ Inconvénients :**
|
|
- Pas de sync multi-devices (sauf cloud storage manuel)
|
|
- Backup manuel utilisateur
|
|
- Pas de mobile (difficile sans backend)
|
|
|
|
**Verdict :** ✅ **RETENU pour MVP** - Privacy + $0 coût + simplicité
|
|
|
|
---
|
|
|
|
### Option 2 : Cloud Backend (Serveur centralisé)
|
|
|
|
**Architecture :**
|
|
```
|
|
User Machine (Frontend)
|
|
↓ HTTPS REST
|
|
Cloud Server (Backend)
|
|
↓
|
|
PostgreSQL Database
|
|
Redis Cache
|
|
S3 Storage
|
|
```
|
|
|
|
**✅ Avantages :**
|
|
- Sync multi-devices automatique
|
|
- Backup automatique
|
|
- Mobile facile (API REST)
|
|
- Analytics centralisées
|
|
|
|
**❌ Inconvénients :**
|
|
- Coût hosting ($10-50/mois minimum)
|
|
- Privacy concerns (données sur serveur tiers)
|
|
- Dépendance internet
|
|
- Complexité déploiement (Docker, scaling)
|
|
- RGPD compliance nécessaire
|
|
|
|
**Verdict :** ❌ Rejeté pour MVP - Coût + privacy + complexité
|
|
|
|
**Possible Phase 3** : Sync optionnel cloud pour multi-devices
|
|
|
|
---
|
|
|
|
### Option 3 : Hybride (Local + Sync Optionnel)
|
|
|
|
**Architecture :**
|
|
```
|
|
User Machine (Primary)
|
|
├── aissia-core.exe (local)
|
|
├── aissia.db (SQLite local)
|
|
└── Sync Service (optionnel)
|
|
↓ HTTPS (si activé)
|
|
Cloud Sync Server (optionnel)
|
|
└── Backup DB + sync delta
|
|
```
|
|
|
|
**✅ Avantages :**
|
|
- Fonctionnement 100% local par défaut
|
|
- Sync optionnel si utilisateur veut
|
|
- Privacy par défaut (opt-in cloud)
|
|
- Coût scaling progressif
|
|
|
|
**❌ Inconvénients :**
|
|
- Complexité sync (conflict resolution)
|
|
- Deux modes à maintenir (local + cloud)
|
|
- Backend à développer même si optionnel
|
|
|
|
**Verdict :** ⚠️ **Phase 2/3** - Commence local, ajoute sync si besoin
|
|
|
|
---
|
|
|
|
### Option 4 : P2P Sync (Syncthing-like)
|
|
|
|
**Architecture :**
|
|
```
|
|
User Machine A User Machine B
|
|
↓ ↓
|
|
└───── P2P Network ─────┘
|
|
(Syncthing, IPFS)
|
|
```
|
|
|
|
**✅ Avantages :**
|
|
- Pas de serveur centralisé ($0 coût)
|
|
- Privacy maximale
|
|
- Sync multi-devices sans cloud
|
|
|
|
**❌ Inconvénients :**
|
|
- Complexité P2P (NAT traversal, discovery)
|
|
- Conflict resolution difficile
|
|
- Dépendance Syncthing/IPFS
|
|
- Setup utilisateur complexe
|
|
|
|
**Verdict :** ❌ Rejeté - Complexité vs bénéfice
|
|
|
|
---
|
|
|
|
## Matrice de Décision
|
|
|
|
### Backend
|
|
|
|
| Option | Types Stricts | Performance | Réutilisation WarFactory | Complexité | Verdict |
|
|
|--------|---------------|-------------|--------------------------|------------|---------|
|
|
| Node.js pur | ❌ | ⭐⭐ | ❌ | ⭐⭐⭐⭐⭐ | ❌ Rejeté |
|
|
| C++ + Node Wrapper | ⚠️ | ⭐⭐⭐⭐ | ⚠️ | ⭐⭐⭐ | ⚠️ Viable |
|
|
| Rust + Node | ✅ | ⭐⭐⭐⭐ | ❌ | ⭐⭐ | ❌ Rejeté |
|
|
| **C++ Pur (WarFactory)** | ✅ | ⭐⭐⭐⭐⭐ | ✅ | ⭐⭐⭐ | ✅ **RETENU** |
|
|
| C# .NET | ✅ | ⭐⭐⭐ | ❌ | ⭐⭐⭐⭐ | ❌ Rejeté |
|
|
| Python FastAPI | ❌ | ⭐⭐ | ❌ | ⭐⭐⭐⭐⭐ | ❌ Rejeté |
|
|
|
|
### Frontend
|
|
|
|
| Option | Rapidité Proto | Intégration C++ | UI Moderne | Mobile | Verdict |
|
|
|--------|----------------|-----------------|------------|--------|---------|
|
|
| **ImGui** | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐ | ❌ | ✅ **MVP** |
|
|
| Electron | ⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ❌ | ⚠️ Phase 2 |
|
|
| Tauri | ⭐⭐⭐ | ⭐⭐ | ⭐⭐⭐⭐⭐ | ❌ | ❌ Rejeté |
|
|
| Flutter | ⭐⭐⭐ | ⭐⭐ | ⭐⭐⭐⭐ | ✅ | ❌ Rejeté |
|
|
| Qt | ⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⚠️ | ❌ Rejeté |
|
|
|
|
### Architecture
|
|
|
|
| Option | Hot-Reload | Dev Parallèle | Réutilisation | Complexité | Verdict |
|
|
|--------|------------|---------------|---------------|------------|---------|
|
|
| Monolithe | ❌ | ❌ | ❌ | ⭐⭐⭐⭐⭐ | ❌ Rejeté |
|
|
| Microservices | ✅ | ✅ | ✅ | ⭐ | ❌ Over-eng |
|
|
| **DLL/SO Modulaire** | ⭐⭐⭐⭐⭐ | ✅ | ✅ | ⭐⭐⭐ | ✅ **RETENU** |
|
|
| Plugin System | ⭐⭐⭐ | ✅ | ⚠️ | ⭐⭐⭐⭐ | ❌ Rejeté |
|
|
|
|
### Déploiement
|
|
|
|
| Option | Coût | Privacy | Offline | Sync Multi-Device | Verdict |
|
|
|--------|------|---------|---------|-------------------|---------|
|
|
| **Local-Only** | $0 | ⭐⭐⭐⭐⭐ | ✅ | ❌ | ✅ **MVP** |
|
|
| Cloud Backend | $10-50/mois | ⭐⭐ | ❌ | ✅ | ❌ Rejeté |
|
|
| Hybride | $0-10/mois | ⭐⭐⭐⭐ | ✅ | ⚠️ | ⚠️ Phase 2 |
|
|
| P2P Sync | $0 | ⭐⭐⭐⭐⭐ | ✅ | ⚠️ | ❌ Complexe |
|
|
|
|
---
|
|
|
|
## Décision Finale et Justifications
|
|
|
|
### Stack Retenue : C++ Modulaire (WarFactory) + ImGui + Local-Only
|
|
|
|
**Architecture Finale :**
|
|
```
|
|
┌─────────────────────────────────────┐
|
|
│ ImGui UI (ui-imgui.dll) │
|
|
│ - Planning dashboard │
|
|
│ - Task management │
|
|
│ - Settings │
|
|
└─────────────┬───────────────────────┘
|
|
│ IntraIO (IPC local)
|
|
┌─────────────▼───────────────────────┐
|
|
│ aissia-core.exe │
|
|
│ (WarFactory Engine) │
|
|
│ ┌────────────────────────────────┐ │
|
|
│ │ ICoordinationModule │ │
|
|
│ │ IEngine (DebugEngine) │ │
|
|
│ │ IModuleSystem (Sequential) │ │
|
|
│ └────────────────────────────────┘ │
|
|
│ │
|
|
│ Modules (DLL/SO): │
|
|
│ ├── monitoring.dll │
|
|
│ ├── scheduler.dll │
|
|
│ ├── ai.dll │
|
|
│ ├── voice.dll │
|
|
│ ├── storage.dll (SQLite) │
|
|
│ └── ui-imgui.dll │
|
|
└─────────────┬───────────────────────┘
|
|
│ HTTPS
|
|
┌─────────────▼───────────────────────┐
|
|
│ Claude Haiku 4.5 API │
|
|
│ (Seul service externe) │
|
|
└─────────────────────────────────────┘
|
|
```
|
|
|
|
### Justifications par Critère
|
|
|
|
#### 1. **Réutilisation de Code**
|
|
✅ **WarFactory engine réutilisé à 100%**
|
|
- IModule, IEngine, IModuleSystem, IIO déjà implémentés
|
|
- Hot-reload system déjà testé et fonctionnel (0.4ms)
|
|
- Build system CMake déjà configuré
|
|
- Configuration IDataTree/IDataNode déjà fait
|
|
- **Économie : ~3-4 semaines de développement**
|
|
|
|
#### 2. **Types Stricts (Exigence forte)**
|
|
✅ **C++ natif avec headers stricts**
|
|
- Pas de "wildcode" JavaScript/Python
|
|
- Interfaces bien définies (IModule.h, IIO.h, etc.)
|
|
- Compilation time type checking
|
|
- Auto-completion IDE complète
|
|
|
|
#### 3. **Performance**
|
|
✅ **Performance native maximale**
|
|
- C++ compilé natif (vs interprété Python/JS)
|
|
- Win32 API direct (vs wrappers npm)
|
|
- Hot-reload 0.4ms (vs 5+ min rebuild monolithe)
|
|
- Latence zéro (tout local, pas de réseau)
|
|
|
|
#### 4. **Développement Rapide**
|
|
✅ **Itérations ultra-rapides**
|
|
- Hot-reload 0.4ms = feedback instantané
|
|
- Build autonome par module (`cmake .`)
|
|
- ImGui rapide à prototyper (vs React/Vue setup)
|
|
- Développement parallèle modules
|
|
|
|
#### 5. **Cross-Platform**
|
|
✅ **Windows/Mac/Linux supportés**
|
|
- DLL/SO loader fonctionne sur tous OS
|
|
- Win32 API (Windows), AppKit (Mac), X11/Wayland (Linux)
|
|
- CMake cross-compilation facile
|
|
- ImGui natif sur tous OS
|
|
|
|
#### 6. **Privacy & Coût**
|
|
✅ **Tout local, $0 hosting**
|
|
- Données jamais uploadées (sauf appels Claude API)
|
|
- SQLite local (pas de PostgreSQL distant)
|
|
- Pas de serveur backend à maintenir
|
|
- Offline-first (fonctionne sans internet sauf IA)
|
|
|
|
#### 7. **Simplicité Déploiement**
|
|
✅ **Copier-coller dossier = fonctionne**
|
|
```
|
|
aissia/
|
|
├── aissia-core.exe
|
|
├── modules/*.dll
|
|
├── gameconfig.json
|
|
└── aissia.db
|
|
```
|
|
- Pas de Docker, K8s, services cloud
|
|
- Pas d'installation complexe
|
|
- Portable (USB key = fonctionne)
|
|
|
|
#### 8. **Évolutivité Future**
|
|
✅ **Architecture permet évolution progressive**
|
|
|
|
**Phase 1 (MVP - 2 semaines)** :
|
|
- ImGui UI intégrée
|
|
- Modules core (monitoring, scheduler, AI, voice, storage)
|
|
- Local-only, offline-first
|
|
- Windows primary target
|
|
|
|
**Phase 2 (Production - 4 semaines)** :
|
|
- Electron/Tauri UI (si besoin UX premium)
|
|
- WebSocket IPC (ui-websocket.dll module)
|
|
- Mac/Linux support complet
|
|
- Configuration avancée
|
|
|
|
**Phase 3 (Extension - 8+ semaines)** :
|
|
- Sync cloud optionnel (sync-service.dll module)
|
|
- Mobile app (Flutter/React Native via NetworkIO)
|
|
- Analytics avancées
|
|
- Intégrations tierces (calendrier, etc.)
|
|
|
|
---
|
|
|
|
## Alternatives Non Retenues - Raisons Détaillées
|
|
|
|
### Pourquoi Pas Node.js ?
|
|
1. ❌ Pas de types stricts natifs (TypeScript aide mais runtime JS)
|
|
2. ❌ "Wildcode" (moins structuré que C++)
|
|
3. ❌ Performance inférieure (interprété vs compilé)
|
|
4. ❌ Pas de réutilisation WarFactory
|
|
5. ❌ Monitoring apps limité (dépend packages npm)
|
|
|
|
**Conclusion** : Gain rapidité dev annulé par manque types + performance
|
|
|
|
---
|
|
|
|
### Pourquoi Pas Rust ?
|
|
1. ❌ Pas de réutilisation WarFactory (écrit en C++)
|
|
2. ❌ Courbe apprentissage ownership/lifetimes
|
|
3. ❌ FFI C++ ↔ Rust complexe si besoin interop
|
|
4. ⚠️ Compilation lente (vs C++)
|
|
|
|
**Conclusion** : Sécurité mémoire intéressante mais pas prioritaire vs réutilisation
|
|
|
|
---
|
|
|
|
### Pourquoi Pas Flutter/Electron UI ?
|
|
1. ⚠️ Complexité accrue (2 stacks : C++ + JS/Dart)
|
|
2. ⚠️ IPC WebSocket latency (vs IntraIO)
|
|
3. ⚠️ Build lourd (150MB Electron bundle)
|
|
4. ⚠️ Maintenance frontend séparé
|
|
|
|
**Conclusion** : Meilleure UX mais pas critique MVP. **Phase 2 si besoin.**
|
|
|
|
---
|
|
|
|
### Pourquoi Pas Cloud Backend ?
|
|
1. ❌ Coût hosting ($10-50/mois minimum)
|
|
2. ❌ Privacy concerns (données uploadées)
|
|
3. ❌ Dépendance internet (vs offline-first)
|
|
4. ❌ Complexité déploiement (Docker, scaling)
|
|
5. ❌ RGPD compliance nécessaire
|
|
|
|
**Conclusion** : Over-engineering pour usage personnel. **Phase 3 optionnel.**
|
|
|
|
---
|
|
|
|
### Pourquoi Pas Microservices ?
|
|
1. ❌ Over-engineering extrême pour usage solo
|
|
2. ❌ Complexité orchestration (5+ processus)
|
|
3. ❌ Latence réseau inter-services
|
|
4. ❌ Debugging distribué difficile
|
|
|
|
**Conclusion** : Overkill total. Architecture modulaire DLL/SO suffit amplement.
|
|
|
|
---
|
|
|
|
## Risques et Mitigations
|
|
|
|
### Risque 1 : Complexité C++ pour Nouveaux Modules
|
|
**Probabilité** : Moyenne
|
|
**Impact** : Moyen
|
|
|
|
**Mitigation** :
|
|
- Templates modules prêts (MonitoringModule.h, etc.)
|
|
- Documentation WarFactory complète (`docs/`)
|
|
- Interfaces simples (IModule = 4 méthodes)
|
|
- Hot-reload = feedback rapide (pas de frustration build)
|
|
|
|
---
|
|
|
|
### Risque 2 : ImGui UI Pas Assez Moderne
|
|
**Probabilité** : Élevée
|
|
**Impact** : Faible (MVP) → Moyen (Production)
|
|
|
|
**Mitigation** :
|
|
- MVP = dogfooding personnel (UI simple suffit)
|
|
- Phase 2 = Electron/Tauri si besoin UX premium
|
|
- Architecture modulaire = swap ui-imgui.dll → ui-electron.dll facile
|
|
|
|
---
|
|
|
|
### Risque 3 : Pas de Mobile (Android/iOS)
|
|
**Probabilité** : Faible (pas priorité MVP)
|
|
**Impact** : Moyen (si commercialisation)
|
|
|
|
**Mitigation** :
|
|
- Phase 3 = NetworkIO + Flutter/React Native mobile app
|
|
- Backend C++ reste inchangé (modules via NetworkIO)
|
|
- Desktop = priorité usage personnel
|
|
|
|
---
|
|
|
|
### Risque 4 : Debugging Segfaults C++
|
|
**Probabilité** : Moyenne
|
|
**Impact** : Moyen
|
|
|
|
**Mitigation** :
|
|
- AddressSanitizer activé (détection immédiate bugs mémoire)
|
|
- Modules isolés (crash module ≠ crash app)
|
|
- Hot-reload = retry rapide après fix
|
|
- GDB integration (stack traces précises)
|
|
|
|
---
|
|
|
|
## Métriques de Succès Architecture
|
|
|
|
### Vitesse Développement
|
|
- ✅ **Hot-reload < 1s** : 0.4ms mesuré WarFactory
|
|
- ✅ **Build module < 5s** : `cmake . && make` autonome
|
|
- ✅ **Iteration cycle < 10s** : Edit → Build → Test
|
|
|
|
### Performance Runtime
|
|
- ✅ **App startup < 2s** : Engine + modules load
|
|
- ✅ **UI latency < 100ms** : ImGui render 60fps
|
|
- ✅ **Monitoring overhead < 1% CPU** : Background tracking
|
|
|
|
### Maintenabilité
|
|
- ✅ **Modules indépendants** : Build autonome `cmake .`
|
|
- ✅ **Tests isolés** : Chaque module testable seul
|
|
- ✅ **Documentation complète** : `aissia/docs/` (copié WarFactory)
|
|
|
|
---
|
|
|
|
## Conclusion
|
|
|
|
**Décision Finale Validée** : **C++ Modulaire (WarFactory) + ImGui + Local-Only**
|
|
|
|
**Facteurs Décisifs :**
|
|
1. ✅ **Réutilisation WarFactory** = économie 3-4 semaines
|
|
2. ✅ **Types stricts C++** = exigence satisfaite
|
|
3. ✅ **Hot-reload 0.4ms** = productivité maximale
|
|
4. ✅ **$0 coût hosting** = viable long-terme
|
|
5. ✅ **Privacy par design** = offline-first
|
|
6. ✅ **Architecture éprouvée** = risque réduit
|
|
|
|
**Next Steps** :
|
|
1. Créer structure modules/ (MonitoringModule, SchedulerModule, etc.)
|
|
2. Implémenter MonitoringModule.dll (Win32 API tracking)
|
|
3. Implémenter SchedulerModule.dll (planning logic)
|
|
4. Intégrer Claude Haiku API (AIModule.dll)
|
|
5. Implémenter VoiceModule.dll (SAPI TTS + Whisper STT)
|
|
6. Créer UI ImGui basique (ui-imgui.dll)
|
|
|
|
**Timeline Estimé MVP** : 2 semaines avec hot-reload architecture
|
|
|
|
---
|
|
|
|
**Document Version:** 1.0
|
|
**Date:** 27 octobre 2025
|
|
**Status:** ✅ Décision Validée
|