KRITISCHE ARCHITEKTUR-ÄNDERUNG vor Phase 0b: Ermöglicht dynamische Goal Types ohne Code-Änderungen. Backend: - Migration 024: goal_type_definitions Tabelle → 8 existierende Typen als Seed-Data migriert → Flexible Schema: source_table, aggregation_method, calculation_formula → System vs. Custom Types (is_system flag) - goal_utils.py: Universal Value Fetcher → get_current_value_for_goal() ersetzt hardcoded if/elif chain → Unterstützt: latest, avg_7d, avg_30d, sum_30d, count_7d, etc. → Komplexe Formeln (lean_mass) via calculation_formula JSON - goals.py: CRUD API für Goal Type Definitions → GET /goals/goal-types (public) → POST/PUT/DELETE /goals/goal-types (admin-only) → Schutz für System-Types (nicht löschbar) - goals.py: _get_current_value_for_goal_type() delegiert zu Universal Fetcher Frontend: - api.js: 4 neue Funktionen (listGoalTypeDefinitions, create, update, delete) Dokumentation: - TODO_GOAL_SYSTEM.md: Phase 1.5 hinzugefügt, Roadmap aktualisiert Part 2/2 (nächster Commit): - Frontend: Dynamic Goal Types Dropdown - Admin UI: Goal Type Management Page - Testing Warum JETZT (vor Phase 0b)? - Phase 0b Platzhalter (120+) nutzen Goals für Score-Berechnungen - Flexible Goals → automatisch in Platzhaltern verfügbar - Später umbauen = Doppelarbeit (alle Platzhalter anpassen) Zukünftige Custom Goals möglich: - 🧘 Meditation (min/Tag) - 📅 Trainingshäufigkeit (x/Woche) - 📊 Planabweichung (%) - 🎯 Ritual-Adherence (%) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .gitea/workflows | ||
| backend | ||
| docs | ||
| frontend | ||
| nginx | ||
| .env.example | ||
| .gitignore | ||
| CLAUDE.md | ||
| docker-compose.dev-env.yml | ||
| docker-compose.dev.yml | ||
| docker-compose.yml | ||
| find-container.sh | ||
| README.md | ||
| SETUP.md | ||
| test-pipeline-api.sh | ||
| test-pipeline-backend.sh | ||
| test-unified-migration.sh | ||
BodyTrack
Körpervermessung & Körperfett Tracker – selbst gehostet, PWA-fähig.
Features
- Umfänge & Caliper-Messungen (4 Methoden) mit Verlauf
- Abgeleitete Werte: WHR, WHtR, FFMI, Magermasse
- Verlaufsdiagramme (Gewicht, KF%, Taille, …)
- KI-Interpretationen via Claude (Anthropic)
- Fortschrittsfotos mit Galerie
- PDF & CSV Export
- PWA – installierbar auf iPhone-Homescreen
- Alle Daten lokal auf deinem Server (SQLite)
Schnellstart
1. Voraussetzungen
# Docker & Docker Compose installieren (Ubuntu)
curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER
# Neu einloggen
2. Projekt klonen / kopieren
mkdir ~/bodytrack && cd ~/bodytrack
# Dateien hierher kopieren
3. API Key setzen
cp .env.example .env
nano .env
# ANTHROPIC_API_KEY=sk-ant-... eintragen
4. Starten
docker compose up -d
App läuft auf: http://DEINE-IP:3000
5. iPhone – Als App installieren
- Safari öffnen →
http://DEINE-IP:3000 - Teilen-Button (□↑) → „Zum Home-Bildschirm"
- BodyTrack erscheint als App-Icon
6. Von außen erreichbar (optional)
# Tailscale (einfachste Lösung – VPN zu deinem MiniPC)
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up
# Dann: http://TAILSCALE-IP:3000
Updates
docker compose pull
docker compose up -d --build
Backup
# Datenbank & Fotos sichern
docker run --rm -v bodytrack-data:/data -v bodytrack-photos:/photos \
-v $(pwd):/backup alpine \
tar czf /backup/bodytrack_backup_$(date +%Y%m%d).tar.gz /data /photos
Konfiguration
| Variable | Beschreibung | Standard |
|---|---|---|
ANTHROPIC_API_KEY |
Claude API Key (für KI-Analyse) | – |
Ports
| Port | Dienst |
|---|---|
| 3000 | Frontend (Nginx) |
| 8000 | Backend API (intern) |