Phase 1: Database Migration Complete Created migration infrastructure: - backend/migrations/v9c_subscription_system.sql (11 new tables) - backend/apply_v9c_migration.py (auto-migration runner) - Updated main.py startup event to apply migration New tables (Feature-Registry Pattern): 1. app_settings - Global configuration 2. tiers - Subscription tiers (free/basic/premium/selfhosted) 3. features - Feature registry (11 limitable features) 4. tier_limits - Tier x Feature matrix (44 initial limits) 5. user_feature_restrictions - Individual user overrides 6. user_feature_usage - Usage tracking with reset periods 7. coupons - Coupon management (single-use, period, Wellpass) 8. coupon_redemptions - Redemption history 9. access_grants - Time-limited access with pause/resume logic 10. user_activity_log - Activity tracking (JSONB details) 11. user_stats - Aggregated statistics Extended profiles table: - tier, trial_ends_at, email_verified, email_verify_token - invited_by, invitation_token Initial data inserted: - 4 tiers (free/basic/premium/selfhosted) - 11 features (weight, circumference, caliper, nutrition, activity, photos, ai_calls, ai_pipeline, export_*) - 44 tier_limits (complete Tier x Feature matrix) - App settings (trial duration, self-registration config) Migration auto-runs on container startup (similar to SQLite→PostgreSQL). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .gitea/workflows | ||
| backend | ||
| frontend | ||
| nginx | ||
| .env.example | ||
| .gitignore | ||
| CLAUDE.md | ||
| docker-compose.dev-env.yml | ||
| docker-compose.dev.yml | ||
| docker-compose.yml | ||
| README.md | ||
| SETUP.md | ||
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) |