Path A (Apple Native)
Path A is the Apple Native runtime path (DeploymentPath.appleNative) for core app flows:
- Auth: Sign in with Apple (
AuthenticationServices) - Data: SwiftData + CloudKit-backed configuration in production
- Payments: StoreKit 2
- Analytics: TelemetryDeck (optional)
- Backend exceptions: AI chat (and feedback submission) still use backend endpoints
When to pick Path A
Section titled “When to pick Path A”Pick it if:
- you want local-first iOS app flows without running full server infrastructure
- you don’t need custom server-side business APIs yet
- you’re fine with Apple-native constraints (CloudKit schemas, SIWA flow, StoreKit-only payments)
Runtime configuration
Section titled “Runtime configuration”AppConfig.current resolves the deployment path at runtime in ios/SwiftLaunch/Core/Config/AppConfig.swift:
- E2E override
SWIFTLAUNCH_DEPLOYMENT_PATHenvironment variableUserDefaults("deploymentPath")Info.plistkeySWIFTLAUNCH_DEPLOYMENT_PATH.appleNativefallback
Auth details (wired)
Section titled “Auth details (wired)”The iOS app uses AppleAuthService to:
- request Sign in with Apple credentials
- require both identity token and authorization code before creating a session
- persist the session in Keychain
- validate session by checking
ASAuthorizationAppleIDProvidercredential state
AuthState.configureLocalPersistenceIfNeeded(...) wires UserRepository for .appleNative so Apple-authenticated users are persisted through SwiftData.
Persistence details (wired)
Section titled “Persistence details (wired)”LaunchSwiftApp injects a shared SwiftData ModelContainer with:
Schema(versionedSchema: SwiftLaunchSchemaV1.self)ModelConfiguration("SwiftLaunch", ..., cloudKitDatabase: cloudKitDatabase(for: config))- migration plan
SwiftLaunchMigrationPlan
Feature states attach repositories when running in .appleNative:
AIState->ConversationRepository(conversation/message persistence)SettingsState->SettingsRepository(settings persistence)AuthState->UserRepository(Apple user persistence)
CloudKit capability is declared in both:
ios/SwiftLaunch/SwiftLaunch.entitlementsios/project.ymltarget entitlements
CloudKit database mode is enabled only when buildEnvironment == .production and AppConfig.cloudKitContainerIdentifier is present.
Explicit backend exceptions
Section titled “Explicit backend exceptions”- AI chat still uses Worker endpoints (
/api/chatroute family) for model inference, even in.appleNative. - Feedback submission posts to
/api/feedback. - Both route families are backend-auth-protected (
protectedRoutemiddleware), so successful calls require backend-authenticated request context (or the debugx-test-user-idheader used by E2E bypass builds).
Apple Native sign-in is still enough for app-shell navigation gates (AppRouter.isAuthenticated), but it does not by itself establish backend auth for those endpoints.
So Path A is best described as backend-free for core auth/persistence/settings flows, with an explicit backend exception for AI (and feedback submission when backend-auth context is available).