Unified iOS app + Python backend for workout videos, local gyms, and an AI coach.
AITrainer/: iOS app (SwiftUI)agent/: unified FastAPI backend (videos + gyms + coach) and agent logicdata/: SQLite data used by the agentsources/: RAG source documents
- Python 3.12+
- Xcode (for iOS app)
Create a .env in the repo root (or agent/.env). See env.example.
Required:
OPENAI_API_KEY(AI coach)GEMINI_API_KEY(meal photo scan)GEMINI_MODEL(optional override; auto-detected if empty)YOUTUBE_API_KEYGOOGLE_PLACES_API_KEYTAVILY_API_KEY(online recipe search)
Optional:
REDIS_URLorUPSTASH_REDIS_REST_URL+UPSTASH_REDIS_REST_TOKEN
From the repo root:
cd agent
./start.shBackend will be available at:
http://localhost:8000/healthhttp://localhost:8000/docs
From the repo root:
python -m agent.cliOpen AITrainer.xcodeproj in Xcode and run on a simulator.
The app calls the backend here:
AITrainer/Models/Services/YouTubeService.swiftAITrainer/Models/Services/GymFinderService.swiftAITrainer/Models/Services/AICoachService.swiftAITrainer/Models/Services/FoodScanService.swift(meal photo analysis)AITrainer/Models/Services/RecipeImageService.swift(AI recipe images)
If you change the backend host, update the baseURL in those files.
Backend host is centrally configured via Config/Info.plist (BackendBaseURL) and AITrainer/Models/Services/BackendConfig.swift.
- The AI coach endpoints are served by the agent logic via FastAPI:
POST /coach/chatPOST /coach/feedback
- RAG index is loaded from
data/faiss_indexwhen present.