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