Python-powered Chat Apps with Twilio and SendGrid Transcripts
Chapter: Creating the admin backend for Flask
Lecture: Remember the admin section?
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
At the beginning of the course, we went through an end to end Walk through, the app that we're going to build and you may remember it had this
0:07
admin back end section. But let's go through it one more time to remind you of exactly what we're going to build during this chapter.
0:14
The whole time I've had in our style of the website down at the bottom, this little admin section, and to see how it says /admin,
0:20
you click it in our demo site right now, it will go no where. It'll just crash. But in the finished version that we're building towards,
0:28
we have it right here. Check this out. So the idea is we've gone through WhatsApp as a customer.
0:34
We've selected the type of cake we wanted from the menu with the chat interaction that we've set up at Twilio studio.
0:41
We've priced the cake, and then when they placed the order that goes through the API that we built in our flask application and that saves it to the
0:49
database, Well, that was great. But then what? We actually have to make the cake. How do we know whether we should make a cake and what kind of cake we
0:57
should make. Well, we need an admin back end, and we're gonna, of course, create a simplified version just enough for you to get a sense of like,
1:04
how you would work with this. So we're going to show, say, the order ID, but not necessarily things like the exact flavor of what they wanted
1:12
and so on, since we're not really baking the cake. But the idea is, here is the admin back end that the Bakers would use
1:18
And it would just show them the new orders that are not yet fulfilled and the ones that have already been fulfilled.
1:24
So here you can see these are fulfilled, and it has the date in which that was done. And here's a new one that was open. And if we click this button,
1:32
what it's going to do is it will mark in the database that it was fulfilled
1:35
and it will send a WhatsApp message over to the customer at their WhatsApp contact
1:41
Remember, they got a confirmation in their WhatsApp with the order ID. But what we're going to do is we're actually going to let them know their cake
1:50
is now ready for pickup. If we click this fulfill button here, what should happen is we should update the record in the database to market as fulfilled
1:58
Set the date on which it was completed. Flip the order status from open to fulfilled.
2:04
And in the final version, we're going to send a WhatsApp message to let the user know. Hey, your cake is ready for pickup, you ordered a few days
2:12
ago. It's ready. Please come get it. If we go and click this, see, it's updated it and wait for the WhatsApp message.
2:20
Make sure WhatsApp is running. And there it is. Your case Order Status code is ready for pickup.
2:26
Well, awesome. We got our message sent all the way back to the user through twilio to their WhatsApp account.
2:34
So that's what we're going to build out during this chapter. We're going to build a section that shows this data that allows us to indicate whether
2:41
it's open or fulfilled and actually flip it over to fulfilled. We're gonna wait to do the direct WhatsApp messaging in another chapter,
2:49
but this UI and data element this database exchange that we're doing here, thats we are going to focus on for this chapter.