- Python/Django + Django rest framework
- Celery/Redis
- React + axios
- Google SMTP (Email client)
- Twilio (Automated messaging service)
- Fire up a terminal, and run (preferably use a virtualenv)
pip3 install -r requirements.txt
- Initialise the database
python3 manage.py makemigrations
python3 manage.py migrate
- Populate the database with mock data, also, alter the emails, names, phones of host to your liking. If you want a GUI, open localhost:8000/admin to manually add User/Host there itself.
python3 populate_db.py
- Start the Django server
python3 manage.py runserver
- Make sure you have celery and redis-cli installed, then run the celery worker(queue) at a second terminal
celery worker -A innovaccer worker -l info
- Install the npm packages and start the react client at a third terminal
cd innovaccer-frontend
npm install
npm start
- Try submitting the form, observe the output on the celery terminal, and your email address and phone numbers for messages.
-
Observe the task received in the terminal along with the timings scheduled.
-
The Host should receive the phone number in a while as well.
For obvious reasons, I've excluded my keys and settings from config.ini file, add your twilio key,gmail account to use these features. Also, change file name to config_prod.ini afterwards.
I First set out to create an endpoint which accepts submission of the visitor form, upon submission, the endpoint triggers two tasks, one to send the host information about the visitor ASAP, and one to send the Visitor information about the visit when the meet is over. To schedule the tasks, I used celery backed with redis store for asynchronous calls to my send_alert method. I also made the host unavailable and available as per his/her meet with a visitor. I used the trial version of twilio which allowed me to send emails to trusted numbers which I have to configure manually. This is easily handled to scale by upgrading twilio. For simplicity, I used my personal mail with Google SMTP for mail purposes. I initially thought of using Amazon SES with boto3 for the simplicity it offers, but due to technical issues with my amazon account, I was unable to avail that option, so stuck with the former. I'm a big fan of integrating Django Rest Framework with React, as you would discover if you click here
Because my exams are ongoing, I was not able to fully complete all the features I had planned, so I'll list them here :
- ✘ Loading Screen for React after submission, and better alerts.
- ✅ Making Host unavailable after form submission and making them available after check out of current visitor.
- ✘ Letting user know of closest time when a host will be free.