So let's talk about how Web applications work, and I'll tell you right now, I am not much of an artist,
so my illustrations will not be great.
But I'll tell you what I'm drawing as I draw them, otherwise you'll have no idea what it is.
So let's start with the user.
So we have a person right here.
This is a person I told you I can't draw.
And this person has a computer which I'll draw as a box.
And this person wants to get to a website and the website is way over here somewhere.
So I'm going to draw this as something that's not a box and that is a server.
And this server has a Web site.
So this person starts up their Web browser and they want to connect to this server over here on the
right hand side of the screen.
So they type in the URL.
And the very first thing that happens is their computer goes off to a name server somewhere.
So this is an S for a name server.
And all that does is take an address like some sitcom and translate it into an IP address.
And that IP address is unique for every device that's on the Internet.
So this person over here has an IP address and so does the server.
And the name server then sends back that IP address, which tells this machine, the user's computer,
how to get to that server.
So it sends a request.
And that request is something as simple as show me the homepage for some site dotcom.
So this server then does some magic behind the scenes.
It might be just a static HTML page.
And if that's all that it is, it just loads that page and all of the associated requests or images
or whatever is in the page and sends it back to the user.
But in a lot of cases, as will be the case for our project that will be building in this course, there's
some magic that happens behind the scenes.
So this server might have a database, it might have a cache, it might have some application that's
running and these three things and there might be more than three.
But these will actually do some magic to build that HTML.
So it doesn't exist as a static file on the server somewhere.
It actually builds the page and then sends that back after all sorts of magic happens behind the scenes.
And this request from the user over here might send more than just a request.
It might say, hey, here's a cookie and a cookie is just a little bit of data that has some information.
It sends that along to the server saying this is who I am.
Quite often you'll store information about a logged in user in a cookie, but you can store other things
in there as well.
So it will send that to the user, to the server.
And the server says, oh, this is an authenticated user.
So they have access to information that unauthenticated users might not have.
So we'll send that back.
And the server itself might also send instructions to the user saying, hey, build a cookie.
For this request, so the first time this user authenticates, they might type in a username and password,
the request goes way over the server.
The server says, OK, you're an authenticated user.
Here's a cookie that allows me to track who you are.
So remember that you're authenticated, but between requests.
So we call this the request response lifecycle.
And it's something you need to become familiar with and you'll be doing that as we go through this course.
But the things to remember are that a Web server is just a part of an application, a Web application.
You might have a database.
We will you might have a cache.
We will not.
But it's something you may to use later on as you become more familiar with building Web applications.
We're definitely going to have an application and there might be more than one application on the server
in this course will be building a monolithic application where all of the code lives in one code base.
But there's something called the service oriented architecture where your Web application actually consists
of a series of Web applications.
So you might build one to authenticate users.
You might be able build one to generate an invoice, you might build one to generate a Web page, whatever
it may be.
But that's beyond the scope of what we're doing in this course.
But as time goes on and you become more familiar with building Web applications, you'll probably run
into the service oriented architecture, sometimes called micro services.
We're not really good at naming things in the world of computer science.
We kind of use multiple names for the same services, but a service oriented architecture, micro services,
there are all kinds of things that you might build as time goes on.
But in this course, we're going to keep it simple.
We'll build one monolithic application that takes care of generating Web pages and sending them back
to the user, takes care of the authentication.
It does everything we need it to do.
So this is the request response lifecycle.
And as we go through this course, you'll become intimately familiar with how this works.