feat: homelab deployment - NPM + IONOS DNS + monitoring + NAS backup

- Restructured docker-compose for Nginx Proxy Manager (no custom nginx)
- Added domain wordly.art configuration
- Added Prometheus + Grafana monitoring stack with pre-configured dashboards
- Added PostgreSQL backup script to NAS (daily/weekly/monthly rotation)
- Added alert rules for backend, system, and Docker metrics
- Updated deployment guide for NPM + IONOS DNS homelab setup
- Added marketing plan document
- PDF translator and watermark support
- Enhanced middleware, routes, and translator modules

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-10 11:43:28 +02:00
parent 16ac7ca2b9
commit ce8e150a61
110 changed files with 6935 additions and 4301 deletions

View File

@@ -0,0 +1,168 @@
{
"annotations": { "list": [] },
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 1,
"id": null,
"links": [],
"panels": [
{
"title": "CPU Usage (%)",
"type": "timeseries",
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 0 },
"targets": [
{
"expr": "100 - (avg by(instance) (rate(node_cpu_seconds_total{mode=\"idle\"}[5m])) * 100)",
"legendFormat": "{{instance}}"
}
],
"fieldConfig": {
"defaults": {
"color": { "mode": "palette-classic" },
"custom": { "lineWidth": 2, "fillOpacity": 20 },
"unit": "percent",
"max": 100
}
}
},
{
"title": "RAM Usage",
"type": "timeseries",
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 0 },
"targets": [
{
"expr": "(node_memory_MemTotal_bytes - node_memory_MemAvailable_bytes) / node_memory_MemTotal_bytes * 100",
"legendFormat": "Used %"
},
{
"expr": "node_memory_Buffers_bytes / node_memory_MemTotal_bytes * 100",
"legendFormat": "Buffers %"
},
{
"expr": "node_memory_Cached_bytes / node_memory_MemTotal_bytes * 100",
"legendFormat": "Cache %"
}
],
"fieldConfig": {
"defaults": {
"color": { "mode": "palette-classic" },
"custom": { "lineWidth": 2, "fillOpacity": 15 },
"unit": "percent",
"max": 100
}
}
},
{
"title": "Disk Space",
"type": "gauge",
"gridPos": { "h": 6, "w": 6, "x": 0, "y": 8 },
"targets": [
{
"expr": "(1 - node_filesystem_avail_bytes{mountpoint=\"/\"} / node_filesystem_size_bytes{mountpoint=\"/\"}) * 100",
"legendFormat": "Used"
}
],
"fieldConfig": {
"defaults": {
"unit": "percent",
"min": 0,
"max": 100,
"thresholds": {
"steps": [
{ "color": "green", "value": null },
{ "color": "yellow", "value": 70 },
{ "color": "red", "value": 90 }
]
}
}
}
},
{
"title": "Network I/O",
"type": "timeseries",
"gridPos": { "h": 6, "w": 10, "x": 6, "y": 8 },
"targets": [
{
"expr": "rate(node_network_receive_bytes_total{device!=\"lo\"}[5m]) * 8",
"legendFormat": "In {{device}}"
},
{
"expr": "-rate(node_network_transmit_bytes_total{device!=\"lo\"}[5m]) * 8",
"legendFormat": "Out {{device}}"
}
],
"fieldConfig": {
"defaults": {
"color": { "mode": "palette-classic" },
"custom": { "lineWidth": 2 },
"unit": "bps"
}
}
},
{
"title": "Container Memory",
"type": "barchart",
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 14 },
"targets": [
{
"expr": "container_memory_usage_bytes{name=~\"wordly.*|translate.*\"}",
"legendFormat": "{{name}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "bytes"
}
}
},
{
"title": "Container CPU %",
"type": "barchart",
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 14 },
"targets": [
{
"expr": "rate(container_cpu_usage_seconds_total{name=~\"wordly.*|translate.*\"}[5m]) * 100",
"legendFormat": "{{name}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "percent"
}
}
},
{
"title": "Service Status (Up/Down)",
"type": "stat",
"gridPos": { "h": 4, "w": 24, "x": 0, "y": 22 },
"targets": [
{
"expr": "up",
"legendFormat": "{{job}}"
}
],
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"thresholds": {
"steps": [
{ "color": "red", "value": null },
{ "color": "green", "value": 1 }
]
},
"mappings": [
{ "type": "value", "options": { "0": { "text": "DOWN", "color": "red" }, "1": { "text": "UP", "color": "green" } } }
]
}
}
}
],
"refresh": "30s",
"schemaVersion": 39,
"tags": ["wordly", "infrastructure"],
"time": { "from": "now-1h", "to": "now" },
"timezone": "Europe/Paris",
"title": "Wordly - Infrastructure",
"uid": "wordly-infra",
"version": 1
}

View File

@@ -0,0 +1,206 @@
{
"annotations": {
"list": []
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 1,
"id": null,
"links": [],
"liveNow": false,
"panels": [
{
"title": "Traductions (dernières 24h)",
"type": "stat",
"gridPos": { "h": 4, "w": 6, "x": 0, "y": 0 },
"targets": [
{
"expr": "sum(increase(translation_total[24h]))",
"legendFormat": "Total"
}
],
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"thresholds": {
"steps": [
{ "color": "blue", "value": null },
{ "color": "green", "value": 10 },
{ "color": "orange", "value": 50 }
]
},
"unit": "none"
}
}
},
{
"title": "Temps moyen (secondes)",
"type": "stat",
"gridPos": { "h": 4, "w": 6, "x": 6, "y": 0 },
"targets": [
{
"expr": "avg(rate(translation_duration_seconds_sum[5m]) / rate(translation_duration_seconds_count[5m]))",
"legendFormat": "Avg"
}
],
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"thresholds": {
"steps": [
{ "color": "green", "value": null },
{ "color": "yellow", "value": 30 },
{ "color": "red", "value": 60 }
]
},
"unit": "s"
}
}
},
{
"title": "Taux d'erreur (%)",
"type": "stat",
"gridPos": { "h": 4, "w": 6, "x": 12, "y": 0 },
"targets": [
{
"expr": "sum(rate(http_requests_total{status=~\"5..\"}[5m])) / sum(rate(http_requests_total[5m])) * 100",
"legendFormat": "Error %"
}
],
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"thresholds": {
"steps": [
{ "color": "green", "value": null },
{ "color": "yellow", "value": 1 },
{ "color": "red", "value": 5 }
]
},
"unit": "percent",
"max": 100
}
}
},
{
"title": "Utilisateurs actifs (1h)",
"type": "stat",
"gridPos": { "h": 4, "w": 6, "x": 18, "y": 0 },
"targets": [
{
"expr": "count(increase(http_requests_total{path!=\"/health\",path!=\"/metrics\"}[1h]) > 0)",
"legendFormat": "Active"
}
],
"fieldConfig": {
"defaults": {
"color": { "mode": "thresholds" },
"thresholds": {
"steps": [
{ "color": "blue", "value": null },
{ "color": "green", "value": 5 }
]
}
}
}
},
{
"title": "Requetes par minute (par endpoint)",
"type": "timeseries",
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 4 },
"targets": [
{
"expr": "sum by (path) (rate(http_requests_total[5m]) * 60)",
"legendFormat": "{{path}}"
}
],
"fieldConfig": {
"defaults": {
"color": { "mode": "palette-classic" },
"custom": {
"lineWidth": 2,
"fillOpacity": 10
},
"unit": "req/min"
}
}
},
{
"title": "Temps de traduction (percentiles)",
"type": "timeseries",
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 4 },
"targets": [
{
"expr": "histogram_quantile(0.5, sum(rate(translation_duration_seconds_bucket[5m])) by (le))",
"legendFormat": "p50"
},
{
"expr": "histogram_quantile(0.95, sum(rate(translation_duration_seconds_bucket[5m])) by (le))",
"legendFormat": "p95"
},
{
"expr": "histogram_quantile(0.99, sum(rate(translation_duration_seconds_bucket[5m])) by (le))",
"legendFormat": "p99"
}
],
"fieldConfig": {
"defaults": {
"color": { "mode": "palette-classic" },
"custom": {
"lineWidth": 2,
"fillOpacity": 5
},
"unit": "s"
}
}
},
{
"title": "Traductions par provider",
"type": "piechart",
"gridPos": { "h": 8, "w": 8, "x": 0, "y": 12 },
"targets": [
{
"expr": "sum by (provider) (increase(translation_total[24h]))",
"legendFormat": "{{provider}}"
}
]
},
{
"title": "Taille des fichiers uploades",
"type": "histogram",
"gridPos": { "h": 8, "w": 8, "x": 8, "y": 12 },
"targets": [
{
"expr": "sum by (le) (increase(file_size_bytes_bucket[24h]))",
"legendFormat": "{{le}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "bytes"
}
}
},
{
"title": "Fichiers par type",
"type": "piechart",
"gridPos": { "h": 8, "w": 8, "x": 16, "y": 12 },
"targets": [
{
"expr": "sum by (file_type) (increase(translation_total[24h]))",
"legendFormat": "{{file_type}}"
}
]
}
],
"refresh": "30s",
"schemaVersion": 39,
"tags": ["wordly", "application"],
"templating": { "list": [] },
"time": { "from": "now-24h", "to": "now" },
"timepicker": {},
"timezone": "Europe/Paris",
"title": "Wordly - Application",
"uid": "wordly-app",
"version": 1
}

View File

@@ -0,0 +1,13 @@
apiVersion: 1
providers:
- name: 'Wordly Dashboards'
orgId: 1
folder: 'Wordly'
type: file
disableDeletion: false
editable: true
updateIntervalSeconds: 30
options:
path: /var/lib/grafana/dashboards
foldersFromFilesStructure: true

View File

@@ -0,0 +1,12 @@
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
access: proxy
url: http://wordly-prometheus:9090
isDefault: true
editable: false
jsonData:
timeInterval: '15s'
httpMethod: POST