Visual notification for unread messages in a topic

Hi Romain :waving_hand:

A notification system is quite complex.

The majority of the logic will happen on your backEnd.

Here are a couple posts of members trying to figure out a solution:

Using a third party service:

Other than that I tried asking ChatGpt on how you could start to create this system and this is what it came up with:

ChatGPT Answer

:brain: How to build a Discourse-like notification system with Xano + WeWeb

To build a forum notification system like Discourse (blue dots for new topics or unread replies), you’ll need:


1. Backend data model (Xano)

Make sure you have:

Users table
Topics table
Posts table (each topic can have multiple posts)
UserTopicView table (logs when a user last viewed a topic)
UserCategoryView table (optional, for category-level dots)


2. Logic to check unread content

When user loads the app, run a query:

• For each topic in a category → check if the last_post_date is after the last_viewed_date in UserTopicView
• If yes → mark as unread
• Sum up unread topics to show a blue dot on category
• For each topic → show a dot if there are unread posts


3. On topic visit

• When user visits a topic, call a Xano function that updates or inserts the UserTopicView record with the current timestamp


4. In WeWeb

Use conditional logic:

• Show the :blue_circle: icon if topic.last_post_date > user_view.last_viewed_date
• You can use a custom query that fetches both the topic list and the user views (via Xano joins or post-processed logic)


5. Performance tip

For scale, avoid calculating everything in real-time on the frontend. You can:

• Precompute unread status in Xano responses
• Or store a boolean has_unread_posts in your UserTopicView, updated via backend workflows or CRONs


:toolbox: Bonus: Starter logic for Xano functions

  • GET unread topics: Join Topics with UserTopicView using user_id. Return only where Topics.last_post_date > UserTopicView.last_viewed_date OR UserTopicView record doesn’t exist.
  • Mark topic as read: On topic page load, send a POST to update or insert the UserTopicView.