citrus
citrus4w ago

Hii, I'm building a idea collaboration

Hii, I'm building a idea collaboration platform for my university and it's been reallyy smooth with Convex, thank you. On the home page, I want to show updates happening on another page (if someone has shown interest in idea/accepted as a team member etc etc). ChatGPT says to make a new table for updates and query it on homepage & show notification icon (with badges) accordingly. Is this the right way to go ?
8 Replies
erquhart
erquhart4w ago
It depends on what you want to show on the home page. I assume you would write a query against whatever table your idea acceptance data is going into. So if you want to show number of members who accepted an idea, you would write a Convex Query function that queries the related tables, gets the number you want, and returns that. Likely don't need an additional table. If you're listing ideas on the home page, this would probably be a part of an existing query. Whatever query is getting the ideas for the home page can also get the number of members who accepted a given idea, for example. Everything will update in realtime, you don't have to think about that part.
citrus
citrusOP4w ago
Thank you for the thread. I think I didn't explain it correctly, apologies. I'll give an example. Let's say I've pitched an idea X and whenever shows interest in it ( which will be visible only to me in my manage dashboard, not on home page) on the home screen, I just want to see a notification icon with a badge saying "hey, someone is interested in your idea". Or let's say I've shown interest in an idea and am on the homepage. If the author of that idea accepts me as a team member, I want it to show me on homepage. hope that makes it clear Just like how you're on instagram feed and someone sends/accepts a follow request, it shows as a badge on notification icon.
erquhart
erquhart4w ago
if someone shows interest in an idea, does that create a new record in a table?
citrus
citrusOP4w ago
yes, it does. In the idea_interest table where author_id & idea_id are added as a record.
erquhart
erquhart4w ago
typical ways to handle notifications state are: 1. per notification, some kind of flag to indicate whether a given user has viewed it, or 2. timestamp for latest viewed time, so all notifications created at or before that timestamp are considered viewed
citrus
citrusOP4w ago
yes, you're right. So I should then create a new table then ?
erquhart
erquhart4w ago
Yeah if this is for general notifications you'll want to have a table that can handle notifiable events directly. How you go about that will depend on your approach. But yeah it will probably involve dedicated table(s)
citrus
citrusOP4w ago
Ah okay, thank you so much!

Did you find this page helpful?