1
00:00:00,750 --> 00:00:06,180
So let's talk about how Web applications work, and I'll tell you right now, I am not much of an artist,

2
00:00:06,180 --> 00:00:08,340
so my illustrations will not be great.

3
00:00:08,340 --> 00:00:12,520
But I'll tell you what I'm drawing as I draw them, otherwise you'll have no idea what it is.

4
00:00:13,200 --> 00:00:14,490
So let's start with the user.

5
00:00:14,490 --> 00:00:15,800
So we have a person right here.

6
00:00:16,140 --> 00:00:19,250
This is a person I told you I can't draw.

7
00:00:19,500 --> 00:00:22,620
And this person has a computer which I'll draw as a box.

8
00:00:22,920 --> 00:00:27,120
And this person wants to get to a website and the website is way over here somewhere.

9
00:00:27,120 --> 00:00:32,460
So I'm going to draw this as something that's not a box and that is a server.

10
00:00:32,460 --> 00:00:34,020
And this server has a Web site.

11
00:00:34,560 --> 00:00:39,570
So this person starts up their Web browser and they want to connect to this server over here on the

12
00:00:39,570 --> 00:00:40,740
right hand side of the screen.

13
00:00:41,190 --> 00:00:42,360
So they type in the URL.

14
00:00:42,360 --> 00:00:47,790
And the very first thing that happens is their computer goes off to a name server somewhere.

15
00:00:47,820 --> 00:00:50,400
So this is an S for a name server.

16
00:00:50,400 --> 00:00:58,230
And all that does is take an address like some sitcom and translate it into an IP address.

17
00:00:58,230 --> 00:01:02,180
And that IP address is unique for every device that's on the Internet.

18
00:01:02,550 --> 00:01:06,330
So this person over here has an IP address and so does the server.

19
00:01:06,330 --> 00:01:13,680
And the name server then sends back that IP address, which tells this machine, the user's computer,

20
00:01:13,680 --> 00:01:14,810
how to get to that server.

21
00:01:14,910 --> 00:01:16,080
So it sends a request.

22
00:01:16,620 --> 00:01:22,140
And that request is something as simple as show me the homepage for some site dotcom.

23
00:01:23,100 --> 00:01:27,180
So this server then does some magic behind the scenes.

24
00:01:27,180 --> 00:01:30,380
It might be just a static HTML page.

25
00:01:30,390 --> 00:01:36,810
And if that's all that it is, it just loads that page and all of the associated requests or images

26
00:01:36,810 --> 00:01:39,470
or whatever is in the page and sends it back to the user.

27
00:01:40,440 --> 00:01:46,440
But in a lot of cases, as will be the case for our project that will be building in this course, there's

28
00:01:46,440 --> 00:01:48,150
some magic that happens behind the scenes.

29
00:01:48,160 --> 00:01:57,810
So this server might have a database, it might have a cache, it might have some application that's

30
00:01:57,810 --> 00:02:01,890
running and these three things and there might be more than three.

31
00:02:01,890 --> 00:02:06,630
But these will actually do some magic to build that HTML.

32
00:02:06,630 --> 00:02:09,440
So it doesn't exist as a static file on the server somewhere.

33
00:02:09,870 --> 00:02:16,510
It actually builds the page and then sends that back after all sorts of magic happens behind the scenes.

34
00:02:17,220 --> 00:02:22,260
And this request from the user over here might send more than just a request.

35
00:02:22,260 --> 00:02:28,800
It might say, hey, here's a cookie and a cookie is just a little bit of data that has some information.

36
00:02:28,800 --> 00:02:32,970
It sends that along to the server saying this is who I am.

37
00:02:32,970 --> 00:02:37,650
Quite often you'll store information about a logged in user in a cookie, but you can store other things

38
00:02:37,650 --> 00:02:38,340
in there as well.

39
00:02:38,880 --> 00:02:41,850
So it will send that to the user, to the server.

40
00:02:41,850 --> 00:02:44,430
And the server says, oh, this is an authenticated user.

41
00:02:44,430 --> 00:02:48,900
So they have access to information that unauthenticated users might not have.

42
00:02:49,260 --> 00:02:50,580
So we'll send that back.

43
00:02:50,730 --> 00:02:56,850
And the server itself might also send instructions to the user saying, hey, build a cookie.

44
00:02:58,190 --> 00:03:04,030
For this request, so the first time this user authenticates, they might type in a username and password,

45
00:03:04,250 --> 00:03:06,200
the request goes way over the server.

46
00:03:06,200 --> 00:03:08,890
The server says, OK, you're an authenticated user.

47
00:03:09,110 --> 00:03:12,000
Here's a cookie that allows me to track who you are.

48
00:03:12,020 --> 00:03:15,170
So remember that you're authenticated, but between requests.

49
00:03:15,800 --> 00:03:19,360
So we call this the request response lifecycle.

50
00:03:19,880 --> 00:03:24,440
And it's something you need to become familiar with and you'll be doing that as we go through this course.

51
00:03:25,010 --> 00:03:31,640
But the things to remember are that a Web server is just a part of an application, a Web application.

52
00:03:31,880 --> 00:03:33,200
You might have a database.

53
00:03:33,200 --> 00:03:35,000
We will you might have a cache.

54
00:03:35,000 --> 00:03:35,810
We will not.

55
00:03:35,810 --> 00:03:40,150
But it's something you may to use later on as you become more familiar with building Web applications.

56
00:03:40,490 --> 00:03:45,320
We're definitely going to have an application and there might be more than one application on the server

57
00:03:45,860 --> 00:03:50,630
in this course will be building a monolithic application where all of the code lives in one code base.

58
00:03:51,080 --> 00:03:57,440
But there's something called the service oriented architecture where your Web application actually consists

59
00:03:57,440 --> 00:03:59,450
of a series of Web applications.

60
00:03:59,720 --> 00:04:02,080
So you might build one to authenticate users.

61
00:04:02,090 --> 00:04:07,400
You might be able build one to generate an invoice, you might build one to generate a Web page, whatever

62
00:04:07,400 --> 00:04:08,000
it may be.

63
00:04:08,300 --> 00:04:10,880
But that's beyond the scope of what we're doing in this course.

64
00:04:11,210 --> 00:04:16,430
But as time goes on and you become more familiar with building Web applications, you'll probably run

65
00:04:16,430 --> 00:04:20,180
into the service oriented architecture, sometimes called micro services.

66
00:04:20,720 --> 00:04:23,510
We're not really good at naming things in the world of computer science.

67
00:04:23,510 --> 00:04:30,050
We kind of use multiple names for the same services, but a service oriented architecture, micro services,

68
00:04:30,050 --> 00:04:33,700
there are all kinds of things that you might build as time goes on.

69
00:04:33,710 --> 00:04:35,330
But in this course, we're going to keep it simple.

70
00:04:35,330 --> 00:04:40,730
We'll build one monolithic application that takes care of generating Web pages and sending them back

71
00:04:40,730 --> 00:04:42,470
to the user, takes care of the authentication.

72
00:04:42,470 --> 00:04:44,140
It does everything we need it to do.

73
00:04:44,960 --> 00:04:47,840
So this is the request response lifecycle.

74
00:04:47,840 --> 00:04:52,820
And as we go through this course, you'll become intimately familiar with how this works.
