‫Welcome back to the last video of the section.
‫And in this section we kind of finished our project,
‫both the API and also the rendered website,
‫at least for now.
‫So once again, congratulations for reaching this point
‫and for sitting through over 30 hours of video,
‫always listening to my voice.
‫Anyway in this last video,
‫I wanted to quickly address some topics
‫that we could've added to the API and to the website,
‫and basically leave them for you as challenges
‫if you'd like.
‫So we could've added some more business logic
‫to our project, for example,
‫adding a restriction that users can only review a tour
‫that they have actually booked.
‫And that would make a lot of sense, right?
‫So I want you to try that out on your own
‫if you feel like it.
‫Now these challenges I'm not gonna solve myself,
‫unless there is really a lot of demand for one of them.
‫And I've actually left these kind
‫of more complicated challenges for students
‫to really do on their own in my other courses,
‫and I've really seen some creative results in many cases.
‫So I hope you also try out some of them.
‫Now anyway next up,
‫you could also implement some nested booking routes,
‫for example, getting all the bookings for a certain tour
‫and getting all the bookings for a certain user,
‫so based on ids.
‫Also you could dramatically improve the tour dates,
‫and what I mean by that is that you could add a participants
‫and a soldOut field to each of the dates.
‫And the date then becomes kind of like
‫an instance of the tour.
‫Then when a user actually books a tour,
‫they need to select one of the available dates,
‫and then your booking in one of the dates
‫will then increase the number of participants
‫in the date until it is booked out,
‫so basically when participants is greater
‫than the maximum group size.
‫Now finally of course when the user wants
‫to book a certain tour on a certain date,
‫you need to check if the tour is still available
‫on that selected date.
‫Okay?
‫So that's actually quite a sophisticated challenge
‫but also a really fun one to implement,
‫and really would add some significant business logic
‫to this project.
‫Finally, you could also implement some
‫of the advanced authentication features
‫that we already talked about a bit before
‫in the security section.
‫For example, you could confirm a user email address
‫basically by sending them an email with a link
‫that they need to click,
‫and only after the click,
‫the user is then really registered in the application
‫and can do stuff like purchasing tours.
‫Also you could keep users logged in
‫with something called refresh tokens.
‫And that's again a bit complicated to implement
‫but if you Google around about how it works,
‫then I'm sure you can find a good solution
‫or also you can even come up with one on your own.
‫Finally, you could also implement two-factor authentication,
‫but this one is taking it even one step further.
‫So basically when a user logs in,
‫they then receive something like a text message
‫on their phone with a code that they need to put
‫into the application in order
‫to be authenticated after that second step.
‫So these are some nice challenges
‫that you could really implement on the API site,
‫basically of the project.
‫But also there's stuff that you can do on the website.
‫For example, you could implement the sign up form,
‫which should be very similar to the login form.
‫So I didn't do that really because it's so similar
‫to the login form,
‫and so I didn't want to waste any time by doing that.
‫But of course you can go ahead and implement
‫that one as well.
‫Then another nice thing that you could do on the website
‫is that on the tour detail page,
‫you can allow a user
‫to add a review directly on the website,
‫but only if the user has taken that tour.
‫So you would have to check if the currently logged-in user
‫has actually booked the current tour,
‫and also if the time of the tour has already passed.
‫And if so, then you can add a form to the page
‫where the user can add a new review,
‫for example, using our review API.
‫Or also, and this one is a bit related,
‫you can hide the entire booking section
‫on the same tour detail page if the current user
‫has booked the tour.
‫Okay.
‫This would then prevent the same user from booking
‫the same tour twice.
‫And then since you're already doing it on the front end,
‫you should also prevent duplicate bookings
‫on the back end in your model.
‫That will actually be very similar
‫to preventing duplicate reviews from the same user.
‫Okay.
‫Also, you could implement
‫a very nice like tour functionality.
‫So where you have something like a like
‫or a heart button on the tour,
‫and then when the user clicks it,
‫it gets added to their favorites.
‫And then on the website,
‫you could have a favorites page or just a favorite panel
‫where the user can see all of their favorite tours.
‫So that's not really a hard one
‫but I think a very fun one to implement.
‫Next up on the user account page,
‫you could implement the My Reviews page,
‫which already has a link right now,
‫and on that page the user could then see
‫and maybe also edit and delete all of their own reviews.
‫Now if you know React,
‫then this would really be an amazing way
‫to use the Natours API and also train your React skills
‫at the same time.
‫And once you're doing that with React,
‫you could actually recreate the entire page
‫as a single page application with React
‫or something like this.
‫So like Angular or Vue would also work for this.
‫Right.
‫So that would be really great if you would do that,
‫and I would actually really love to see this implemented.
‫Finally, for the administrators,
‫you could implement the Manage pages,
‫where the admins can then create, read, update,
‫and delete all the resources,
‫so all the tours, users, reviews, and bookings.
‫Once more, React would maybe be a good fit for this,
‫or if not, then just regular Javascript
‫on the front end would also work really well too,
‫for example, update all of these resources using Ajax calls.
‫So there really is a ton of stuff that you could implement
‫in order to still improve our project
‫and our website even more.
‫Right?
‫And I'm sure you could even come up
‫with still some other stuff here.
‫So again, it would be really awesome
‫to see some of these features actually implemented by you.
‫And if you do one of them or even more,
‫then just make sure to share your result
‫in the course Q&A section.
‫Anyway, that's it for this video and for this section
‫and also almost for this course.
‫So great job once more and now next up,
‫all there is really left to do is to prepare
‫the application for deployment,
‫and then to actually deploy it onto a live production server
‫to really share our project with the world.