Orbit Docs
Get Started
Deployment
Architecture
Architecture Overview
Shared Packages
Database
Database Schema
Triggers & Functions
Features
Spaces
Posts
Comments
Follows
Notifications
Feeds
Roles
Roles & Permissions
Api
Admin Api
Users
Roles
Site Configuration
Content Moderation — Posts
Content Moderation — Spaces
Hub Api
Spaces
Posts
Comments
Reactions
Memberships
Follows
Feeds
Uploads
Views
Other Api
Profile
Public Profiles
Notifications
Leaderboard
About
OG Metadata
User Search
Sponsored
Aveiro
aveiro.app
TrademarkTrademark
Ctrl k
Search...
Sign up
Orbit Docs
Get Started
Deployment
Architecture
Architecture Overview
Shared Packages
Database
Database Schema
Triggers & Functions
Features
Spaces
Posts
Comments
Follows
Notifications
Feeds
Roles
Roles & Permissions
Api
Admin Api
Users
Roles
Site Configuration
Content Moderation — Posts
Content Moderation — Spaces
Hub Api
Spaces
Posts
Comments
Reactions
Memberships
Follows
Feeds
Uploads
Views
Other Api
Profile
Public Profiles
Notifications
Leaderboard
About
OG Metadata
User Search

Notifications

Real-time notification system covering comments, replies, mentions, milestones, follows, and role assignments.
Updated 11d ago
Follows
Feeds
Sponsored
Aveiro
aveiro.app
Sponsored
Aveiro
aveiro.app
Sponsored
Aveiro
aveiro.app
TrademarkTrademark
OrbitSupa Social by Dopler
© Dopler. All rights reserved.
Built with Aveiro
Supa Hub has a comprehensive notification system that covers all major user interactions.

Notification Types

Type
Trigger
Recipient
comment_on_postNew top-level comment on a postPost author
replyReply to a commentParent comment author
mention@username in a commentMentioned user
milestonePost reaches a view or reaction milestonePost author
space_roleUser assigned as moderator/admin of a spaceAssigned user
new_followerSomeone follows a userFollowed user
follower_postA followed user publishes a new postAll followers

How Notifications Work

Notifications are created by database triggers, not application code. This ensures they are always generated regardless of which API endpoint or client triggers the action.

Storage

Each notification consists of two rows:
  • hub_notifications — The event itself (type, actor, resource, context JSON)
  • hub_notification_recipients — One row per recipient, with read_at tracking
The context JSONB column stores all the data needed to render the notification (post slug, space slug, post title, milestone value, etc.), so the client doesn't need additional queries.

Participant Tracking

For comment notifications, the system maintains a participation cache (hub_participation_cache). When a user comments on a post, they become a participant. All participants are notified of new comments on that post (excluding the commenter).

Real-Time Delivery

The GET /api/notifications/stream endpoint provides Server-Sent Events (SSE) for real-time notification delivery. The client keeps a persistent HTTP connection open and receives push updates as notifications arrive.

Milestones

View Milestones

Triggered when a post's view count crosses a threshold:
  • Predefined: 50, 100, 250, 500
  • Recurring: Every 1,000 views after 1,000

Reaction Milestones

Triggered when a post's total reaction count crosses a threshold:
  • Predefined: 5, 25, 50
  • Recurring: Every 100 reactions after 100
Milestones are tracked in hub_post_milestones to prevent duplicate notifications. Each (post, type, value) combination can only trigger once.

Follow Notifications

Two notification types are generated by the follow system:
  • new_follower — Sent to a user when someone follows them. The notification links to the follower's profile.
  • follower_post — Sent to all followers when a user creates a new visible post. The notification includes the post title and links directly to the post. Users who have muted a space are excluded.

Reading Notifications

  • GET /api/notifications — Fetch paginated notifications
  • GET /api/notifications/unread — Get unread count (used for badge display)
  • PATCH /api/notifications — Mark specific notifications as read (sets read_at)

UI Integration

The Header component displays an unread notification count badge. Clicking it opens a dropdown with an infinite-scroll list of recent notifications, each linking to the relevant post, space, or profile. Users can mark all notifications as read with a single click.