DEV Community

Gabi
Gabi

Posted on • Edited on

Twilio hackathon: Buy Food Locally

[Comment]: # Buy food from local vendors. I am trying to bring more features to a situation I found locally, and add the possibility to vendors to create an account and add their products and to safely order food, with a phone number as an identifier. This is a demo project only.

What I am building

Buy food from local vendors. I am trying to bring more features to a situation I found locally, and add the possibility to vendors to create an account and add their products and to safely order food, with phone number and email as an identifier. This means:

  • a web application for vendors to register themselves, and for customers to order food.

Demo Link

https://buyfoodlocallyfrontend.herokuapp.com/

Link to Code

Backend: https://github.com/gabrielaradu/BuyLocalServerSide
Frontend: https://github.com/gabrielaradu/BuyLocalFrontend

How I built it (what's the stack? did I run into issues or discover something new along the way?)

Backend: Java 11, SpringBoot, Flyway, Hibernate, Postgresql, Twilio APIs: ServerSide, SMS, Phone Number Validation
JavaScript, ES6, React.js, CSS, Html

Additional Resources/Info

Progress Gists:
9.04.2020 ->
Working on my idea for #twiliohackathon hackathon (from home clearly).
Today: new vendor account v1. No password yet, need to update db structure in next ticket. This is the code if you want to take a look: https://tinyurl.com/untyhz8
Must create test profile to stop mucking my db.

10.04.2020 -> 1.Created CRUD endpoints for products.
PR here https://tinyurl.com/uo553tu
Code coverage 100%. I do wonder how long I can keep it this high.
WIP to validate a vendor account phone nr using Twilio SDK.

11.04.2020 -> Verify Vendor Account.
Added possibility to verify a number, send an SMS with a code to that number and create endpoint which checks if the message code matches what is in the database.
PR: https://tinyurl.com/uy5y9a6

13.04.2020 -> Added possibility to create a password after vendor verified their account. Working on security still.
Difficult to concentrate today.

14.04.2020 -> Finished adding JWT, attach a password to a vendor account and login endpoint. Fixed existing failing tests and add some more unit and integration. Two tests that use Test Twilio Creds fail.
PR: https://tinyurl.com/rl4tzah

Need to move to create Frontend client now.
17.04.2020 -> Show list of products
PR: https://github.com/gabrielaradu/BuyLocalFrontend/pull/1
No tests, and weird-looking UI. Need to fix this.

24.04.2020 ->
Finally did the user story for ordering products from two vendors.
Step 1: add your customer phone number. That's how you will get payment link and info about order.
Alt Text

Next, choose what you want to buy. Dummy data (flyway migrations on backend) has two vendors.
Alt Text

Vendor clicks the accept or denies order and customer will receive an automatic SMS with the final response.

A confirmation dialogue will appear if all is good on the server side. By this time, vendors received SMS messages with #twilio API with the customer order.

Alt Text

Alt Text

On the server-side I have implemented logic to create a vendor account and verify it (by SMS of course) using #twilio API, for this demo #twiliohackathon project I think it's enough. I need to redo and add more tests now.

I enjoyed this challenge a lot, reminded that I want to do better on Frontend and enjoy tests more.

Happy Coding.

Top comments (4)

Collapse
 
savagepixie profile image
SavagePixie

Hey, that looks like a neat project! Are you planning on hosting it somewhere to make it available to your local area when it's finished?

Collapse
 
gabriela profile image
Gabi • Edited

Thank you for the question. I was thinking .... of hosting it on Heroku using free dynos but as a demo. I have to take into consideration GDPR, and it's more complicated on my end. If anyone locally wants the project on their end I can help there.

Collapse
 
lizziepika profile image
Lizzie Siegle

Love this idea, very relevant and useful!

Collapse
 
gabriela profile image
Gabi

Thank you. I want this idea in practice to be honest.