Build a chat/messenger in Retool

Hi there, I’ve been using Retool for a couple of weeks and it’s been amazing! :rocket:

I’m building an admin interface for an existing React app, and now I need to find a way to add a chat to it. This chat will work for one-to-one conversations between admins and users. The users will communicate through the one built on the existing app, but the admins need to see the messages and answer them from the Retool interface.

All the data is being stored on Firebase (:fire:), I’m retrieving and sending messages with Firestore queries.

I started to build this chat with plain JavaScript in a custom component which shows the messages, and a form component to send new ones. The most basic stuff is working, but it’s not being synced in real time (the query is just running periodically), and there are still some things to implement (i.e. attaching and displaying images, emoji support, aesthetics).

Maybe you have some better ideas to build this thing, because I think this may not be the most practical way to do it.

I’m adding a screenshot to show what is already done.

Can you suggest me some ideas?

Hey there @joel! Sorry for the delay here :confused:

I think your general approach makes sense, but you might be able to get the functionality you need out of existing Retool components instead of building a custom component (e.g. use a text component, image component, etc.). For realtime updates - we don’t support subscriptions to Firebase quite yet unfortunately :confused:

1 Like

Hi justin, thanks for the help! I ended up building it with a mix of Retool components and a custom one.

I think it looks cool, but subscriptions to Firebase would definitively help. Hope it’s somewhere in the roadmap :grin:

2 Likes

Nice! That looks great!

Definitely on the roadmap to add realtime support, but nothing concrete yet :confused:

1 Like