1
00:00:09,130 --> 00:00:13,780
Let's get started with low level authentication.

2
00:00:14,260 --> 00:00:22,060
When I say low level authentication, what I mean is that we are going to allow a user to log in into

3
00:00:22,060 --> 00:00:30,670
our application with username and plain password, and I will show you the consequences or effect of

4
00:00:30,670 --> 00:00:36,370
using low level authentication and I'll provide this project for you.

5
00:00:36,370 --> 00:00:42,010
Or if we want to start from scratch, you can go ahead and start with your Fresh Express server.

6
00:00:42,040 --> 00:00:47,890
Since this section is all about rendering template engine or creating Express server, that's why I

7
00:00:47,890 --> 00:00:50,380
have provided this one for you.

8
00:00:50,440 --> 00:00:55,120
Let's focus on the main logic that is the authentication.

9
00:00:55,240 --> 00:01:03,460
Well, the good news is that we are going to work on the back end first and see how we can also work

10
00:01:03,460 --> 00:01:04,819
on the front end.

11
00:01:04,840 --> 00:01:09,640
So let's go ahead and run this particular project and let's see the code.

12
00:01:10,000 --> 00:01:19,120
So let me open my terminal here and let me make use of NPM run server.

13
00:01:20,470 --> 00:01:21,090
All right.

14
00:01:21,100 --> 00:01:24,250
Test connected and my DB has connected.

15
00:01:24,640 --> 00:01:31,540
Let's go to the browser and let's visit localhost column 3000 and this is a page.

16
00:01:31,660 --> 00:01:40,390
Well, if I click on login, I'm going to see this beautiful log in page and register as register page

17
00:01:40,390 --> 00:01:42,810
and then the profile page.

18
00:01:42,820 --> 00:01:47,450
We are going to fill up this profile with real user profile.

19
00:01:47,470 --> 00:01:52,480
But before we get here, let's go ahead and work on the back end first.

20
00:01:52,570 --> 00:01:56,380
So let's see the file that makes up this particular project.

21
00:01:56,410 --> 00:02:02,670
Well, inside the public have added a set with logo and then CSIS ties.

22
00:02:02,680 --> 00:02:05,460
That and next is inside my view.

23
00:02:05,470 --> 00:02:13,120
I have the partial that contains my navigation links and my homepage and my login and my profile and

24
00:02:13,120 --> 00:02:14,530
then register page.

25
00:02:14,680 --> 00:02:20,500
If you are not familiar with how to render static files like this or render template engine, there

26
00:02:20,500 --> 00:02:23,640
is a session that covers this one in details.

27
00:02:23,650 --> 00:02:31,660
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

28
00:02:31,660 --> 00:02:39,010
talk about it before I have express server here and my mongoose and have connected my MongoDB here using

29
00:02:39,010 --> 00:02:45,250
mongoose and I have user schema where we are going to register a user with this schema and this one

30
00:02:45,250 --> 00:02:48,370
tool we have done before and the mongoose.

31
00:02:48,490 --> 00:02:54,310
And for this schema we are going to register a user with user name, full name password.

32
00:02:54,640 --> 00:02:55,980
Here is supposed to be string.

33
00:02:55,990 --> 00:02:57,010
Sorry guys.

34
00:02:57,100 --> 00:03:03,880
And next is the image for the image because we haven't talked about file upload, I've give it a default

35
00:03:03,880 --> 00:03:13,630
image as that and down here I compiled my schema to form a user and here I set up my view engine using

36
00:03:13,630 --> 00:03:22,990
edges and this line of code is serving my images and the CSS that and this one simply means that I want

37
00:03:22,990 --> 00:03:29,440
to take the payload from postman into my server, meaning I want to pass JSON data into my server.

38
00:03:29,440 --> 00:03:30,490
And this one too.

39
00:03:30,520 --> 00:03:36,670
We have talked about it before and this line of code simply means that I also want to take data from

40
00:03:36,670 --> 00:03:41,080
a form, for example, this one, and then I have a couple of routes.

41
00:03:41,080 --> 00:03:49,390
The home route renders the index dots, edges and log in, also renders the log in templates.

42
00:03:49,390 --> 00:03:52,660
Likewise register and profile.

43
00:03:52,690 --> 00:03:53,290
I start.

44
00:03:53,290 --> 00:03:55,630
So this is what we have.

45
00:03:55,720 --> 00:03:56,350
All right.

46
00:03:56,350 --> 00:04:03,100
In this video, let's get started with how we can get started with low level authentication.

