Hault - launch ai customer support with a click
Tags: devchallenge, twiliochallenge, ai, twilio
Published: 2024-06-24 06:47:33

*This is a submission for the [Twilio Challenge ](https://dev.to/challenges/twilio)*

## What I Built
Hault is an open-source software that helps connect database that contains information about your business and FAQs that help you automate customer support using AI.

<!-- INTRODUCTION -->
## Introduction

- The project is mainly a WhatsApp bot which you can scroll down and host via one click deploy on render by pressing `Deploy on render` and the user can talk to the application via WhatsApp to whatever number you have configured on twilio.

- In my case,  you can check the bot out right now by messaging me at (+13476958493)
Since the number is blocked because of WhatsApp verification problem you can check the website out and try the project to do so you will need to log in via Google and you will need to ask the admin permission via email at `capja778@gmail.com`
then head over to [https://hault.vercel.app/login](https://hault.vercel.app/login)

- I keep it as raw as possible so that the people using this project find it easy to host and edit the website too.
Here are some of the screenshots of the application

![Screenshot 1](https://raw.githubusercontent.com/captain0jay/Hault/main/project/Screenshot%20from%202024-06-24%2011-28-06.png)

![Screenshot 2](https://raw.githubusercontent.com/captain0jay/Hault/main/project/Screenshot%20from%202024-06-24%2011-28-27.png)

![Screenshot 3](https://raw.githubusercontent.com/captain0jay/Hault/main/project/Screenshot%20from%202024-06-24%2011-09-11.png)

## How to host the software for your business?

:1. First get the following authentication token and api keys from the following services

 - Google Gemini API key
 - Airtable account Table id, base id, api key
 - Twilio account sid , phone number and auth token
 
well actually i added 2 AI servuce that is gemini and workers ai which can be switched using LLM variable set to either GEMINIAI or WORKERAI.But for ease we will use gemini ai for now.

Same for database plan was to in corporate Mongodb too but we are only gonna use Airtable for now so set UI as AIRTABLE

For twilio you will need to create a whatsapp sender by purchasing a number, then create a service there you will choose the number, then in integration section choose webhook and add the call back url as 

`your_url+/api/v1/twilio/message`

in status add 

`your_url+/api/v1/twilio/status`

we will get the url after deployment

 
So overall you will need these values 
```
LLM=GEMINIAI
UI=AIRTABLE
OWNER_EMAIL
OWNER_PHONE_NUMBER
TWILIO_PHONE_NUMBER
TWILIO_ACCOUNT_SID
TWILIO_AUTH_TOKEN
AIRTABLE_TABLE_ID
AIRTABLE_BASE_ID
AIRTABLE_API_KEY
```  

Let everything else stay empty or add "123" as a dummy value when inputting in the deployment.

 :2. Go to my repo [https://github.com/captain0jay/Hault](https://github.com/captain0jay/Hault)
and click the deploy on render button

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m5xj8oopm7vimp6yzilu.png)

 :3. Then you will be redirected to render website where the values we got will be inputted 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j6d4n937rxgkv7zophq0.png)

 :4. Then just press launch button and your application will be live and your customers can start messaging and take the benefit of AI customer support
 
 :5. One last step as we discussed earlier that in console.twilio.com -> messaging -> service -> your_created_service -> integration 

the call back url as 

`your_url+/api/v1/twilio/message`

in status add 

`your_url+/api/v1/twilio/status`

- here add your_url as the one that you got in hosted application see below image as reference

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w5x7qfgktyex2j620kln.png)

## Demo
So you can check the bot out right now by messaging at (+13476958493) and ask about Hault that is the project itself.
Since the number is blocked because of whatsapp verification problem you can check the website out and try the project to do so you will need to login via Google and you will need to ask the admin permission via email at `capja778@gmail.com`
then head over to [https://hault.vercel.app/login](https://hault.vercel.app/login)

Below is the repo

{% embed https://github.com/captain0jay/Hault %}

## Tech stack

For backend - Nodejs
For frontend - Nextjs, Shadcn
Main services - Twilio
AI - Gemini
Database - Airtable

## Twilio and AI
<!-- Tell us how you leveraged Twilio’s capabilities with AI -->
Twilios whatsapp and SMS functionalities were very helpful in making the software as the code required is very minimal 

I connected airatble database and fetched the details from the database feeding it to Gemini AI and then final step was to give response back to twilio after webhook is called and all it took for twilio to connect is 5 lines of code

```
router.post('/message', async (req, res) => {
    
    const userMessage = req.body.Body || "hi";
    const twiml = new MessagingResponse();

    let response = await getChat(userMessage);


    twiml.message(response);
    res.type('text/xml').send(twiml.toString());
});
```
## Additional Prize Categories

My submission qualifies for Twilio Times Two, Impactful Innovators

Thanks for reading till the end :)