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