Inspiration

We created LegalBot to provide simple and easy to access information about personal and legal rights. Our focus was to reduce the barrier of access to legal information and provided a quick way to understand the most essential bare bones information someone might want. Specifically focusing on the rights and laws which are applicable for the most vulnerable people in society.

What it does

LegalBot is an SMS chatbot that allows users to access information about rights based on keywords and selections from a list. It's designed to be as easy to use and access as possible

How we built it

Legal Bot was built by using Flask, Ngrok, and Twilio to handle the local server hosting, the public forwarding, and the SMS messaging respectively. When the server starts Flask creates a local server capable of receiving a message and returning a response. An Ngrok tunnel is created to this server, and the URL of this tunnel is used as the Twilio webhook. When a user messages the LegalBot, Twilio sends this information to the Ngrok URL which forwards it to the Flask server. The Flask server takes in and processes this data and generates a reply. The reply is then sent back through the Flask server, through the Ngrok tunnel, back to the Twilio API and out to the user.

Challenges we ran into

Our largest challenge was integrating all the API’s into python and having them all work together with python, for example Ngrok would sometimes decide to keep the tunnel open for whatever reason and so a try: finally: block had to be used within the code to kill the Ngrok process from the python file when the python file is stopped.

Built With

Share this project:

Updates