Let's get started with low level authentication.
When I say low level authentication, what I mean is that we are going to allow a user to log in into
our application with username and plain password, and I will show you the consequences or effect of
using low level authentication and I'll provide this project for you.
Or if we want to start from scratch, you can go ahead and start with your Fresh Express server.
Since this section is all about rendering template engine or creating Express server, that's why I
have provided this one for you.
Let's focus on the main logic that is the authentication.
Well, the good news is that we are going to work on the back end first and see how we can also work
on the front end.
So let's go ahead and run this particular project and let's see the code.
So let me open my terminal here and let me make use of NPM run server.
All right.
Test connected and my DB has connected.
Let's go to the browser and let's visit localhost column 3000 and this is a page.
Well, if I click on login, I'm going to see this beautiful log in page and register as register page
and then the profile page.
We are going to fill up this profile with real user profile.
But before we get here, let's go ahead and work on the back end first.
So let's see the file that makes up this particular project.
Well, inside the public have added a set with logo and then CSIS ties.
That and next is inside my view.
I have the partial that contains my navigation links and my homepage and my login and my profile and
then register page.
If you are not familiar with how to render static files like this or render template engine, there
is a session that covers this one in details.
So now let me close this one and let's get back to the server JS file and here too for this one we have
talk about it before I have express server here and my mongoose and have connected my MongoDB here using
mongoose and I have user schema where we are going to register a user with this schema and this one
tool we have done before and the mongoose.
And for this schema we are going to register a user with user name, full name password.
Here is supposed to be string.
Sorry guys.
And next is the image for the image because we haven't talked about file upload, I've give it a default
image as that and down here I compiled my schema to form a user and here I set up my view engine using
edges and this line of code is serving my images and the CSS that and this one simply means that I want
to take the payload from postman into my server, meaning I want to pass JSON data into my server.
And this one too.
We have talked about it before and this line of code simply means that I also want to take data from
a form, for example, this one, and then I have a couple of routes.
The home route renders the index dots, edges and log in, also renders the log in templates.
Likewise register and profile.
I start.
So this is what we have.
All right.
In this video, let's get started with how we can get started with low level authentication.