Wadoh

cover

Wadoh is wrapper of reverse-engineered WhatsApp Web API. Wadoh is a software or app or you name it that provides API from registered devices. So the idea is in this app there will be users. Users can register their devices or their WhatsApp Web to this app. Then for each app there is API Key that can be used to interract with the device, like sending message, etc.

Why did I make this? I am not really interested on WhatsApp thing actually, but I’m working on a place where client don’t want to subscribe the official API. So I came up with this idea. Client can register their own devices and then put the API details to another system (our other system where the client also registered and want to send message to their clients. Like we are billing system provider).

The project is available on github.com/9d4/wadoh

Architecture

feature image Since the beginning of the project, I already thought about replication. Almost everytime, I wanted a thing that can be replicated. So this app is somehow built with litle replication in mind.

Device Backend

I don’t actually reverse-engineer the WhatsApp Web API, I’m just using whatsmeow. It’s great repo actually. Big Thanks to tulir.

Whatsmeow is by default using sqlite as its storage. As the sqlite performance maybe not good if we have lot of devices, I need to use another storage. But it means that I have to change some code and etc-etc. whereas I need to make the MVP real quick.

So instead of adding other storage support, I have a better idea. I made a backend I called wadoh-be where the devices will be managed here. The interface which is web and its engine will be in another project/repo, and they will communicate with gRPC.

Now I have two separate thing, Web Engine and Device Backend. When I need to replicate things I can make bridge between them. This bridge will tell which device is in which Device Backend and all device operations will be done through this bridge. Currently the Web Engine and Device Backend are communicating directly.

Web Engine

A the beginning I planned to use SolidJS or VueJS for frontend, I even have scaffolded a little part of SolidJS. But I saw htmx and want to give it a try. Seriously, I never heard about htmx before. I tried it and it speeded up the development quite a bit. It feels a bit odd because returning html from a fetch request, but it works great, kind of SSR thing I think.

That’s all for now, thank you for reading. I don’t think someone will read this, but thank you if you did.