Project structure
DeliciousKit is a standalone Swift Package with no app-specific code. Each file owns one concern, and every integration sits behind a protocol — so you can swap implementations freely and your UI never changes.
The files
LaunchGate.swift— the single public entry point; wraps your root view.Config.swift— the data model for the onboarding flow + paywall.OnboardingView.swift— the flow host: progress, routing, navigation.Steps.swift— the step views: feature, single-select, commitment, building.Paywall.swift— the paywall and plan cards.OnboardingState.swift— captures answers and personalization.Purchases.swift— thePurchaseProviderprotocol, StoreKit 2 + preview providers, andPurchaseController.Auth.swift—AuthProvider,AppleAuthProvider,NoAuthProvider, andAccountDeletionView.Settings.swift—DeliciousKitSettingsView, the data-driven settings hub.AppConfig.swift— centralized config: URLs, feedback email, product IDs, feature flags.Review.swift—ReviewPrompter, smart review-request timing.WhatsNew.swift—WhatsNewConfigand the post-update sheet.DeepLinkRouter.swift— an observable router for URL-scheme deep links.Support.swift— analytics + haptics helpers.Ads.swiftandPush.swift— ad and push integration helpers.
The pattern
Everything swappable is a protocol with a preview implementation. PurchaseProvider has PreviewPurchaseProvider (dev) and StoreKitPurchaseProvider (production); AuthProvider has NoAuthProvider (default) and AppleAuthProvider. You build and demo against the previews with zero backend, then swap in the real ones with a one-line change. The same discipline is how the AI service layer will arrive — behind an AIService protocol — when it lands.