How I built and released a ChatGPT over WhatsApp service in 3 days
Published: 2024-02-07 14:40:20

**How I built and released a ChatGPT over WhatsApp service in 3 days**



TLDR;

The application itself, which is connecting the WhatsApp and ChatGPT API’s, was not that complicated to build, and I leveraged a bunch of 3rd party tools like landing page creators, hosted sign up forms, and deploy tools to save myself time. I also used a tech and deploy stack I was familiar with and had recently used to release other projects. And I kept the apps features to a minimum, focusing on the core value it was providing.


So! I recently saw the Hacker News submissions going wild with ChatGPT related products and services people were releasing, and I started thinking of some cool ideas I could build out myself. I browsed through some of the apps, services and chrome extensions that were out there, to get a feel for what was going on.

I came up with a few ideas, one of which was the idea to offer a ChatGPT over WhatsApp service. Sounded like a cool idea. The ability to access ChatGPT from a place you are already visiting regularly to send messages from. The idea sounded pretty cool, so I started exploring it further.

Of course, the idea had already been done by somebody, but hey, who cares. There is usually somebody, somewhere that has beat you to it. But still, so what, that needn’t stop me from building mine.

I started digging into the ChatGPT and WhatsApp API’s to see how they worked. Both are well documented. The ChatGPT API seemed pretty straightforward to use. The WhatsApp one slightly less so, but I did some tinkering around and without too much trouble was able to get the setup working on my local machine with some test numbers that WhatsApp provide. Basically when you send a message from your phone on WhatsApp to the WhatsApp test number, you can configure it so that their API Platform forwards a webhook request to an endpoint of your choice, with all the message details included, so you can then handle the message as you like.

The final setup of my application looks something like this:

To get it working on production you need an actual WhatsApp number, which the users can add as a contact and send messages to, and you need to register that number as a WhatsApp Business account so that you can leverage their WhatsApp Cloud API. To do that, I bought a virtual number from Numero eSim, and registered it under a WhatsApp Business Account.

The web framework I used to build the application was Laravel. This is mainly because its the framework I have most experience in, all the way from setting up and writing an application, to deploying it. I used Laravel Forge to deploy the application into the cloud, which is a tool that makes it super easy to deploy Laravel applications into the cloud. I chose to host the application on AWS, but Forge supports a number of cloud providers.

Laravel is of course a massive framework to support such a small project, but I dont really care about that right now. The project could grow. And it’s the framework that I had the most experience with, and would allow me to build and deploy as fast as possible, which was my highest priority by far, so it was a no brainer what to use.

I recently (Dec 2022) built another application called AlterEgo AI which is an AI Avatar image generator. That was the first time I had built and deployed with Laravel in a while, so I was a lot more rusty during that one, and things were definitely slower. Which is why it is good to go through the full process of building and releasing a few products. Once you have done it a few times the whole flow from zero to live becomes a lot faster.

So if you are interested in building software applications and products, I would encourage you to go from build to release for a few of your ideas, even if you think the idea is not that worth it, so that the process becomes much easier and faster. After the first few times you will have done most of the learning about setting everything up, and deploying, so the next times it becomes much faster. You’ll be surprised at how much faster your second try goes compared to your first

That is also why I think sticking with a similar stack each time is so useful. When testing out ideas, the aim is to release the product, and get market feedback and validation as soon as possible. The aim is not to try and use the best framework for our exact job, with beautifully written and crafted code. We are not really building solid production software. We are more trying to test an idea out, and see if there is any traction with it.

To that note, once I had built the main application, I still needed a landing page. Building UI really does take a lot of time. I would say its not as complex as backend work, but it doesn’t take any less time to get something looking good. I started browsing around for landing page builders, and came across Cardd.co. Its a cool landing page builder, and totally free. I tried it out and quickly put something together that was way cooler than anything I could have made, and in a fraction of the time.

I kept the landing page super simple, with the WhatsApp contact number clearly written out near the start, so people literally just have to add the number on their phones, and they can start chatting with ChatGPT over WhatsApp. You can check it out here. No sign up or anything needed. I also added another section below that with planned upcoming features, and a Sign Up form to get notified about new feature releases. This was also a sort of test, to see how many people would be interested enough to sign up.

For the sign up form, I used TypeForm, an online form builder I learnt about while building my previous project. I quickly put together a sign up form on there, and was good to go. No need to spend my time building that out myself. I realised after releasing that to get more than 10 sign ups, I needed to use the paid version, which was 25 USD per month for 100 sign ups. Sounds kind of expensive, just for an online sign up form, but I had already released at that point. So I just signed up for it. Next time I might consider using something like Google forms, which although would not look near as slick, would be free. Which I think would be good enough for an initial sign up page.

So that was it! Within 3 days, basically over a Friday night and weekend, I got this whole thing released, i.e working in production, with a real phone number people could use. Of course, there were loads more features I could have added. For example, interestingly, the ChatGPT API (which is actually the Open AI Chat API) does not support context recognition from previous conversations. You need to build that in, for example by saving the users recent previous conversations, and sending them all inside a single API call as a series of questions and answers, with the users final question at the end. So the entire conversation context actually needs to go through as a single API call.

I could have added support for voice notes, or the ability to add your own Open AI API Key for unlimited daily conversations (I limited the daily number of conversations to 20 per day). But these were all extra’s. I remember reading an interesting tweet where someone mentioned that when releasing an MVP, think of the core value that your product or service is providing, and narrow it down to just that. Sure, I could have added support for recognising previous conversation context, or the ability to use your own API Key. But at the end of the day the core value the service was providing was the ability to interact with ChatGPT over WhatsApp, and it already did at. All these other things were extras.

What if I built all those in, and nobody used it anyway. What a waste of time that would have been. The essence of the product was already there, so better to release it now, and move forward based on user feedback. If loads of people started using it, good, I have something to work with now. If it’s a total fail, with no usage whatsoever, good, I found that out as soon as possible. I can either try and make it better, or move onto the next thing, but at least I have more information to make that decision on, and I have saved myself some precious time.

And I could have collected some valuable information in the meanwhile, such as an email list of interested users, number of people using the app, average number of messages sent a day. I can use this information for the next stage of release, for example predicting a realistic and competitive price point based on the number of messages users send in a single day.

Once the product is ready and released, then comes the marketing step, which is a whole section of its own, and honestly, as important as being able to build a good product I feel. I did all the usual things, share on Twitter, Product Hunt, HackerNews and some Facebook groups related to AI. Even this article is partly motivated by my desire to increase the products reach.

Releasing a product without marketing is almost like that saying, “If a tree falls in a forest and no one is around to hear it, does it make a sound?” From my experience releasing this, and the previous product, is that marketing and distribution is half the game, if not more. Unless it’s some super good product that goes viral (i.e fantasy land for most of us), marketing and getting eyes on the product is super important. Whether thats posting about it, making it easy to share with other people, or whatever strategy is used (I am no expert in this area), it is a very important part.

That’s also where having a following is super useful. If you have got like 100K followers on twitter, and you release something, it’s going to get way more traffic and sales than if you have no followers. This idea of having a following is one of the probably many strategies that can help solve the marketing and distribution problem. It is definitely one that sounds appealing to me though.

But back to marketing, once the product is released, I feel you need to spend an equal time after that between marketing and building, at least until a certain level of traction has been built. Energy has to be put into some kind of sales/conversation funnel, where you are spending time and creativity into finding ways to get attention on to your product, as a first step, and then having a product that is good enough to convert that attention into a sale.

So, my story of building and releasing the product comes to an end. If I had to summarise some of the key things that allowed me to release quickly, I would say they were

    familiarity with a tech stack for building and deploying web applications. And sticking with that tech stack. In my case it was Laravel, and Forge for the deploy, but it could be whatever works best for you
    leveraging 3rd party services as much as you can, even if you need to pay a little. You will save yourself loads of time, and time is also money
    focusing on the core essence of the value you are offering, and release that. Don’t overbuild. Get user feedback as soon as possible.

Nothing I have mentioned here is new, or revolutionary, or even my own ideas. But I would say they are ideas that I have worked with, integrated, and believe to be true, and so I am sharing them here. I am no expert in releasing successful products, so all of this is just my current best level of understanding, from actually trying it out a few times.

I do hope it was useful though.

Thank you!

Updates!

I was meant to release this article last Monday, but woke up that Monday morning with somebody having tweeted about the app, and it getting thousands of views, which was viral as far as someone like me was concerned. (Remember what I said earlier about having a following )

Thousands of people started trying to use the app, and it burned through my free limit of WhatsApp business messages, so the bot stopped responding to people. I updated the website and page to mention that, and say that I was working on a paid service to let people subscribe. But that was a proof of concept as far as I was concerned.

One week later, and I have rolled out the paid service option, in large parts thanks to the Stripe Customer Portal, which allows you to offer customers to handle their own subscriptions, without you needing to code up any of the UI or infrastructure for that.You just need to listen for certain Stripe events on your application (via webhooks), and to handle any events you are interested. But that is all backend work, and you dont need to build a UI or even a login for users to handle that. (Queue next article about how I got the subscription feature working in a week, working just evenings and weekends.)

No one has actually paid for a subscription yet. I did just release yesterday though. It will be interesting to see the difference between the thousands of users that were using it for free, and how many would actually sign up.

Well that’s all for now. Thanks for reading till here. You can check out the latest website over here: https://chatsapp.world

And please do give me a follow if you would be interested in reading similar articles on putting web projects together, or just about software and building stuff in general...