Advertisement
English transcript
Hi, this is Andrew again.
In this class, we're going to use a blog as a project that
we're going to use throughout the course.
And you're going to build different parts of it.
This week we're going to work on three different parts-- the
author sign up, the author log in, and the author log out.
The authors are the only ones who need to sign in and sign
out of our blog.
And the idea is that viewers can use it anonymously.
So let's go through what the user interface
looks like for this.
Here I have our web browser.
And we're going to be running the blog.
So here I'm going to first show you how to
get the blog started.
So when you download the code for this week's homework
assignment, homework problem three, you'll see a couple
different things, including a validation script
and a small run file.
In the run file, you'll see there's this mvn command that
will run it.
You can import the pom into an IDE.
So you don't necessarily need to run it using mvn.
But it should work if you run it using mvn.
So I'm going to do that.
So you can see here it started, and it started on
port 80/82.
So if we go to port 80/82 and we hit return, we can see that
we have a placeholder for our blog.
Now, we only have three URL routes that are
currently set up.
One of them is to sign up for the blog, and another one is
to log in, another one is to log out.
So I'm going to sign up for the blog right here.
And I'm going to type my user name--
erlichson.
And I'm going to give myself a password--
fubar.
And then I'm going to hit Submit.
And when I do that, you can see that I'm redirected to the
welcome page, which welcomes me by name.
And let's go to my home or to my log out page.
So if we just log out of the blog, then I can log
back into the blog.
If I type the wrong password in, it'll say invalid login.
And if I type the right password in, I go back here.
So there were three different URLs that
we implemented there--
log in, log out, and the sign up URL.
Now, I'm showing you a completed version of the
homework assignment where the code has been inserted by me
so that the whole thing actually works properly.
But you'll have to do that part yourself in the actual
assignment.
And then if you look here and see what happened internally--
I'm going to quit out of here.
I run Mongo.
I'm going to use blog.
And I'm going to look at the user's collection.
And you can see right here there's an entry in the users
collection--
id erlichson, a hash version of my password along with
[? assault ?]
in this users table.
And there's also something in the sessions table.
And the sessions code we're going to leave in for you.
But the sessions code, there's a long,
random, and my username.
So that's how the user interface works and what you
should see in database.
And so now I'm going to go over the overall structure of
this project to show you what it looks like so you know how
to work on it.
In this class, we're going to use a blog as a project that
we're going to use throughout the course.
And you're going to build different parts of it.
This week we're going to work on three different parts-- the
author sign up, the author log in, and the author log out.
The authors are the only ones who need to sign in and sign
out of our blog.
And the idea is that viewers can use it anonymously.
So let's go through what the user interface
looks like for this.
Here I have our web browser.
And we're going to be running the blog.
So here I'm going to first show you how to
get the blog started.
So when you download the code for this week's homework
assignment, homework problem three, you'll see a couple
different things, including a validation script
and a small run file.
In the run file, you'll see there's this mvn command that
will run it.
You can import the pom into an IDE.
So you don't necessarily need to run it using mvn.
But it should work if you run it using mvn.
So I'm going to do that.
So you can see here it started, and it started on
port 80/82.
So if we go to port 80/82 and we hit return, we can see that
we have a placeholder for our blog.
Now, we only have three URL routes that are
currently set up.
One of them is to sign up for the blog, and another one is
to log in, another one is to log out.
So I'm going to sign up for the blog right here.
And I'm going to type my user name--
erlichson.
And I'm going to give myself a password--
fubar.
And then I'm going to hit Submit.
And when I do that, you can see that I'm redirected to the
welcome page, which welcomes me by name.
And let's go to my home or to my log out page.
So if we just log out of the blog, then I can log
back into the blog.
If I type the wrong password in, it'll say invalid login.
And if I type the right password in, I go back here.
So there were three different URLs that
we implemented there--
log in, log out, and the sign up URL.
Now, I'm showing you a completed version of the
homework assignment where the code has been inserted by me
so that the whole thing actually works properly.
But you'll have to do that part yourself in the actual
assignment.
And then if you look here and see what happened internally--
I'm going to quit out of here.
I run Mongo.
I'm going to use blog.
And I'm going to look at the user's collection.
And you can see right here there's an entry in the users
collection--
id erlichson, a hash version of my password along with
[? assault ?]
in this users table.
And there's also something in the sessions table.
And the sessions code we're going to leave in for you.
But the sessions code, there's a long,
random, and my username.
So that's how the user interface works and what you
should see in database.
And so now I'm going to go over the overall structure of
this project to show you what it looks like so you know how
to work on it.