Today I’m going to answer a question from Marie, the co-founder of a legal tech startup. Her question is… 

How do I add a chat feature to my app without having to develop one? 

Before answering this question, let’s add a bit of context. 

Marie is working with a freelancer to build her Web platform. She wants to add a chat so that users can have one-on-one conversations and create private chats about different topics. 

Her freelancer is wondering if he should develop his own solution from scratch or reuse existing software. 

To clear things up, let’s analyze what a chat tool requires. It requires: 

What’s inside a chat? 

  • Real-time conversation interface 
  • Notifications whenever you come back online 
  • Mobile notifications or SMS 
  • Email notifications 
  • Chat history 

To go through with this, you can use two different strategies. 

Two different strategies 

1. Customize open-source solutions 

The first one would be reusing open-source components. You will still have to deploy specific server-side applications, and fine-tune tools that might have been developed to fulfill a different purpose. 

2. Use SaaS solutions ready to deploy 

The second option is using SaaS solutions. These are indeed paid solutions. 

When it comes to building a startup, I personally prefer to choose the best solution for each need. Developing your own chat system can take weeks or months of your developer’s time to even come up with something reliable. 

On the other hand, certain companies specialize in producing chat applications. They are even considered experts. They would be better than you’ll ever be at building a chat application. They share the development cost among all their clients. 

In other words, I prefer spending a few $100 per month, as opposed to spending thousands with freelancers, and develop a custom chat system. 

So before moving on to SaaS solutions, let’s see what your developer needs to set it up and build it.  

What your developer needs 

1. Real-time connections 

The first thing to consider is that conversations happens in real time. 

Web protocols like HTTP haven’t been created to connect 24/7 to your application. So in order to have a real-time conversation without having to constantly refresh the page, there are two techniques: 

a. Long polling 

You can use the so-called “long polling.” The principle is simple. It’s like asking the server for a webpage, but instead of sending back the webpage content immediately, the server waits 10 to 30 seconds until a message comes in. 

This technique is compatible with every mobile and Web browser, but it’s quite slow and takes up a lot of bandwidth and server resources.

b. WebSocket or XMPP 

The other option is to use specific protocols like WebSocket or XMPP. They perform better but are not compatible with all devices. And if your application is in PHP for example, you will need to have an extra piece of software to handle these protocols. 

So if you are looking for the best possible performance while building your own chat system, I recommend your developer to use the open-source library like Socket.IO. It makes your software all-around compatible by adding the advantage of using both HTTP and WebSocket protocol when supported. 

2. Notifications services 

Second thing to consider is managing the notifications. 

Your customer might like to get notifications on mobile, desktop, browser or via email when they’re not online. 

So you will need to deploy a notification service. There are hundreds of solutions out there that simplify this process. Just use one of these. Some of them can also manage SMS notifications. 

3. Integration and history 

The last thing to consider if you want to build your own chat application is to integrate or develop the real-time chat interface, and handle the chat history. This part might be quite specific to your own application, and this is where your developer will have to get the most work done. 

Now, there are only a handful of all-in-one solutions that can help lower the amount of development and get your application ready sooner. 

Existing solutions 

Don‘t get me wrong, you will still need some development, but much less than if you were to compile open-source software. 

Only a few ready-to-use solutions will allow you use your own user database. That’s why I recommend Twilio or TalkJS. 

What’s next 

  • File exchanges 
  • Voice calls 
  • Video calls 
  • Screen sharing 

When building your own chat system, you might also consider future improvements like sharing some files, doing voice or video calls, or even screen sharing. Twilio, for example integrates, all of these and make it very, very convenient. 

Conclusion 

So to conclude, if your startup needs to integrate a chat between its users, I suggest you subscribe to tools like Twilio or TalkJS since they will save your developers tons of time. Go for custom development and open-source solutions only if you already have a large amount of users and you can’t afford high SaaS monthly fees. 

And if like Marie, you have a specific question for your project, just go ahead and ask on myctofriend.co/ask. I will do my best to answer your question in a video or redirect you to any existing content that will answer it. 

Also, be sure to go through our other content here at myctofriend.co to learn more from real startup growth experiences and better manage your startup development. 

I’ll be waiting for your questions, and I look forward to seeing you in other videos.