Architecture: iOS (turbo-ios)

arch-ios Doc

architecture landscaping-assistant ios prediction-assistant
Turbo Native iOS wrapper pattern for Rails apps. Wraps web apps in a native iOS shell for App Store distribution. Used by both landscaping-assistant-ios and prediction-assistant-ios. ### Projects Using This Pattern - **landscaping-assistant-ios** — Original implementation. Wraps landscaping-assistant Rails app. - **prediction-assistant-ios** — Follows the same Turbo Native + XcodeGen + fastlane pattern established by landscaping-assistant-ios. Wraps prediction-assistant Rails app. ### Stack - **Framework:** turbo-ios (Hotwired, by 37signals) - **Language:** Swift - **Build:** XcodeGen (project.yml generates .xcodeproj) - **Target:** iOS (iPhone primary) - **Auth:** ASWebAuthenticationSession with Authorization Code + PKCE (planned), cookie bootstrap to WKWebView (37signals pattern) - **Distribution:** Xcode -> TestFlight -> App Store (Fastlane) - **Dev builds:** Xcode on MacBook, USB to physical iPhone, 7-day free provisioning ### Architecture Pattern (37signals) Per turbo-ios Authentication.md (Basecamp 3, HEY): 1. Authenticate natively via OAuth tokens using ASWebAuthenticationSession 2. Store token in iOS Keychain 3. Bootstrap WebView cookies via hidden WKWebView request to a special Rails endpoint 4. Main WKWebView loads app with session cookie set 5. turbo-ios framework has zero auth-specific APIs -- auth is app-level ### Current State - Dev builds running on physical iPhone via USB - Web content served from respective Rails apps - Auth: not yet wired up natively (uses WebView login currently) - Apple Developer Program enrollment needed (#109, $99/year) ### Related - Forgejo repos: landscaping-assistant-ios, prediction-assistant-ios - Forgejo issues: #108 (turbo-ios distribution), #109 (Apple enrollment) - turbo-ios docs: https://github.com/hotwired/turbo-ios