
Building a Twitter-like social media app, need advice on implementing home feed, and view count tracking.
I’m building a Twitter-like social media app using Next.js 15 and Supabase. Unlike Twitter, I’m sticking to a unified Home timeline that shows all global posts to everyone (discovery-focused). I'm trying to avoid using expensive services like getStream, etc., to do this, for now. I'm stuck on how to implement the features mentioned in the title: The home feed: unlike Twitter, I'm using a unified home feed that shows all global posts to everyone (discovery-focused). I'm confused about what the discovery algorithm should be. I'm also using useSWRinfinite for infinite scroll, so how do I handle DOM bloat? Virtualisation, or just a "hard limit" at ~500 items to force a refresh? And instead of automatically adding posts to the feed, I want to do it periodically and only if the user wants to, as Twitter does by showing the "show x new posts" floating banner at the top of the feed and only adding new posts when I click it. How do I do this? View count tracking: Planning to use IntersectionObs
Continue reading on Dev.to Webdev
Opens in a new tab


