loopback-training-app
Health Uyari
- License — License: MIT
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Low visibility — Only 6 GitHub stars
Code Basarisiz
- rm -rf — Recursive force deletion command in AppStore/render.sh
Permissions Gecti
- Permissions — No dangerous permissions requested
Bu listing icin henuz AI raporu yok.
Loopback – a privacy-first running coach for iOS. Connects Apple Health to AI coaching through a self-hosted server you control: training plans, Apple Watch scheduling, and workout analysis.
Loopback – Running Coach (iOS)
A privacy-first training companion for iOS that connects Apple Health data to AI coaching. Manages the full workout lifecycle — plan creation, Apple Watch scheduling, execution tracking, and performance analysis — all through a self-hosted backend you control: the Loopback Server.
Join the beta on TestFlight · loopback.ardenlab.dev · Privacy · Support
Features
Training Plan Management
Displays your active training plan with phase tracking, completion progress, and workout details. Plans are created by your AI coach via MCP and automatically synced to the app.
- Plan overview card with current phase, week progress, and completion rate
- Tappable phase pills showing workouts per phase
- Completed workouts show actual metrics (distance, duration, pace) alongside the plan
Workout Scheduling & Tracking
Fetches planned workouts from your Training API and schedules them on Apple Watch via WorkoutKit:
- Structured workouts with warm-up, interval blocks, and cooldown
- Training goals (distance, time, energy, open)
- Training alerts for heart rate zones, pace, cadence, and power
- Auto-sync: new queued workouts are pulled automatically on app launch and foreground
- Queue lifecycle preserved (pending → synced → completed) for full traceability
Workout Extraction & Upload
Pulls detailed workout data from HealthKit and sends it to your Training API:
- GPS routes with altitude, speed, and course data
- Heart rate, cadence, power, speed, stride length, vertical oscillation, and ground contact time series
- Auto-computed 1km splits with elevation gain/loss and average metrics
- Structured activity segments from WorkoutKit compositions
- Workout events (pause, resume, lap, segment, marker)
- Plan workout linking: completed workouts matched to their originating plan by time proximity
- All workout types synced (running, cycling, strength, flexibility, yoga, HIIT, 30+ types)
- Background sync via HealthKit observers — workouts upload automatically after completion
Health Metrics Sync
Syncs daily health metrics directly from HealthKit to your Training API, giving your AI coach full context:
- Sleep duration and stages (awake, REM, core, deep)
- Resting heart rate, HRV (SDNN)
- Weight, body fat percentage, lean body mass
- VO2 Max, respiratory rate, SpO2
- Daily steps and active energy burned
- Syncs on app launch, foreground, and incrementally
Missed Workout Detection
Detects past-due incomplete workouts and collects structured feedback:
- Reason tracking (busy, tired, weather, soreness, motivation)
- Action selection (reschedule, adjust plan, skip)
- Feedback synced to Training API for LLM pattern analysis
Siri & Shortcuts
Seven actions, available by voice, in Spotlight and in the Shortcuts app:
- "What's my next run in Loopback": the next planned run and when, answered from the phone's copy of the watch schedule, so it works offline
- "How was my last run in Loopback": distance, time and pace of the latest run in Health
- "Do my next run today in Loopback": brings a later run forward to today, after confirming which one
- "Move my next run in Loopback": moves a run to another day in the next two weeks, asking for the day and the reason
- "Skip my next run in Loopback": skips a run, asking for the reason
- "I'm feeling better in Loopback": today's check-in on an illness or injury that is still going on
- "Log fuel on my last run in Loopback", or with a saved product's name in place of "fuel": adds a gel, drink or other saved product to the latest run's fuelling log
Requirements
- iOS 26+
- Xcode 26+, only if you build from source. The TestFlight beta installs without it.
- A self-hosted Loopback Server (the Training API)
Server Setup
Loopback connects to a self-hosted Loopback Server (FastAPI + PostgreSQL) that stores workouts, manages training plans, syncs health metrics, and provides an MCP server for AI integration.
git clone https://github.com/aderaaij/loopback-training-server.git
cd loopback-training-server
cp .env.example .env # set BOOTSTRAP_ADMIN_PASSWORD
docker compose up -d # pulls a prebuilt image; migrations run automatically
Open the dashboard at http://localhost:8001, sign in as admin, and create an account for each athlete — the app signs in with those credentials. The full quick start, multi-user walkthrough, and exposure options are in the server README. The API runs on port 8001 by default; expose it over HTTPS using Tailscale Funnel or a reverse proxy like Caddy/nginx.
Key Endpoints
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/workouts |
Accepts extracted workout JSON (upserts by workout ID) |
GET |
/api/workouts/queue |
Returns pending workout compositions for Apple Watch |
PATCH |
/api/workouts/queue/{id} |
Updates queue item status (synced, completed) |
PUT |
/api/workouts/inventory |
Syncs device workout inventory (completion status) |
POST |
/api/health/metrics |
Bulk upsert daily health metrics |
GET |
/api/plans?status=active |
Returns active training plan with phases and goals |
GET |
/api/plans/{id}/workouts |
Returns all workouts for a plan |
POST |
/api/workouts/feedback |
Records missed workout feedback |
All endpoints require a per-user bearer token, which the app mints via POST /api/auth/login when you sign in (tokens can also be created in the server dashboard under Settings → Create token).
MCP Integration
The Training API includes an MCP server at /mcp that lets AI assistants (like Claude) create training plans, queue workouts, query performance data, read health metrics, and analyze missed workout patterns. See the Loopback Server repository for setup instructions.
App Setup
The quickest way in is the TestFlight beta: install it, then sign in to your server. To build from source instead:
1. Clone the repository
git clone https://github.com/aderaaij/loopback-training-app.git
cd loopback-training-app
2. Open in Xcode
open OpenHealthSync.xcodeproj
3. Run
Build and run on a physical device. On first launch, connect the app to your server (accounts are created by the admin in the server dashboard). The quick way is a QR code: in the server's dashboard open Settings → Phone app → Show QR code, then tap Scan QR Code on the app's sign-in screen. Typing the server URL, username, and password works too, and pasting a pre-minted token remains as an advanced alternative. The app will request HealthKit permissions for workout and health metric access.
HealthKit is available in the simulator but has no data. For full testing, use a physical device with an Apple Watch.
Architecture
| Component | Role |
|---|---|
WorkoutScheduleManager |
Fetches planned workouts from the API, schedules on Apple Watch, manages queue lifecycle and plan data |
WorkoutManager |
Fetches workouts from HealthKit, deduplicates, coordinates extraction/upload, matches plans to completed workouts |
WorkoutExtractor |
Actor that concurrently extracts routes, time series, splits, activities, and events |
WorkoutAPIClient |
Actor-based HTTP client for all Training API endpoints |
HealthMetricsSyncer |
Actor that queries HealthKit for daily health metrics and syncs to Training API |
BackgroundSyncManager |
Registers HealthKit background delivery observers for automatic workout and metrics sync |
MissedWorkoutDetector |
Detects past-due incomplete workouts and manages feedback collection |
Key Patterns
@MainActorisolation for all UI-bound state managers- Swift actors for thread-safe async operations (
WorkoutExtractor,WorkoutAPIClient,HealthMetricsSyncer) async/awaitthroughout@AppStoragefor config persistence- HealthKit background delivery for automatic sync
- Auto-sync on launch and foreground with manual refresh fallback
License
MIT — same as the Loopback Server.
The name Loopback and the app icon are not covered by that licence. Fork
and build freely, but ship your fork under its own name and icon so nobody
mistakes it for the App Store build.
Yorumlar (0)
Yorum birakmak icin giris yap.
Yorum birakSonuc bulunamadi