How to implement notifications for my web app dashboard?

Hello everyone,

I’m also trying to implement notifications to my web app dashboard, but I’m still figuring out how am I going to build this.

Could you please share your thoughts on how to build it? Should I create a table to keep all notifications that are being sent? How to trigger notifications to specific users? How to manage notifications that have already been read by the user?

I’m using an icon like this one to show that there are notifications for the user.
image

Thank you.

Hello @albarracim :wave:

Yes, a dedicated table for notifications is good practice, but the core functionality of a notification system largely depends on your backend, not WeWeb. You will need Web Sockets both in the front and in the back for that. I don’t know which backend you’re using, but we have native integrations with Xano Realtime: Intro to Xano realtime | WeWeb Documentation and Supabase Realtime: Supabase realtime | WeWeb Documentation

You can also set up a Web Sockets connection using custom JS.

The frontend should only be responsible for displaying notifications and/or managing user interactions like marking notifications as read or navigating to related content. For instance, in the notifications table, you could include a read field (boolean) or read_at field (timestamp) set to false or null… Then in WeWeb, you can create an endpoint to ‘‘Mark the notification as read’’ (set read to true) for instance, use the read variable to change whatever you want in the UI.

1 Like

Hello Dan,

Thank you so much. This is pretty much clarified now.

1 Like