πŸ—οΈ PC services hub β€” overview

All services na PC ai-brain (Tailscale 100.109.129.16). Hub Linux primary (post-migration), Windows secondary dla Adobe + drukarki.

πŸ“‘ Endpoints (Tailscale + Funnel)

ServiceLocal URLTailscale URLPublic (Funnel)
pose_server http://localhost:8001 http://100.109.129.16:8001 https://desktop-e7102ja.tailc2b192.ts.net
dashboard http://localhost:8080 http://100.109.129.16:8080 via path-mount /webhook/github
blender http://localhost:8002 http://100.109.129.16:8002 β€”
LM Studio http://localhost:1234 β€” β€”

πŸ” Auth

X-Pose-Auth (Bearer token)
pose_server global middleware (v20+), wszystkie endpointy poza /health
Token: POSE_UPLOAD_TOKEN env (User scope). Format: 32-byte base64url. Wymagany dla:
POST /upload-recording Β· GET /queue-status Β· POST /retry-failed Β· POST /pose Β· POST /pose-batch Β· GET /frame-skeleton/{filename} Β· GET /version
GitHub Webhook HMAC
dashboard /webhook/github (publicznie wystawiony via Funnel)
HMAC SHA256 z GH_WEBHOOK_SECRET env. GitHub Settings β†’ Webhooks β†’ Secret matches.

🎯 Core services

pose_server core
FastAPI port 8001 Β· CUDA RTX 3060 12GB Β· venv .venv

YOLO11x-pose ensemble (z opcjonalnym DWPose Wholebody fallback). Spawn analyze_recording.py per uploaded workout. Sweep nightly task (3 AM systemd timer) re-analyzes invalid sidecars. Webhook self-update przez dashboard.

Key endpoints:
VL pipeline: Gemini 2.5 Flash (PRIMARY cloud, multi-key round-robin) β†’ qwen2.5-vl-7b (FALLBACK local LM Studio)
dashboard core
FastAPI port 8080 Β· UI dla services + analyses

Health probes per service, restart triggers, GitHub webhook receiver, live progress widget dla pose_server analyses. Migration page /migration z live status.

UI routes: / Β· /recordings Β· /sessions Β· /migration Β· /hosts Β· /docs-page
blender render
FastAPI port 8002 Β· D:\BlenderLauncher\

Headless Blender render queue. Default 4.5.8 LTS, version manager dla rΓ³ΕΌnych Blender installs.

LM Studio VL
GUI app port 1234 Β· qwen2.5-vl-7b GGUF

Local VL inference dla qwen2.5-vl-7b. Fallback gdy Gemini cloud unavailable. Manual start via tray icon (lub systemctl --user po Linux migration).

☁️ Cloud integrations

Gemini 2.5 Flash cloud PRIMARY
api.google.com/genai Β· 3 keys round-robin Β· free tier 15 RPM

VL inference dla form analysis. analyze_recording.py tries Gemini first, falls back do qwen2.5-vl-7b on 429 quota / network error / parse fail.

Google Drive backup backup
rclone gdrive: remote Β· OAuth Β· personal Google One

Post-analyze auto-push workout bundle (video.mov + analysis.json + ios_skeleton.json + thumbnails) do gdrive:health-workouts/{stem}/. Zero marginal cost (Bartek's existing Google One subscription).

Supabase claude_handoff coordination
api.supabase.com Β· Management API Β· PAT auth

Cross-instance Claude coordination (hub-Claude ↔ iOS-Claude ↔ Bartek). Table claude_handoff w project xctrcwunonuggrgnlggw. Scripts: scripts/handoff.ps1 + scripts/sb.ps1.

Tailscale VPN
Tailnet desktop-e7102ja.tailc2b192.ts.net Β· 100.109.129.16

Mesh VPN dla hub ↔ iPhone ↔ Mac ↔ klient PC. Funnel exposes pose_server :8001 publicly via HTTPS dla iPhone mobile data uploads (bypass DERP relay).

πŸ›‘οΈ Watchdog

pc-services-watchdog
Windows scheduled task (every 5 min) Β· β†’ systemd timer post-Linux

Probe pose_server :8001/health + dashboard :8080/health. Down β†’ Start-ScheduledTask (Windows) lub systemctl restart (Linux). 30s timeout + 3-strike debounce eliminuje false-positive restart pod load.

πŸ“… Scheduled jobs

JobCronCo
pc-services-watchdogevery 5 minHealth probe + auto-restart
pc-services-sweep-nightly03:00 dailyPOST /retry-failed (reanalyze invalid sidecars)
pc-services-backup-blender-projects04:00 dailyBlender projects backup
pc-services-cleanup-blender-jobsSunday 03:30Old Blender render jobs cleanup
pc-services-renew-certSunday 02:00Tailscale cert renewal (Funnel)

πŸ“Š Data flow

iPhone HealthIOS                         pose_server :8001
─────────────────                       ─────────────────────
record workout (.mov) ─┐
                       β”‚  X-Pose-Auth header
                       β–Ό
                 Tailscale Funnel HTTPS
                 desktop-e7102ja.tailc2b192.ts.net
                       β”‚
                       β–Ό
                 POST /upload-recording ─→ D:\health-recordings\
                       β”‚                      ↓
                       β”‚                  spawn analyze_recording.py
                       β”‚                      ↓
                       β”‚                  ffmpeg extract 12 frames
                       β”‚                      ↓
                       β”‚                  β”Œβ”€ Gemini 2.5 Flash (cloud) ─┐
                       β”‚                  β”‚  (primary VL form-check)   β”‚
                       β”‚                  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚                            β”‚ on 429/error
                       β”‚                            β–Ό
                       β”‚                  qwen2.5-vl-7b (LM Studio fallback)
                       β”‚                      ↓
                       β”‚                  motion detection (YOLO pose-batch)
                       β”‚                      ↓
                       β”‚                  per-rep VL + kinematics
                       β”‚                      ↓
                       β”‚                  sidecar.analysis.json (v22 schema)
                       β”‚                      ↓
                       β”‚                  Supabase form_checks upsert ─→ iOS Coach
                       β”‚                  rclone push β†’ gdrive:health-workouts/{stem}/
                       β”‚
                       β–Ό poll /analyze-status
                 iOS shows verdict + per_rep + drill_recommendations