Summary
The follow/connect flow currently has fragmented deep-link logic spread across packages/shared/src/platforms.ts and apps/backend/src/routes/follow.ts. Refactor into a unified DeepLinkResolver utility in packages/shared that supports a priority fallback chain: native deep link → universal link → web URL → webview.
Context
Different devices and install states require different URL schemes. The resolver should determine the best link strategy for a given platform + device context and expose a clean interface for both web and mobile consumers.
Tasks
Acceptance Criteria
Difficulty
senior — requires cross-package refactoring, polymorphic type design, and deep understanding of every platform's URL scheme.
Summary
The follow/connect flow currently has fragmented deep-link logic spread across
packages/shared/src/platforms.tsandapps/backend/src/routes/follow.ts. Refactor into a unifiedDeepLinkResolverutility inpackages/sharedthat supports a priority fallback chain: native deep link → universal link → web URL → webview.Context
Different devices and install states require different URL schemes. The resolver should determine the best link strategy for a given platform + device context and expose a clean interface for both web and mobile consumers.
Tasks
packages/shared/src/deepLinks.ts(new file), define:type LinkStrategy = 'native-deeplink' | 'universal-link' | 'web-url' | 'webview'.type ResolvedLink = { strategy: LinkStrategy; url: string; fallback?: ResolvedLink }.function resolveDeepLink(platform: string, username: string, context: { hasApp?: boolean; isMobile?: boolean }): ResolvedLink— returns the whole fallback chain.PLATFORMSentries inplatforms.tsto include:nativeScheme: string | null— e.g.'linkedin://'.universalLink: string | null— e.g.'https://linkedin.com/in/{username}'.webViewFallback: boolean— true for platforms (like LinkedIn) that need WebView for actions.apps/backend/src/routes/follow.tsto useresolveDeepLinkfrom shared.apps/mobile/src/screens/DevCardViewScreen.tsxto useresolveDeepLinkfor button behavior.packages/shared/src/__tests__/deepLinks.test.tscovering all strategy combinations.Acceptance Criteria
PLATFORMShas a complete resolver entry.pnpm -r testpasses.Difficulty
senior— requires cross-package refactoring, polymorphic type design, and deep understanding of every platform's URL scheme.