Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Preview
Start a free Courses trial
to watch this video
We'll be using Express and MongoDB to add user authentication to a web application named Bookworm — a website for book lovers. In this video, you'll see the completed project that you'll build including a registration form, login form, and a password protected profile page.
We'll be using Express and MongoDB
to build our authentication system.
0:00
Express is a popular web application
framework written in Node.js.
0:05
It provides many features you'll need
when creating a web application.
0:09
MongoDB is a document-based
NoSQL database.
0:13
We'll use Express to manage
the web application and
0:18
Mongo to store user information
like email and password.
0:21
In this course, we'll take
a basic website and add a way for
0:25
users to create an account log in and
access a password protected page.
0:28
Let's take a look at
the completed application so
0:33
you can see what you'll have created
by the end of this course.
0:35
Here's the beginning of a web
application called Bookworm.
0:39
It's for lovers of books.
0:42
Well okay the site isn't
a real web application.
0:43
It's just the skeleton of a site that
I'll use to teach you how to add user
0:45
authentication.
0:49
The home page is simple.
0:51
Here's a nav bar with various links
to other pages on the website and
0:52
a button to log in.
0:56
If we click on links to other pages,
0:58
you'll notice that some are accessible
without logging in, like About Us and
1:00
Contact Us, but the MY PROFILE
page here requires me to log in.
1:04
Now, but before I can do that,
I need to create an account,
1:09
need to provide some information like my
name, my e-mail address, my favorite book.
1:12
Password, confirm that password and
then click Sign up.
1:19
This creates a new user and
logs me into the site.
1:25
When I visit the My Profile page
you'll see that the web application
1:29
knows who I am.
1:32
But if I log out, visit My Profile I
no longer see my profile information.
1:34
That's because I'm no longer
an authenticated user.
1:40
But I simply log in again, And
there's all my information.
1:43
That's the basics of what we'll
be building in this course.
1:50
In the next video I'll show you how to set
up the project so you can follow along.
1:55
I'll also step you through
the structure of the project.
1:58
Let's go.
2:01
You need to sign up for Treehouse in order to download course files.
Sign up