Asked

Best practice for adding "notifications" to a site?

Making a dating site.

Imagine James "hearts" Sally's profile. I want a simple notification for Sally next time she logs in. Like Indie Hackers, where a little red number by your profile.

My current idea is having both:

{hearts: [james, fred, george]} {notifications: [james]}

objects in the users mongo database. And every time an item gets added to hearts it also gets added to notifications. Then when a user acknowledges the notification i remove the item from notifications?

I've never done notifications before so wasn't sure there is a best practice? Bear in mind I also want to add in some notifications for messaging later β€” thank you!

last of the young and famous writers - marketingexamples.com
last of the young and famous writers - marketingexamples.com

hmm thanks alex. So I'm using Node + Mongo . Will checkout Redis