﻿1
00:00:01,200 --> 00:00:04,530
‫Welcome back to the last video of the section.

2
00:00:04,530 --> 00:00:07,950
‫And in this section we kind of finished our project,

3
00:00:07,950 --> 00:00:11,350
‫both the API and also the rendered website,

4
00:00:11,350 --> 00:00:12,910
‫at least for now.

5
00:00:12,910 --> 00:00:17,180
‫So once again, congratulations for reaching this point

6
00:00:17,180 --> 00:00:20,970
‫and for sitting through over 30 hours of video,

7
00:00:20,970 --> 00:00:22,573
‫always listening to my voice.

8
00:00:23,670 --> 00:00:25,840
‫Anyway in this last video,

9
00:00:25,840 --> 00:00:28,260
‫I wanted to quickly address some topics

10
00:00:28,260 --> 00:00:31,650
‫that we could've added to the API and to the website,

11
00:00:31,650 --> 00:00:34,810
‫and basically leave them for you as challenges

12
00:00:34,810 --> 00:00:35,863
‫if you'd like.

13
00:00:37,350 --> 00:00:40,160
‫So we could've added some more business logic

14
00:00:40,160 --> 00:00:42,500
‫to our project, for example,

15
00:00:42,500 --> 00:00:46,310
‫adding a restriction that users can only review a tour

16
00:00:46,310 --> 00:00:47,910
‫that they have actually booked.

17
00:00:47,910 --> 00:00:50,940
‫And that would make a lot of sense, right?

18
00:00:50,940 --> 00:00:53,510
‫So I want you to try that out on your own

19
00:00:53,510 --> 00:00:55,320
‫if you feel like it.

20
00:00:55,320 --> 00:00:58,450
‫Now these challenges I'm not gonna solve myself,

21
00:00:58,450 --> 00:01:02,620
‫unless there is really a lot of demand for one of them.

22
00:01:02,620 --> 00:01:04,190
‫And I've actually left these kind

23
00:01:04,190 --> 00:01:06,650
‫of more complicated challenges for students

24
00:01:06,650 --> 00:01:09,950
‫to really do on their own in my other courses,

25
00:01:09,950 --> 00:01:14,150
‫and I've really seen some creative results in many cases.

26
00:01:14,150 --> 00:01:17,160
‫So I hope you also try out some of them.

27
00:01:17,160 --> 00:01:19,170
‫Now anyway next up,

28
00:01:19,170 --> 00:01:22,180
‫you could also implement some nested booking routes,

29
00:01:22,180 --> 00:01:25,130
‫for example, getting all the bookings for a certain tour

30
00:01:25,130 --> 00:01:27,940
‫and getting all the bookings for a certain user,

31
00:01:27,940 --> 00:01:30,080
‫so based on ids.

32
00:01:30,080 --> 00:01:33,690
‫Also you could dramatically improve the tour dates,

33
00:01:33,690 --> 00:01:37,050
‫and what I mean by that is that you could add a participants

34
00:01:37,050 --> 00:01:40,230
‫and a soldOut field to each of the dates.

35
00:01:40,230 --> 00:01:42,420
‫And the date then becomes kind of like

36
00:01:42,420 --> 00:01:44,770
‫an instance of the tour.

37
00:01:44,770 --> 00:01:47,300
‫Then when a user actually books a tour,

38
00:01:47,300 --> 00:01:49,970
‫they need to select one of the available dates,

39
00:01:49,970 --> 00:01:51,860
‫and then your booking in one of the dates

40
00:01:51,860 --> 00:01:54,070
‫will then increase the number of participants

41
00:01:54,070 --> 00:01:56,910
‫in the date until it is booked out,

42
00:01:56,910 --> 00:01:59,950
‫so basically when participants is greater

43
00:01:59,950 --> 00:02:02,000
‫than the maximum group size.

44
00:02:02,000 --> 00:02:04,300
‫Now finally of course when the user wants

45
00:02:04,300 --> 00:02:06,760
‫to book a certain tour on a certain date,

46
00:02:06,760 --> 00:02:09,800
‫you need to check if the tour is still available

47
00:02:09,800 --> 00:02:11,450
‫on that selected date.

48
00:02:11,450 --> 00:02:12,290
‫Okay?

49
00:02:12,290 --> 00:02:15,480
‫So that's actually quite a sophisticated challenge

50
00:02:15,480 --> 00:02:18,180
‫but also a really fun one to implement,

51
00:02:18,180 --> 00:02:21,480
‫and really would add some significant business logic

52
00:02:21,480 --> 00:02:22,883
‫to this project.

53
00:02:24,100 --> 00:02:26,040
‫Finally, you could also implement some

54
00:02:26,040 --> 00:02:28,140
‫of the advanced authentication features

55
00:02:28,140 --> 00:02:30,480
‫that we already talked about a bit before

56
00:02:30,480 --> 00:02:32,150
‫in the security section.

57
00:02:32,150 --> 00:02:35,480
‫For example, you could confirm a user email address

58
00:02:35,480 --> 00:02:38,360
‫basically by sending them an email with a link

59
00:02:38,360 --> 00:02:39,570
‫that they need to click,

60
00:02:39,570 --> 00:02:41,160
‫and only after the click,

61
00:02:41,160 --> 00:02:44,540
‫the user is then really registered in the application

62
00:02:44,540 --> 00:02:47,450
‫and can do stuff like purchasing tours.

63
00:02:47,450 --> 00:02:49,690
‫Also you could keep users logged in

64
00:02:49,690 --> 00:02:52,400
‫with something called refresh tokens.

65
00:02:52,400 --> 00:02:55,130
‫And that's again a bit complicated to implement

66
00:02:55,130 --> 00:02:57,900
‫but if you Google around about how it works,

67
00:02:57,900 --> 00:03:00,330
‫then I'm sure you can find a good solution

68
00:03:00,330 --> 00:03:03,770
‫or also you can even come up with one on your own.

69
00:03:03,770 --> 00:03:07,070
‫Finally, you could also implement two-factor authentication,

70
00:03:07,070 --> 00:03:10,360
‫but this one is taking it even one step further.

71
00:03:10,360 --> 00:03:12,360
‫So basically when a user logs in,

72
00:03:12,360 --> 00:03:15,200
‫they then receive something like a text message

73
00:03:15,200 --> 00:03:17,920
‫on their phone with a code that they need to put

74
00:03:17,920 --> 00:03:19,670
‫into the application in order

75
00:03:19,670 --> 00:03:23,370
‫to be authenticated after that second step.

76
00:03:23,370 --> 00:03:25,210
‫So these are some nice challenges

77
00:03:25,210 --> 00:03:28,140
‫that you could really implement on the API site,

78
00:03:28,140 --> 00:03:29,463
‫basically of the project.

79
00:03:30,400 --> 00:03:34,000
‫But also there's stuff that you can do on the website.

80
00:03:34,000 --> 00:03:37,270
‫For example, you could implement the sign up form,

81
00:03:37,270 --> 00:03:40,380
‫which should be very similar to the login form.

82
00:03:40,380 --> 00:03:43,720
‫So I didn't do that really because it's so similar

83
00:03:43,720 --> 00:03:44,790
‫to the login form,

84
00:03:44,790 --> 00:03:48,540
‫and so I didn't want to waste any time by doing that.

85
00:03:48,540 --> 00:03:50,930
‫But of course you can go ahead and implement

86
00:03:50,930 --> 00:03:52,430
‫that one as well.

87
00:03:52,430 --> 00:03:55,680
‫Then another nice thing that you could do on the website

88
00:03:55,680 --> 00:03:57,980
‫is that on the tour detail page,

89
00:03:57,980 --> 00:03:59,340
‫you can allow a user

90
00:03:59,340 --> 00:04:01,890
‫to add a review directly on the website,

91
00:04:01,890 --> 00:04:05,010
‫but only if the user has taken that tour.

92
00:04:05,010 --> 00:04:07,760
‫So you would have to check if the currently logged-in user

93
00:04:07,760 --> 00:04:10,270
‫has actually booked the current tour,

94
00:04:10,270 --> 00:04:13,690
‫and also if the time of the tour has already passed.

95
00:04:13,690 --> 00:04:16,650
‫And if so, then you can add a form to the page

96
00:04:16,650 --> 00:04:18,690
‫where the user can add a new review,

97
00:04:18,690 --> 00:04:21,920
‫for example, using our review API.

98
00:04:21,920 --> 00:04:24,600
‫Or also, and this one is a bit related,

99
00:04:24,600 --> 00:04:26,990
‫you can hide the entire booking section

100
00:04:26,990 --> 00:04:30,480
‫on the same tour detail page if the current user

101
00:04:30,480 --> 00:04:32,620
‫has booked the tour.

102
00:04:32,620 --> 00:04:33,810
‫Okay.

103
00:04:33,810 --> 00:04:36,250
‫This would then prevent the same user from booking

104
00:04:36,250 --> 00:04:37,850
‫the same tour twice.

105
00:04:37,850 --> 00:04:40,990
‫And then since you're already doing it on the front end,

106
00:04:40,990 --> 00:04:43,350
‫you should also prevent duplicate bookings

107
00:04:43,350 --> 00:04:45,981
‫on the back end in your model.

108
00:04:45,981 --> 00:04:47,660
‫That will actually be very similar

109
00:04:47,660 --> 00:04:51,380
‫to preventing duplicate reviews from the same user.

110
00:04:51,380 --> 00:04:52,860
‫Okay.

111
00:04:52,860 --> 00:04:54,160
‫Also, you could implement

112
00:04:54,160 --> 00:04:57,250
‫a very nice like tour functionality.

113
00:04:57,250 --> 00:04:59,590
‫So where you have something like a like

114
00:04:59,590 --> 00:05:01,720
‫or a heart button on the tour,

115
00:05:01,720 --> 00:05:03,620
‫and then when the user clicks it,

116
00:05:03,620 --> 00:05:06,120
‫it gets added to their favorites.

117
00:05:06,120 --> 00:05:07,340
‫And then on the website,

118
00:05:07,340 --> 00:05:11,940
‫you could have a favorites page or just a favorite panel

119
00:05:11,940 --> 00:05:14,860
‫where the user can see all of their favorite tours.

120
00:05:14,860 --> 00:05:17,210
‫So that's not really a hard one

121
00:05:17,210 --> 00:05:19,713
‫but I think a very fun one to implement.

122
00:05:20,900 --> 00:05:23,230
‫Next up on the user account page,

123
00:05:23,230 --> 00:05:25,610
‫you could implement the My Reviews page,

124
00:05:25,610 --> 00:05:27,870
‫which already has a link right now,

125
00:05:27,870 --> 00:05:30,410
‫and on that page the user could then see

126
00:05:30,410 --> 00:05:34,730
‫and maybe also edit and delete all of their own reviews.

127
00:05:34,730 --> 00:05:36,660
‫Now if you know React,

128
00:05:36,660 --> 00:05:38,900
‫then this would really be an amazing way

129
00:05:38,900 --> 00:05:42,580
‫to use the Natours API and also train your React skills

130
00:05:42,580 --> 00:05:43,940
‫at the same time.

131
00:05:43,940 --> 00:05:46,260
‫And once you're doing that with React,

132
00:05:46,260 --> 00:05:49,140
‫you could actually recreate the entire page

133
00:05:49,140 --> 00:05:51,790
‫as a single page application with React

134
00:05:51,790 --> 00:05:53,290
‫or something like this.

135
00:05:53,290 --> 00:05:57,010
‫So like Angular or Vue would also work for this.

136
00:05:57,010 --> 00:05:57,843
‫Right.

137
00:05:57,843 --> 00:06:00,626
‫So that would be really great if you would do that,

138
00:06:00,626 --> 00:06:03,933
‫and I would actually really love to see this implemented.

139
00:06:04,770 --> 00:06:07,310
‫Finally, for the administrators,

140
00:06:07,310 --> 00:06:09,800
‫you could implement the Manage pages,

141
00:06:09,800 --> 00:06:13,180
‫where the admins can then create, read, update,

142
00:06:13,180 --> 00:06:15,300
‫and delete all the resources,

143
00:06:15,300 --> 00:06:18,923
‫so all the tours, users, reviews, and bookings.

144
00:06:19,860 --> 00:06:23,130
‫Once more, React would maybe be a good fit for this,

145
00:06:23,130 --> 00:06:25,770
‫or if not, then just regular Javascript

146
00:06:25,770 --> 00:06:28,480
‫on the front end would also work really well too,

147
00:06:28,480 --> 00:06:33,270
‫for example, update all of these resources using Ajax calls.

148
00:06:33,270 --> 00:06:36,530
‫So there really is a ton of stuff that you could implement

149
00:06:36,530 --> 00:06:39,070
‫in order to still improve our project

150
00:06:39,070 --> 00:06:41,030
‫and our website even more.

151
00:06:41,030 --> 00:06:42,180
‫Right?

152
00:06:42,180 --> 00:06:43,860
‫And I'm sure you could even come up

153
00:06:43,860 --> 00:06:46,200
‫with still some other stuff here.

154
00:06:46,200 --> 00:06:48,450
‫So again, it would be really awesome

155
00:06:48,450 --> 00:06:52,120
‫to see some of these features actually implemented by you.

156
00:06:52,120 --> 00:06:54,910
‫And if you do one of them or even more,

157
00:06:54,910 --> 00:06:57,240
‫then just make sure to share your result

158
00:06:57,240 --> 00:06:59,153
‫in the course Q&A section.

159
00:07:00,120 --> 00:07:04,190
‫Anyway, that's it for this video and for this section

160
00:07:04,190 --> 00:07:07,260
‫and also almost for this course.

161
00:07:07,260 --> 00:07:10,750
‫So great job once more and now next up,

162
00:07:10,750 --> 00:07:13,620
‫all there is really left to do is to prepare

163
00:07:13,620 --> 00:07:15,460
‫the application for deployment,

164
00:07:15,460 --> 00:07:19,500
‫and then to actually deploy it onto a live production server

165
00:07:19,500 --> 00:07:21,673
‫to really share our project with the world.

