Hi, I have to develop a chat support system. This will include the ability to embed a live chat widget on websites, while support agents will be available online on Android / iOS apps and web-based backend as well. Additionally, the chat widget on the host website will also behave like a chatbot before starting a chat session. It'll ask certain questions, and depending on the visitor's answers, it'll ask further questions or connect to a relevant support representative (the Agent).
I have already worked on a similar chat system, but that's based on the conventional Database and Webservice/API approach which is slow, non-real-time.
What stack should I use for this kind of project?
Socket.IO is great for building real-time systems like chat. It's effectively a nice wrapper around WebSockets, with the ability to fallback to other methods for browsers that don't support it. We just used it to implement real-time collaboration at BaseDash, including a chat system like you're looking to build.
Node.js is probably the correct choice, especially if you're already familiar with it You'll probably still need to build an API to send requests to your server, and then use Socket.IO to push messages to your clients. This will let you authenticate users and store messages on your database so you can retrieve them later. PostgreSQL and MongoDB are good options for your database, you should be fine either way. Don't worry about speed, they'll both be sufficient.
React on the front end makes it really simple to handle real-time updating data. Again, even better since you're already familiar.
Socket.io with Node.js and socketio client for Reactjs would be perfect for this as Nodejs is very good in two way communication. I would suggest you to deploy the socket backend api on different server so that it does not slow down the I/O operations. In addition to this, you can use Redis if you want to enhance the application performance.