WEBVTT

00:03.730 --> 00:04.600
Hey, did everyone.

00:04.660 --> 00:05.170
They sure.

00:05.170 --> 00:07.060
And welcome to another section.

00:07.390 --> 00:11.650
Now, in the previous section, we have a lot of discussion majorly about the theory that how we are

00:11.650 --> 00:13.960
going to actually make this project up and running.

00:13.990 --> 00:17.830
We came up with the three models that we discussed in detail, in depth in this one.

00:17.830 --> 00:19.810
We're going to get started with the code itself.

00:19.840 --> 00:25.300
So first thing is we need to design a simple basic app from scratch, of course, and we need to create

00:25.300 --> 00:26.290
some folders in that.

00:26.290 --> 00:28.000
That's exactly what we'll be doing.

00:28.120 --> 00:32.440
After that, we'll be installing some of the libraries, majority of the libraries we have already explored

00:32.440 --> 00:33.820
in the course throughout the journey.

00:33.820 --> 00:35.370
There is just only new one.

00:35.380 --> 00:37.870
New one which we are going to explore in this video.

00:37.870 --> 00:39.250
It's really, really simple one.

00:39.250 --> 00:44.020
We won't be using it extensively in this application, but I thought to just introduce it because so

00:44.020 --> 00:47.650
many of the kind of pro grade application uses this a lot.

00:47.650 --> 00:52.720
So just wanted to introduce you that otherwise entire to this this application can work without that

00:52.870 --> 00:54.000
library as well.

00:54.010 --> 00:59.680
So let me go ahead and first bring up my code editor, not code editor, my terminal itself.

00:59.980 --> 01:02.950
Let's go ahead and see all of our applications are there so far.

01:02.950 --> 01:05.140
So let's go ahead and create another directory.

01:05.140 --> 01:08.470
So we're going to go ahead and say, hey, I want to create a directory.

01:08.560 --> 01:13.930
Let's call this one as my shopping.

01:13.930 --> 01:16.660
My shopping or a t shirt store?

01:17.290 --> 01:18.880
T shirt store.

01:19.240 --> 01:22.270
Yeah, it seems like a reasonable name, but feel free to change the name.

01:22.420 --> 01:26.170
This is not going to bother us and there is an extra edge there.

01:26.170 --> 01:29.050
So it should be like t shirt.

01:29.590 --> 01:31.660
There we go nicely.

01:31.660 --> 01:32.500
So t shirt store.

01:32.500 --> 01:33.580
So this is all what we got.

01:33.580 --> 01:34.750
Let's go ahead and do that now.

01:34.750 --> 01:36.430
Let's go ahead and migrate into that.

01:36.430 --> 01:41.500
So let's go into t shirt store and we're going to go ahead and say, hey, I want to initialize it.

01:41.500 --> 01:46.300
This time we will be making all the initial questions that are being answered.

01:46.450 --> 01:47.290
Question to us.

01:47.290 --> 01:48.580
So what is the name of this one?

01:48.580 --> 01:53.260
Package name t shirt store is fine to me version fine to me description.

01:54.160 --> 02:06.610
So a backend API for t shirt store and entry point indexed or JS is absolutely fine because that's what

02:06.610 --> 02:09.760
exactly my index point entry point is going to be test command.

02:09.760 --> 02:12.610
We are not talking about any kind of testing suite here.

02:12.820 --> 02:15.280
Git repository, not right now.

02:15.520 --> 02:21.250
This one is going to be simply API and backend would be defined as a keyword.

02:21.250 --> 02:22.600
Yeah, that's that's look good.

02:22.600 --> 02:23.770
Great author.

02:23.770 --> 02:29.260
Of course I'm going to go ahead and put up my name if I can write that correct license.

02:29.260 --> 02:31.780
All Fine, this is all okay, let's go into this one.

02:31.780 --> 02:35.590
So let's go ahead and quickly see an LZ s package or JSON file is here.

02:35.740 --> 02:39.940
Now let's go ahead and install a few libraries and then we're going to create some of the folders here

02:39.940 --> 02:40.480
as well.

02:40.480 --> 02:44.140
So I'm going to go ahead and say, hey, I want to go ahead and install a few libraries.

02:44.140 --> 02:48.400
Now notice very carefully I'm going to go ahead and say I need a big script.

02:48.400 --> 02:50.860
JS Now can you tell me why we need backup?

02:50.860 --> 02:55.480
JS In case you have already gone through with the previous section, you know that we need to store

02:55.510 --> 02:59.470
the password in, in the encrypted format, not clear text and B script.

02:59.480 --> 03:01.270
G actually helps us to do this.

03:01.300 --> 03:05.980
Can we do it with the default installation of the crypto JS which comes up right out of the box in the

03:06.310 --> 03:06.910
in the node?

03:06.910 --> 03:08.380
JS No, we cannot.

03:08.380 --> 03:10.600
This is much more friendlier version.

03:10.600 --> 03:14.050
Now, apart from this, we will be uploading the images.

03:14.050 --> 03:19.270
So we're going to need cloud ordinary and we have already got a huge in depth detail talk about the

03:19.270 --> 03:19.880
cloud binary.

03:19.910 --> 03:21.430
So we're going to be working on that.

03:21.430 --> 03:24.250
So this is cloud ordinary?

03:24.250 --> 03:25.330
Yeah, it seems.

03:25.330 --> 03:27.370
Okay, I might make a few typos in that.

03:27.370 --> 03:29.230
That's a kind of a habit that I do.

03:29.230 --> 03:29.750
Okay.

03:30.460 --> 03:35.110
We will also need a cookie parser and you might be wondering why we are going to need that.

03:35.110 --> 03:40.780
We will be sending the JSON token in all of the web application as HTTP only read only cookies.

03:40.780 --> 03:44.440
That's where the cookie parser is going to come in because I also want to read those cookies.

03:44.440 --> 03:46.090
So that is how we are going to do that.

03:46.210 --> 03:48.430
Dot and V is going to come in handy.

03:48.460 --> 03:52.930
Obviously, you know that I won't be discussing it again, of course, without a doubt.

03:52.930 --> 03:57.040
EXPRESS And another one, the brother of Express, which is express file upload.

03:57.040 --> 04:02.920
So let's go ahead and say express file, upload, upload.

04:02.920 --> 04:03.670
There we go.

04:03.940 --> 04:06.070
We will be talking through the database as well.

04:06.070 --> 04:10.660
And our choice of Aurum for this one is going to be Mongoose, not Aurum ODM.

04:10.660 --> 04:15.010
But again they are kind of A1 are the same in the, in the kind of vague definition.

04:15.100 --> 04:22.420
Now of course after that we are going to need a JSON web token because obviously we'll be working with

04:22.420 --> 04:23.560
the tokens and all of that.

04:23.560 --> 04:24.730
So that is there.

04:24.730 --> 04:28.210
We have already discussed that we will be working with the node mailer.

04:28.210 --> 04:32.110
We haven't gone through with the practical demonstration itself that we'll be doing in this one.

04:32.110 --> 04:35.800
But Node Miller you already know why this is going to be useful for us.

04:35.800 --> 04:37.320
We will be going with the strife.

04:37.330 --> 04:38.530
We will be going with.

04:38.830 --> 04:40.900
Razer pay as well.

04:41.530 --> 04:42.760
Razer pay.

04:42.850 --> 04:44.650
I'll be injecting both of them.

04:44.770 --> 04:48.190
Feel free to pick any one of them or just keep the both however you like.

04:48.190 --> 04:49.840
We will be going with the both of them.

04:50.050 --> 04:52.570
Okay, so stripe razer pay the new addition.

04:52.570 --> 04:54.310
Here is a validator.

04:54.340 --> 04:57.100
Now, this is something that we haven't worked on.

04:57.100 --> 05:00.340
We haven't talked about it, but these are the basic libraries.

05:00.370 --> 05:01.840
In case I missed any.

05:01.900 --> 05:04.460
I will come back and will install later on all of that.

05:04.480 --> 05:06.120
Now, this is getting all installed.

05:06.130 --> 05:11.500
In the meantime, we can go ahead and kind of explore this validator that why we need in this one on

05:11.500 --> 05:12.640
the very first place.

05:12.910 --> 05:16.480
Now, what you are going to notice in the documentation of validator there.

05:16.480 --> 05:19.930
It is used to just simply validate some of the things that are coming to you.

05:19.960 --> 05:24.490
Maybe somebody has passed you a string and you want to check whether that string is email or not.

05:24.490 --> 05:30.130
You can do that by your own regular expressions or you can use something like Validator to extract that.

05:30.160 --> 05:33.970
Now, one of the best thing about the validator, of course, it is really popular, but one of the

05:33.970 --> 05:38.560
best thing that I like about the validator is you can also verify if the data you are is coming to you

05:38.560 --> 05:39.160
or not.

05:39.190 --> 05:42.150
So if I go ahead and scroll a little bit, there we go.

05:42.160 --> 05:46.900
So sometimes you don't know whether the person who is sending you the files are coming up as just file

05:46.900 --> 05:50.560
name itself or they have worked through with some kind of processing on the front end.

05:50.560 --> 05:52.230
So that data comes to me.

05:52.240 --> 05:54.520
So you can also check that in case you want to go ahead.

05:54.520 --> 05:58.990
And this is one of my favorite options in this entire library, but feel free to use something for more

05:58.990 --> 06:03.760
that whether it is a credit card or not, whether it is alphanumeric, whether it is email or not.

06:03.760 --> 06:06.390
So it gives you right out of the box a whole lot of thing.

06:06.400 --> 06:11.020
Yes, there is an argument around as well that this is too overkill and you should not use that.

06:11.020 --> 06:12.470
This is too heavy of a library.

06:12.490 --> 06:16.210
Again, it depends on what you really want to do and how much validation you want to put in.

06:16.210 --> 06:17.560
So that's the basic of it.

06:18.700 --> 06:23.560
So it looks like a whole lot of libraries are included up here.

06:23.560 --> 06:24.670
Some are being deprecated.

06:24.670 --> 06:25.450
No big issue.

06:25.480 --> 06:28.270
They are still very popular and are being used quite a lot.

06:28.700 --> 06:28.890
Okay.

06:28.900 --> 06:32.190
If I go ahead and do list, these are all up here, nice and easy.

06:32.200 --> 06:36.880
Now I want to go ahead and create a couple of directories and for that I'll be using this same thing.

06:36.880 --> 06:38.590
Config Controller, Middleware Module.

06:38.590 --> 06:43.030
So it is a little bit better and easier for me to just create them right from here.

06:43.030 --> 06:45.240
So I'm going to go ahead and move this a little bit.

06:45.490 --> 06:47.800
It's not so config controller middleware.

06:47.800 --> 06:49.060
Let's go ahead and create that.

06:49.060 --> 06:51.430
So first one is going to be config.

06:51.640 --> 06:55.090
Then we need a a folder for controller.

06:55.090 --> 07:03.760
Then we are going to need another folder for middleware and then we are going to need one for models

07:03.760 --> 07:07.030
of course, let's call it as model or models.

07:07.030 --> 07:07.900
Yeah, whatever.

07:07.990 --> 07:09.250
Doesn't really matter.

07:09.250 --> 07:11.650
And then we need something for roots.

07:12.580 --> 07:13.930
And what else do we got?

07:14.680 --> 07:15.310
Then we need.

07:15.310 --> 07:16.660
We won't be working with the seeds.

07:16.660 --> 07:18.640
We'll be working with Utils for sure.

07:18.640 --> 07:19.510
And that's it.

07:20.170 --> 07:26.110
So Utils, now it is for me a little bit convenient to work with the command line directly up here in

07:26.110 --> 07:27.130
case you are not comfortable.

07:27.160 --> 07:27.460
Go ahead.

07:27.460 --> 07:28.240
Right click and click.

07:28.240 --> 07:29.170
Create all of them.

07:29.290 --> 07:32.440
I find it much more easier and kind of a workable here.

07:33.310 --> 07:33.620
Okay.

07:33.640 --> 07:39.040
So controller middleware and let's call it as model as well instead of models, because everything we

07:39.040 --> 07:42.490
are going with the singular or we can go all of that with the plurals.

07:42.490 --> 07:47.440
So controllers and the middleware is not going to bother you anything.

07:47.440 --> 07:50.350
It's your own personal preference and how your company is instructing you.

07:50.350 --> 07:51.550
So go ahead and use that.

07:51.840 --> 07:53.200
Okay, this is all done.

07:53.200 --> 07:55.130
So we should have all the folders up here.

07:55.160 --> 07:55.980
Okay, nice.

07:55.990 --> 07:58.240
I'm going to go ahead and create my files as well.

07:58.240 --> 08:04.840
The first one is indexed or JS and another one is going to be app JS and Dotti and V and all of that.

08:04.840 --> 08:07.330
We're going to create via the code editor itself.

08:07.330 --> 08:09.030
So let's go ahead and fire up the code.

08:09.040 --> 08:14.800
I know this is a little bit of too much that we have done just via the command line, but I absolutely

08:14.800 --> 08:20.800
love that it gives me a better structure and I don't accidentally put up folders inside each other and

08:20.800 --> 08:21.130
all of that.

08:21.130 --> 08:23.740
So whenever I do that, I use this kind of structure.

08:23.920 --> 08:27.520
So right now everything is empty and that's how it's supposed to be.

08:27.520 --> 08:28.390
So there we go.

08:28.750 --> 08:30.850
And let's check out the package store JSON.

08:31.120 --> 08:34.180
Okay, it looks nice and we have all the keywords and all of that.

08:34.180 --> 08:36.250
So looking absolutely fantastic.

08:36.430 --> 08:42.280
Now moving further, what we're going to do, let's install a dependency for the development mode also.

08:42.280 --> 08:47.380
So I'm going to go ahead and say NPM, install a development dependency, which is Node one.

08:47.620 --> 08:51.640
I will be using Node Bond quite a lot, so we'll be working with that.

08:52.430 --> 08:52.980
Okay.

08:53.660 --> 08:54.770
So this is all good.

08:54.770 --> 08:58.190
This reminds me that we might be needing some kind of logger as well.

08:58.190 --> 09:02.420
So let's go back up here and let's go ahead and see if we can find some of the logger here.

09:02.420 --> 09:04.640
So let's go ahead and say, hey, I need a logger.

09:04.640 --> 09:10.010
You definitely can use something like Winston and all of that, but I'll be going with the Morgan because

09:10.010 --> 09:11.240
that sounds easier for me.

09:11.240 --> 09:13.520
So let's go ahead and install Morgan as well.

09:13.520 --> 09:16.130
Now again, this is totally 100% optional.

09:16.130 --> 09:18.410
I just kind of remembered them.

09:18.410 --> 09:22.190
So let's go ahead and say, Hey, I want to install this is too much.

09:22.610 --> 09:28.010
Okay, let's go ahead and install that and PM install Morgan.

09:28.010 --> 09:28.730
There we go.

09:29.920 --> 09:30.140
Okay.

09:30.160 --> 09:32.870
So these are the basic libraries that we have as of now.

09:32.890 --> 09:37.390
Currently, in my mind, if we are going to see anything else, we are definitely going to come back

09:37.390 --> 09:39.430
here and will install a little bit more.

09:39.530 --> 09:40.210
Okay, that's it.

09:40.210 --> 09:43.740
In the next video, we're going to make sure our our server is up and running.

09:43.750 --> 09:45.610
Let's go ahead and catch up in the next video.
