Zum Hauptinhalt springen

Zurück zum Devlog

Sonntag, 25. Januar 2026

Feature

38 Commits

15 min Lesezeit

NutriPhi App, Prometheus Monitoring & Watchtower Auto-Deploy

AI-powered Nutrition Tracking App hinzugefügt, Prometheus Metriken für alle Backends, umfassende Grafana Dashboards, und Watchtower für automatisches Container-Deployment.

T

Till Schneider

Autor

Massiver Tag mit 38 Commits und Fokus auf neue App, Monitoring und Infrastructure:

  • NutriPhi - AI-powered Nutrition Tracking App mit Gemini
  • Prometheus Metriken - Für alle Backends implementiert
  • Grafana Dashboards - Umfassende Visualisierung und Alerting
  • Watchtower - Automatisches Docker-Image-Update auf Mac Mini
  • Presi & Storage - Apps aus Archiv wiederhergestellt

NutriPhi - AI Nutrition Tracking

Neue App für intelligentes Ernährungs-Tracking mit AI-Analyse.

Features

FeatureBeschreibung
Foto-AnalyseMahlzeit fotografieren, AI erkennt Zutaten
Nährwert-TrackingKalorien, Makros, Mikronährstoffe
Meal HistoryTägliche/wöchentliche Übersichten
AI SuggestionsErnährungsempfehlungen basierend auf Zielen

Tech Stack

┌─────────────────────────────────────────────────────┐
│                   NutriPhi                           │
├──────────────┬──────────────┬───────────────────────┤
│  Mobile      │    Web       │     Backend           │
│  (Expo)      │  (SvelteKit) │     (NestJS)          │
├──────────────┴──────────────┴───────────────────────┤
│                Google Gemini API                     │
│           (Vision + Text Analysis)                   │
└─────────────────────────────────────────────────────┘

Datenbankschema

-- Haupttabellen
CREATE TABLE meals (
  id UUID PRIMARY KEY,
  user_id UUID REFERENCES users(id),
  name TEXT,
  photo_url TEXT,
  eaten_at TIMESTAMP,
  calories INTEGER,
  protein DECIMAL,
  carbs DECIMAL,
  fat DECIMAL
);

CREATE TABLE daily_goals (
  id UUID PRIMARY KEY,
  user_id UUID REFERENCES users(id),
  calories_target INTEGER,
  protein_target DECIMAL,
  carbs_target DECIMAL,
  fat_target DECIMAL
);

Prometheus Metriken

Monitoring-Integration für alle NestJS Backends.

Implementation

// Jedes Backend hat jetzt:
import { PrometheusModule } from '@willsoto/nestjs-prometheus';

@Module({
	imports: [
		PrometheusModule.register({
			defaultMetrics: { enabled: true },
			path: '/metrics',
		}),
	],
})
export class AppModule {}

Metriken pro Backend

MetrikTypBeschreibung
http_requests_totalCounterGesamtzahl HTTP Requests
http_request_duration_secondsHistogramRequest-Dauer
http_requests_in_progressGaugeAktive Requests
nodejs_heap_size_bytesGaugeMemory Usage
active_users_totalGaugeEingeloggte User

Betroffene Backends

  • mana-core-auth (Port 3001)
  • chat-backend (Port 3002)
  • todo-backend (Port 3004)
  • clock-backend (Port 3005)
  • picture-backend (Port 3006)
  • zitare-backend (Port 3007)
  • presi-backend (Port 3008)
  • manadeck-backend (Port 3009)
  • contacts-backend (Port 3010)
  • calendar-backend (Port 3016)
  • nutriphi-backend (Port 3027)

Grafana Dashboards

Umfassende Visualisierung aller ManaCore Services.

Dashboard-Übersicht

┌─────────────────────────────────────────────────────┐
│              ManaCore Monitoring                     │
├─────────────────────────────────────────────────────┤
│  ┌─────────────┐ ┌─────────────┐ ┌─────────────┐   │
│  │  Overview   │ │  Services   │ │   Alerts    │   │
│  │  Dashboard  │ │  Dashboard  │ │  Dashboard  │   │
│  └─────────────┘ └─────────────┘ └─────────────┘   │
│                                                      │
│  ┌─────────────┐ ┌─────────────┐ ┌─────────────┐   │
│  │   CI/CD     │ │   Docker    │ │   User      │   │
│  │  Pipeline   │ │  Containers │ │  Statistics │   │
│  └─────────────┘ └─────────────┘ └─────────────┘   │
└─────────────────────────────────────────────────────┘

Alerting Rules

AlertConditionSeverity
ServiceDownUp == 0 for 1mCritical
HighErrorRateError rate > 5%Warning
HighLatencyP99 > 500msWarning
HighMemoryMemory > 80%Warning

User Statistics Panel

Neues Feature: User-Statistiken in Grafana anzeigen:

// Metrics endpoint includes active users
register.registerMetric(
	new Gauge({
		name: 'manacore_active_users',
		help: 'Number of active users per app',
		labelNames: ['app'],
	})
);

Watchtower Auto-Deploy

Automatisches Container-Update bei neuen Docker Images.

Konfiguration

# docker-compose.macmini.yml
watchtower:
  image: containrrr/watchtower
  volumes:
    - /var/run/docker.sock:/var/run/docker.sock
  environment:
    - WATCHTOWER_CLEANUP=true
    - WATCHTOWER_POLL_INTERVAL=300
    - WATCHTOWER_INCLUDE_STOPPED=true
  command: --interval 300

Workflow

┌──────────────┐     ┌──────────────┐     ┌──────────────┐
│   GitHub     │────>│   GitHub     │────>│   Docker     │
│   Push       │     │   Actions    │     │   Registry   │
└──────────────┘     └──────────────┘     └──────────────┘


┌──────────────┐     ┌──────────────┐     ┌──────────────┐
│   Service    │<────│  Watchtower  │<────│   Polling    │
│   Restart    │     │   Pull       │     │   (5 min)    │
└──────────────┘     └──────────────┘     └──────────────┘

Vorteile

  • Zero-Downtime: Rolling Updates
  • Automatisch: Keine manuellen Deployments nötig
  • Cleanup: Alte Images werden gelöscht

Presi & Storage Apps

Apps aus dem Archiv wiederhergestellt und deployment-ready gemacht.

Presi (Präsentations-Tool)

FeatureStatus
Slide Editor✅ Funktional
Export PDF✅ Funktional
Collaboration🚧 In Progress
Docker✅ Konfiguriert

Storage (Cloud Storage)

FeatureStatus
File Upload✅ Funktional
Folder Management✅ Funktional
Sharing🚧 In Progress
Docker✅ Konfiguriert

Deployment Config

# Neue Services in docker-compose.macmini.yml
presi-backend:
  image: ghcr.io/till-js/presi-backend:latest
  ports:
    - '3008:3008'
  healthcheck:
    test: ['CMD', 'curl', '-f', 'http://localhost:3008/health']

storage-web:
  image: ghcr.io/till-js/storage-web:latest
  ports:
    - '5185:5185'

Health Endpoints

Alle Web-Apps haben jetzt /health Endpoints für Monitoring.

Implementation

// +server.ts in jeder SvelteKit App
export async function GET() {
	return json({ status: 'healthy', timestamp: new Date().toISOString() });
}

Betroffene Apps

  • calendar-web, clock-web, contacts-web
  • chat-web, picture-web, zitare-web
  • todo-web, manadeck-web, manacore-web
  • presi-web, storage-web, nutriphi-web

CI/CD Verbesserungen

Docker Build Jobs für neue Apps hinzugefügt.

Neue Workflows

# .github/workflows/docker-presi.yml
# .github/workflows/docker-storage.yml
# .github/workflows/docker-nutriphi.yml

Health Check Fixes

Mehrere Health-Check-Pfade korrigiert:

ServiceVorherNachher
contacts-backend/api/health/health
mana-core-auth/api/health/health
todo-backend/api/health/health
calendarPort 3015Port 3016

Infrastructure Cleanup

Hetzner Staging-Infrastruktur entfernt zugunsten von Mac Mini Production.

Entfernte Dateien

scripts/hetzner/          # 15,581 Zeilen entfernt
docker-compose.staging.yml
scripts/staging-deploy.sh

Begründung

  • Mac Mini als einziger Produktionsserver
  • Keine Staging-Umgebung mehr nötig
  • Kosteneinsparung

Zusammenfassung

BereichCommitsHighlights
NutriPhi2Neue AI Nutrition App
Monitoring8Prometheus für alle Backends
Grafana3Dashboards & Alerting
Watchtower6Auto-Deploy eingerichtet
Apps Restore4Presi & Storage reaktiviert
Health Checks8Alle Apps mit /health
CI/CD5Docker Build Jobs
Fixes2Port & Path Korrekturen

Nächste Schritte

  1. Matrix Infrastructure für GDPR-konforme Bots
  2. NutriPhi Mobile App fertigstellen
  3. Alerting in Grafana aktivieren
  4. User Statistics Dashboard erweitern

Tags

#nutriphi #prometheus #grafana #watchtower #monitoring #docker #ci-cd #health-checks #presi #storage