purnima143 / Kurakoo

Kurakoo is an online community of people providing answers to questions just like Quora site. Kurakoo is especially for school-college students, people from around the different colleges visit Kurakoo to ask questions from a community of people who answer them.
MIT License
84 stars 122 forks source link

get notification + create notification #436

Closed mitalirs closed 3 years ago

mitalirs commented 3 years ago

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

Do you want to work on this issue - [Yes/No] - Yes
Subham142 commented 3 years ago

I also just had this idea, when I came to propose it.

i was beaten 2 hours before :)

himanshujaidka commented 3 years ago

@mitalirs so how do we send notifications? via mail?

codewithvk commented 3 years ago

@mitalirs Please specify, Which type of notification do you want to implement, also share a little bit of approch.

mitalirs commented 3 years ago

a user will be notified when someone:

  1. answers their qs
  2. comments on an ans that the user created
  3. upvotes their ans/qs/comment
  4. downvotes their ans/qs/comment

basically, I will create a notification model that will store the notifications for a user. The fields included would be:

  1. notificationFor (the id of user who is supposed to be notified)
  2. notificationTitle: string field
  3. upvoteCommentNotification (will store the id of comment which was upvoted) (similar field for downvote)
  4. upvoteQsNotification (will store the id of qs which was upvoted) (similar field for downvote)
  5. upvoteAnsNotification (will store the id of ans which was upvoted) (similar field for downvote)
  6. ansNotification (an object that will contain the id of answer that was created (by some user) + id of qs (created by user))
  7. commentNotification (an object that will contain the id of comment that was created (by some user) + id of ans (created by user))
  8. status (read/unread)

a user can fetch all his/her notifications by /getNotifications route to mark a particular notification as "read", a user will have use the /getNotification/:id route (get notif by id)

this issue was about creating a notification object when someone comments on your ans/answers your qs and to fetch a notification by id

and issue #435 was about creating the Notification model and a getNotifications route that would have fetched a list of unread notifications which is different from this issue

Also, I am sorry for not mentioning proper details earlier

@mitalirs Please specify, Which type of notification do you want to implement, also share a little bit of approch.

codewithvk commented 3 years ago

@mitalirs Sounds good! Go ahead and if you need some help, ping me on discord.