Verified data flows for feed, fact checking, chat, likes, search, saves, and profile state.
ForYouScreen watches forYouProvider.ForYouNotifier loads saved item IDs from savedItemIdsProvider, waits for profileUserProvider, and reads local feed preferences.FeedRepository.fetchDiscoverBatch queries content by discover categories, orders by publishedAt descending, and maps rows into ContentItem.feedPersonalizationSnapshotProvider merges local preferences, profile interests, and saved items.FeedPersonalizationSnapshot.prioritizeItems reranks the fetched batch client-side.RandomFeedSession manages paging, deduplication by item ID, and the next offset.feedTuningProvider, which updates shared_preferences and, for signed-in users, writes feedPreferences, boostedTags, suppressedTags, and sometimes interests on the users row.The feed stays broad: personalization changes ordering and category preference, not a hard one-topic filter.
FactCheckScreen validates the typed claim and enforces a daily local limit in shared_preferences (fc_date, fc_count).factCheckProvider calls FactCheckRepository.checkClaim.FactCheckRepository.findFactCheck performs an exact normalized cache match against the fact_checks table after a full-text search.fact_check with JSON { "claim": "...", "userId": "..." }.fact_checks row when Appwrite credentials are available, and returns a structured result.content when source URL or title match, and records signed-in history in user_fact_check_history.FriendsScreen opens a ThreadScreen by calling FriendsService.getOrCreateThread.FriendsService executes chat_write with action getOrCreateThread.chat_write reads the current user from the Appwrite execution headers, verifies accepted friendship, finds or creates a row in threads, and returns { "thread": ... }.ThreadScreen watches threadMessagesProvider, which polls every two seconds through FriendsService.getThreadMessages.FriendsService reads thread_messages, decrypts message bodies with ThreadMessageCipher, and maps rows into ThreadMessageModel.chat_write with action postMessage; the function creates a message row and updates threads.lastMessageAt.Realtime subscription is not used in the current thread provider; polling is explicit in threadMessagesProvider.
ShareArticleSheet uses friendsListProvider to show accepted friends.FriendsService.shareArticle encrypts the optional share message.chat_write with action shareArticle.chat_write validates friendship, creates or reuses a thread, writes a shares row with participant permissions, writes a typed article message in thread_messages, and updates threads.lastMessageAt.FriendsScreen activity reads shares through receivedSharesProvider and hydrates sender/article preview data through sharePreviewProvider.LikeService.isLiked, LikeService.getLikeCount, and LikeService.setLiked.setLiked creates or deletes a row in content_likes.LikeService executes Appwrite Function like_sync with { "contentId": "...", "action": "increment" | "decrement" }.like_sync reads the content row, adjusts likeCount, clamps decrements at zero, writes the updated likeCount, and returns { "success": true, "likeCount": number }.LikeService attempts to roll back the row mutation.saveStateProvider or savedItemIdsProvider.saved_items with itemId, userId, and saveDate.saved_items row.saved_items.notes through SavedContentRepository.updateSavedItemNote.savedItemsProvider hydrates saved rows by reading each referenced content row.SearchScreen writes the current query to searchQueryProvider.shared_preferences under search.recent.v1.searchResultsProvider queries SearchRepository.title, summary, body_text, body, and source when possible, then falls back to recent broad scans.claim and contextBlock full-text indexes when possible.