AI-Powered Meal Planning Service with Twilio
Tags: devchallenge, twiliochallenge, ai, twilio
Published: 2024-06-24 04:45:07

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

## What I Built
<!-- Share an overview about your project. -->
A meal planning service that takes your meal plan request through WhatsApp messages, and send back your meal plan with recipes and all the important information: recipe url, image and source (the website that created the recipe). All of this achieved with the effortless magic of Twilio. 

## Demo
[Source code for my app](https://glitch.com/edit/#!/magical-gold-wavelength)

*Send meal plan request to chatbot*

![Send meal plan request to chatbot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wj33e4vk2ts9lxelpde6.png)

Receive a reply that says the meal plan has been sent to your given 
email address.

![Receive successful response](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bar8uxtvir2u4wbyfss0.png)

Receive your meal plan in the inbox 🥣

![Receive your meal plan in the inbox](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/znc54hv167i6r23teacm.png)

Here's how you can try out this app.
<!-- Share a link to your app and include some screenshots here. -->
1. Send a WhatsApp message to number `+14155238886` with code `family-main`. This is Twilio's verified sandbox number.
2. Send a meal plan request in this format: `Your meal plan <your email>`. For example, this message has been tested successfully
`paleo vegan meal plan for 1 week <janedoe@gmail.com>`
Make sure that your message includes the greater than and less than symbols, and your email address is enclosed between them. You can omit "paleo vegan", or change to "x days", where x is a number less than 7, because Edamam only allows a certain number of recipes in each request. I'm only allocated 30 requests per day, so please try the above message once so that many people can enjoy this service.
3. You should get a success message. Wait for your meal plan to arrive in your inbox. 

## Twilio and AI
<!-- Tell us how you leveraged Twilio’s capabilities with AI -->
Meal plan is complicated and time-consuming. Each person has a certain preferences and dietary need. Making a meal plan service that can please many different human beings is a near impossible task.

You can look up online meal planning services and most of them will send the same plan to every one, unless you are prepared to pay a premium price.

How about leverage AI to make meal plan more accessible? There's an API on the market that does just that: the [chatbot assistant](https://www.edamam.com/ai-chatbot-assistant/) from Edamam.

A diagram of the communication between WhatsApp user, this app and Edamam.

![Workflow of meal planning service](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n9yzfiwi99qphou1aqi8.png)

You don't see the name Twilio in the diagram, because it is the silent magician that does all the plumbing work. It allows me to process WhatsApp messages, respond to WhatsApp users and send helpful emails to them (a really big deal in the age of spams and frauds).

## Additional Prize Categories

*Twilio Times Two*: I used two Twilio APIs, one for WhatsApp and the other for Sendgrid.

*Impactful Innovators*: I believe this online meal planning service will free people from that dreadful question comes every weeknight: What's for dinner?

*Entertaining Endeavors*: On the other hand, this meal planning service is not production ready yet. It may suggest that you have ice cream or rosemary oil for dinner. Besides, many food websites branch out into housekeeping. Occasionally, you may get recipes for furniture polish, or mulled-cider sachets. The Meal Planning API from Edamam is unable to tell if a recipe is safe for human consumption or not. While we wait for the Edamam API to mature, let's treat this app like something lighthearted to lighten up your Sunday blues.
<!-- Does your submission qualify for any additional prize categories (Twilio Times Two, Impactful Innovators, Entertaining Endeavors)? Please list all that apply.  -->

<!-- Team Submissions: Please pick one member to publish the submission and credit teammates by listing their DEV usernames directly in the body of the post. -->

<!-- Don't forget to add a cover image (if you want). -->

<!-- Thanks for participating! →