WaouW est une application web PHP traditionnelle permettant de déployer des hébergements web (WordPress, PrestaShop, Joomla, Nextcloud) sur Raspberry Pi. L'architecture actuelle présente plusieurs défis techniques.
graph TB
subgraph "Interface Web"
UI[Interface PHP/Bootstrap<br/>waouw_int/]
Auth[Authentification]
Dashboard[Dashboard]
end
subgraph "Provisioning"
Scripts[Scripts Bash<br/>configs/]
CMS[cms_install.sh]
VHost[vhost.sh]
Check[check_vhost.sh]
end
subgraph "Applications"
Apache[Apache + VirtualHosts]
MySQL[MySQL/MariaDB]
Apps[WordPress/Joomla/PrestaShop]
PMA[phpMyAdmin]
end
subgraph "Sauvegarde"
ScriptsSauv[Scripts par OS<br/>scpt/]
SauvLinux[Sauvegarde_sur_Linux.sh]
SauvWin[Scripts Windows]
SauvMac[Scripts macOS]
end
subgraph "Modules"
Presence[waouw-presence]
Security[waouw-securite]
Shell[waouw-shell]
end
UI --> Scripts
Scripts --> Apache
Scripts --> MySQL
UI --> ScriptsSauv
Apache --> Apps
MySQL --> Apps
waouw_int/)configs/)scpt/)waouw_apps/)cfg.php (ligne 12, 19)graph TB
subgraph "Frontend"
React[React + Tailwind<br/>UI/]
Nginx[Nginx Static]
end
subgraph "API Layer"
FastAPI[FastAPI Backend<br/>BACKEND/]
Auth[JWT Auth]
Jobs[Background Jobs]
end
subgraph "Orchestration"
Traefik[Traefik Proxy<br/>Auto-TLS]
Docker[Docker Compose]
end
subgraph "Data"
Redis[Redis Cache]
PostgreSQL[PostgreSQL Main]
MariaDB[MariaDB per site]
end
subgraph "Applications isolées"
WP[WordPress Container]
PS[PrestaShop Container]
JM[Joomla Container]
NC[Nextcloud Container]
end
subgraph "Device Management"
Agent[Device Agent<br/>DEVICE_AGENT/]
MQTT[Mosquitto MQTT]
end
subgraph "Mirroring"
Lsyncd[lsyncd + rsync]
Rclone[rclone S3/SFTP]
end
React --> FastAPI
FastAPI --> Docker
Traefik --> WP
Traefik --> PS
Traefik --> JM
Traefik --> NC
Agent --> MQTT
Agent --> FastAPI
Lsyncd --> FastAPI
sequenceDiagram
participant U as User
participant API as FastAPI
participant D as Docker
participant T as Traefik
participant DB as MariaDB
U->>API: POST /sites {domain, cms: "wordpress"}
API->>API: Validate domain
API->>DB: Create database
API->>D: Deploy WordPress container
API->>T: Configure routing
API->>API: Generate TLS cert
API->>U: Site ready (200)
sequenceDiagram
participant A as Device Agent
participant M as MQTT/API
participant DB as Database
participant UI as Frontend
loop Every 30s
A->>A: Collect metrics
A->>M: Publish heartbeat
M->>DB: Store metrics
DB->>UI: Real-time update
end
# .env.example
DATABASE_URL=postgresql://user:pass@db:5432/waouw
JWT_SECRET_KEY=generate_with_openssl
TRAEFIK_ACME_EMAIL=admin@domain.com
DEVICE_HMAC_SECRET=shared_secret_for_agents
# docker-compose.yml extract
networks:
traefik:
external: true
backend:
internal: true
site_wordpress_com:
internal: true
# Dockerfile example
RUN adduser --disabled-password --gecos '' appuser
USER appuser
| Critère | Actuel | Cible |
|---|---|---|
| Langages | PHP + Bash | Python + TypeScript |
| Frontend | jQuery/Bootstrap | React/Tailwind |
| API | Aucune | REST FastAPI |
| Isolation | Aucune | Docker/systemd |
| TLS | Manuel/Let's Encrypt | Auto Traefik |
| Secrets | Hard-codés | .env + secrets |
| Tests | Aucun | Automatisés |
| Monitoring | Logs fichiers | Métriques/healthz |
| Mirroring | Scripts complexes | lsyncd/rclone |
| Device Mgmt | Fichier MAC | Agent heartbeat |
graph TB
subgraph "Raspberry Pi - WaouW v2.0 PLATFORM COMPLÈTE"
subgraph "Reverse Proxy"
T[Traefik<br/>:80,:443<br/>Auto-HTTPS]
end
subgraph "Core Services"
API[FastAPI Backend<br/>:8000]
UI[React UI<br/>:3000]
DB[(PostgreSQL<br/>:5432)]
CACHE[(Redis<br/>:6379)]
end
subgraph "Web Applications"
WP[WordPress<br/>Container]
PS[PrestaShop<br/>Container]
JM[Joomla<br/>Container]
NC[Nextcloud<br/>Container]
end
subgraph "Email Services"
ROUNDCUBE[Roundcube<br/>Webmail :8080]
POSTFIX[Postfix<br/>SMTP Server]
DOVECOT[Dovecot<br/>IMAP/POP3]
MAILADMIN[Email Admin<br/>:8081]
end
subgraph "System Management"
WEBMIN[Webmin<br/>:10000]
PHPMYADMIN[phpMyAdmin<br/>:8082]
AGENT[Device Agent<br/>Python Service]
end
subgraph "Security & VPN"
VPN[Waouw Présence<br/>OpenVPN Server]
F2B[Fail2Ban<br/>Security Monitor]
FIREWALL[UFW Firewall]
end
subgraph "Backup & Sync"
SYNC[Sync Service<br/>lsyncd/rsync]
BACKUP[Backup Manager<br/>Automated]
RESTORE[Restore Service]
end
subgraph "Monitoring & Logs"
LOGS[Log Manager<br/>Centralized]
METRICS[System Metrics<br/>Collector]
HEALTH[Health Checks]
end
end
subgraph "External"
USER[👤 End User]
CENTRAL[🌐 Central Server<br/>Authentication]
REMOTE[📡 Remote Backup]
MOBILE[📱 Mobile Access<br/>via VPN]
end
USER --> T
T --> UI
T --> API
T --> WP
T --> PS
T --> JM
T --> NC
T --> ROUNDCUBE
T --> WEBMIN
T --> PHPMYADMIN
T --> MAILADMIN
API --> DB
API --> CACHE
API --> AGENT
API --> LOGS
API --> METRICS
AGENT --> CENTRAL
SYNC --> REMOTE
VPN --> MOBILE
F2B --> FIREWALL
BACKUP --> RESTORE
| Service | Port | URL | Description |
|---|---|---|---|
| Interface WaouW | 443 | https://waouw.local |
Interface principale |
| Webmin | 10000 | https://waouw.local:10000 |
Admin système |
| Roundcube | 8080 | https://waouw.local:8080 |
Webmail |
| Email Admin | 8081 | https://waouw.local:8081 |
Gestion emails |
| phpMyAdmin | 8082 | https://waouw.local:8082 |
Admin BDD |
| Nextcloud | 443 | https://waouw.local/nextcloud |
Cloud personnel |
| Sync Interface | 7165 | https://waouw.local:7165 |
Synchronisation |
| VPN | 1194 | udp://waouw.local:1194 |
OpenVPN |
Architecture WaouW v2.0 - Raspberry Pi optimized Generated: $(date)