skip to Main Content

I have a web-app with Django backend and react frontend where inside an organization or company, there are multiple users. Now, I am trying to implement real-time commenting system where if one user types any comment and posts it, another user will be able to see it without refreshing the page.

I have seen some examples of asynchronous tasks using celery with redis but couldn’t find any with react implementation.

What would be a good approach towards achieving the real-time comment system in the react/django app?

2

Answers


  1. Here is an example of simple tasks with celery, redis and WebSockets (Django Channels) and frontend in React (and docker for deployment). The task state and progress are updated over WebSockets https://github.com/pplonski/simple-tasks

    The other option will be long-polling, the user will not need to refresh the page, but React will make requests every few seconds to get new data (simple and solid approach). I’ve seen this approach in many (many) applications. A few years ago I will be afraid of such implementation (too many requests). But now, I will select this approach because of its simplicity.

    Login or Signup to reply.
  2. There’s also CollabKit which provide a React commenting system. https://collabkit.dev

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search