Supa Hub provides three types of feeds, each with different sorting and filtering logic.
Feed Types
Global Feed
Endpoint:GET /api/hub/global-postsShows all visible posts across all spaces, sorted by creation date (newest first). This is the default feed for unauthenticated users or users who haven't joined any spaces.
For You Feed
Endpoint:GET /api/hub/for-you-postsA personalized feed that uses the hot-ranking algorithm to surface engaging content. Prioritizes posts from spaces the user is a member of.
Space Feed
Endpoint:GET /api/hub/space-postsPosts within a specific space. Pinned posts appear first, followed by other posts sorted by creation date.
RSS Feed
Endpoint:GET /api/feedStandard RSS/Atom feed of recent posts for feed readers.
Hot-Ranking Algorithm
The "For You" feed uses a time-decay scoring algorithm defined in packages/feed. The score for each post is calculated as:Where:
wReacts = 3 (reaction weight)
wViews = 1 (view weight)
decay(age) = exponential decay with a half-life of 72 hours (3 days)
This means:
A post with 10 reactions scores the same as a post with 30 views
After 3 days, a post's score is halved
After 6 days, it's at 25% of its original score
Fresh posts with high engagement rise to the top quickly
The weights and half-life are configurable in packages/configs/validation.js via the hotConfig export.
Post Cards
Each post in the feed is rendered as a PostCard that includes:
Author hover card — A ProfileWidget that lazy-loads follower count, post count, and bio on hover
Space hover card — A SpaceWidget that lazy-loads cover, avatar, member count, and join button on hover
Attachment previews — Images, carousels, YouTube embeds, and link OG cards
Reactions — Inline emoji reaction chips with counts
Feed Filtering
All feeds automatically filter out:
Posts with status other than visible
Posts in spaces with status other than visible
Posts where access rank exceeds the viewer's role rank
Home Page Logic
The home page (/) shows:
For You feed if the user is authenticated and has joined at least one space
Global feed otherwise
Users can switch between feeds using the tab selector in the UI.