beerose / use-comments

React hook to effortlessly add a comment section to your website, and start the discussion on your content.
https://use-comments.netlify.app/
MIT License
171 stars 6 forks source link

Feature request: Notification and Avatar #14

Open vahidtakro opened 2 years ago

vahidtakro commented 2 years ago

this is an amazing repo, I want to use it on my blog. but there are still something missing, I'd like to be able to reply on others comments (I am a new learner so it's difficult to build it by myself 😀) also, notification system could be good, through email maybe, so I'd like to inform users when I reply to their comments. and Avatar I guess is easy to add.

Thanks!

beerose commented 2 years ago

Hey! Thanks for the feedback!

On the website, you can find a recipe for adding email notifications: https://use-comments.netlify.app/recipes#send-an-email-after-receiving-a-new-comment. Since it's a self-hosted version, unfortunately, you need to "do it yourself". Let me know if you have any questions!

Regarding the reply to, and other features — I recently launched Commont (https://www.commont.app/) which is a hosted version of this project, where I'm planning to add the reply to feature soon. It will probably first land there, and then I'll add it to this project.

As for the avatar — I have some ideas about it. I want users to be able to pass details or metadata object in addComment function. This could be an arbitrary JSON object where you could pass any data you want (with some size limitation probably). It would allow users to pass avatar property, or some other users wanted a contact email, or other information.

vahidtakro commented 2 years ago

Just after using Commont (https://www.commont.app/), I should say I absolutely love this commenting system! I was waiting for it for such a long time. before that I was using Cusdis, which I had a lot of problems with its customization. I actually could add Avatar there, my idea is to use a package-like thing. maybe this package which let you build :Gravatar, Custom image, Name initials, and so on. so I think it rarely happens if users want spend time to upload their avatar just to be shown on the website. So if they just fill a input, like email address, or instagram ID, ... their avatar will be appeared through this package. but having a login system like facebook or Google is not a bad idea.

about reply to, I think this is the most important, something necessary, at least for me. as I am not an expert to build it for myself, I can wait for it.

and about notification, this is good to be notified when visitor post comments, but my request was if we can notify users when somebody replies to their comments. through email probably. because in my experience, nobody comes back to the page to check if his/her comment is being replied or not.

Through my experience with Cusdis, I found their Telegram bot webhook very useful, so I could get notifications once I had new comments, I could get a message on telegram, immediately, and I could also reply with one-click from there. Can we also have such a system here?


also as I am using the hosted version now, if one day I decide to do self hosting, is it easy to move the comments? because honestly I liked the commant.app UI, and I'd like to have one similar for my blog, to make it multilingual. this may not be possible through self-hosted useComments. right?

are there a system to import and export comments? for example how can I import my comments from WordPress to hosted/self-hosted Commont? can I use my own database (on planetscale) with it?

Thanks

beerose commented 2 years ago

Just after using Commont (https://www.commont.app/), I should say I absolutely love this commenting system! I was waiting for it for such a long time.

Thank you 😊

about reply to, I think this is the most important, something necessary, at least for me. as I am not an expert to build it for myself, I can wait for it.

This is my number one priority as well. I expect to have it by the end of this month.

and about notification, this is good to be notified when visitor post comments, but my request was if we can notify users when somebody replies to their comments. through email probably. because in my experience, nobody comes back to the page to check if his/her comment is being replied or not.

I'll think about it more, but one thing that I wanted to implement is custom webhooks. E.g. when someone adds a new comment, Commont could trigger a call to a REST endpoint provided by you. In this REST endpoint, you could handle whatever you need — send email, rebuild your page, send a notification to slack/discord/telegram etc. Would that be interesting? However, once there's a reply to functionality, I'll focus more on email notifications.

Through my experience with Cusdis, I found their Telegram bot webhook very useful, so I could get notifications once I had new comments, I could get a message on telegram, immediately, and I could also reply with one-click from there. Can we also have such a system here?

This is a nice idea!

also as I am using the hosted version now, if one day I decide to do self hosting, is it easy to move the comments?

Right now, the easiest way is to email me and I'll send you a CSV or SQL with your comments dump 😅 Though I plan to add export feature to Commont.

this may not be possible through self-hosted useComments. right?

Hmm, you could have multiple self-hosted instances, or differentiate between projects by passing a unique id, e.g. spanish-personal-blog, english-personal-blog, etc.

are there a system to import and export comments? for example how can I import my comments from WordPress to hosted/self-hosted Commont?

Not yet, but I can help you with migration.

can I use my own database (on planetscale) with it?

Commont is fully hosted, including the database. However, with useComment, you can use your own db, as long as it's supported by Hasura. Hasura currently supports the following databases:

As for Planetscale — AFAIK it's built on top of Vitess, which isn't compatible with any databases supported by Hasura. I think they had plans to add compatibility with Postgres, but there doesn't seem to be any progress on that.

vahidtakro commented 2 years ago

Thank you 😊

You're welcome :)

This is my number one priority as well. I expect to have it by the end of this month.

Perfect, I keep waiting, btw, I think having only one isChild could be better, because now I have problems with Cusdis, when someone reply on another reply, they go inside each other, so they will become smaller and smaller. I mean the view. I prefered when a comment is getting replied, it only list under that comment, and another reply on that reply, stay as the same position, hope if you understand. if not I can explain more. also I think having mark on the admin (web manager) could be nice. so a verification badge next to name, if the replier is admin.

I plan to add export feature to Commont.

This would be awesome!

Hmm, you could have multiple self-hosted instances, or differentiate between projects by passing a unique id, e.g. spanish-personal-blog, english-personal-blog, etc.

I meant internationalizing the admin UI itself, not different projects for each language. BTW, I think if there were no limitation with comment numbers on hosted version, more users could use it.

Not yet, but I can help you with migration.

Thanks. The thing is that I have more than 300 comments on my old wordpress site which I plan to move, and they are all included replies, so I may need to move once the reply function is ready.

Commont is fully hosted, including the database. However, with useComment, you can use your own db, as long as it's supported by Hasura. Hasura currently supports the following databases:

Isn't it possible to move to something else than Hasura?

two more thing I figured out about Commont just now: I am using a multi-domain site deployed on vercel, comments are only shown on my main domain which I added to commont, there is no any comments on another domain, even if the topic url are the same. and also the domain https://www.commont.app/ is not accessible in some countries like Iran, China, Russia,... this means they can not get the data and comments without a proxy.

beerose commented 2 years ago

Perfect, I keep waiting, btw, I think having only one isChild could be better, (..)

useComments and commont are both headless solutions, so you can implement it in the UI as you see fit — you can have 1-level replies if that better suits your website. However, some people will want multi-level replies, so I'm going to be flexible with my implementation and will leave it to the users to decide if/how many levels of replies they want.

BTW, I think if there were no limitation with comment numbers on hosted version, more users could use it.

There's an unlimited number of comments in a paid version.

Isn't it possible to move to something else than Hasura?

useComments, the self-hosted project, is built on top of Hasura. Hence there's no possibility to use it without Hasura unless there's a tool that is a 1-1 replacement of Hasura. However, Commont is a hosted product, so you don't need to worry about hosting at any point.

beerose commented 2 years ago

I am using a multi-domain site deployed on vercel, comments are only shown on my main domain which I added to commont, there is no any comments on another domain, even if the topic url are the same.

Yes, Commont has a CORS policy to only accept requests from a specified domain. You can set Project URL as https://domain-1.com,https://domain-2.com as a workaround.

and also the domain https://www.commont.app/ is not accessible in some countries like Iran, China, Russia

Could you elaborate? The TLD is banned or the website itself?