It is a web application created using Flask, HTML/CSS, SQLLite3 and Twilio REST API (as messaging service) which will help in sending reminders to patients suffering from Amnesia.
The project was given as a task to be completed in a span of one week and certain criterias as the following had to be met :
- Create a (basic) web based application where one can set his phone number.
- Send an SMS every one hour except at night.
- Try resending an SMS if it fails, but retry no more than 5 times. (There is only so much you can do!).
- The web application should also log all the failed messages and tell an user for how many hours the application has been running.
#Setting Up and Usage:
-
Install all packages from requirements.txt.
-
Run the script tabledef.py to generate all required tables.
-
We will set up a couple of cron jobs on our system. A cron job can be set up on Ubuntu by the following commands. crontab -e
Append the below line to the file.
*/2 * * * * /usr/bin/python /home/arpan/gitProjects/oublier/poll_otp.py
This enables us to run the script poll_otp.py every 2 mins. -
Launch the Web App by running the app.py. By default it will get hosted o n localhost:5002 .
#Design Considerations
-
Since the patient suffers from Amnesia, it will be diffcult for him to remember his phone number. Therefore for log-in we implement a OTP authentication system. This way all the user has to know is his phone number. Once he enters the phone number , we send the OTP which is valid for 40 seconds.
-
Added feature where user can subscribe or unsubscribe the service at his will. For this he has to login. Once he un-subscribes we stop sending him messages.
-
While sending a message and deciding on the sleep time of user, it was important to know his time-zone. We take the most minimal input information i.e the user's country, use Google API to find the timezone.
#Constraints:
-
Currently the application uses Twilio's Free Trial and therefore we will have to first verify a number from out Twilio Account before sending a message.
-
The app uses Google's geocoding API which has a limit of 2500 calls per day.
-
For seeing the error logs of the users, first log in and then upon hitting th e "show logs" button, you will see a json object.
-
Validation of user inputs while sign up has not been taken care of. The appli cation will throw exception in case of invalid country-code, phone-number or country name.