WEBVTT

00:00.440 --> 00:02.920
Are everyone in this video?

00:03.360 --> 00:11.440
Let's open the button project and let's set up the database for this project.

00:11.480 --> 00:11.960
Okay.

00:12.720 --> 00:18.920
So in this course and in this project I will use the MongoDB.

00:19.320 --> 00:19.840
Okay.

00:20.440 --> 00:25.880
So for that reason I still don't know how to set up.

00:25.920 --> 00:26.360
Okay.

00:26.600 --> 00:40.680
Let's look at the documentation and see that inside this let's go into the Mongo right here.

00:41.720 --> 00:46.360
Firstly we need to install the mongoose database.

00:46.400 --> 00:51.520
This is the core library of MongoDB library okay.

00:52.040 --> 01:00.040
And with this thing this is the library to somehow connect with the messages okay.

01:00.080 --> 01:03.960
It will the layer between the Next.js and MongoDB.

01:04.800 --> 01:09.350
So which is on that Let me copy this thing.

01:09.910 --> 01:11.070
Open a terminal.

01:13.870 --> 01:15.270
And install that.

01:21.110 --> 01:25.190
And let's see how we can set up.

01:26.670 --> 01:27.190
Okay.

01:27.590 --> 01:40.750
In order to set up the MongoDB inside the app module, we will import the mongoose module and use this

01:40.750 --> 01:41.790
line right here.

01:42.110 --> 01:42.630
Okay.

01:43.350 --> 01:51.070
So my advice is never try to remember this thing okay.

01:51.630 --> 02:00.030
Instead of let's understand this, understand the fundamental and just copy and paste okay.

02:00.430 --> 02:12.150
That's the my advice at developers never write this by hand and never try to memorize all of that.

02:12.310 --> 02:14.050
It doesn't really matter.

02:16.290 --> 02:18.010
Where we go with this Mongo?

02:19.450 --> 02:21.290
Open the app module.

02:22.450 --> 02:25.130
Okay, but this over here.

02:27.370 --> 02:32.010
And inside the import statement we will copy this array.

02:33.330 --> 02:33.850
Okay.

02:34.170 --> 02:35.770
And replace over here.

02:38.370 --> 02:44.050
And inside of you right here we need to create a mobile device database.

02:44.290 --> 02:46.770
Okay I'm sure you already.

02:50.130 --> 02:52.290
Understand the basics.

02:53.690 --> 02:55.690
So I will not deep dive about us.

02:58.290 --> 02:59.090
Inside here.

03:03.410 --> 03:04.610
Inside the project.

03:08.050 --> 03:12.170
I will click on view on project also.

03:16.210 --> 03:19.050
And I will create a new project okay.

03:20.360 --> 03:24.360
I project and I will name for social.

03:25.240 --> 03:25.720
Okay.

03:26.800 --> 03:28.440
I click on next.

03:30.760 --> 03:33.000
I just create a project.

03:46.760 --> 03:49.320
Let's click on create a cluster.

03:52.040 --> 03:56.920
And for now let's choose the AWS providers.

03:57.560 --> 03:58.880
And in the region.

04:01.240 --> 04:02.360
You can show.

04:05.600 --> 04:13.080
In my case I will choose single box and click on Create Deployment.

04:24.640 --> 04:27.900
Uh Right here is sideways, so.

04:32.300 --> 04:33.820
Uh, I got one.

04:34.860 --> 04:39.820
I just want to use the free, free version.

04:39.860 --> 04:42.380
So I will go back and show the free version.

04:42.420 --> 04:42.900
Okay.

04:43.140 --> 04:45.500
So you choose the free version.

04:46.980 --> 04:50.020
Uh, right here, I will change the name a little bit.

04:50.460 --> 04:52.460
Will be the.

04:56.060 --> 04:56.340
Pro.

04:56.340 --> 04:56.660
So.

04:59.180 --> 05:01.660
I click on Create Deployment again.

05:09.060 --> 05:10.540
It will log the project.

05:10.540 --> 05:15.420
And in this guy we should create the database.

05:19.500 --> 05:23.420
Okay let's click on Create Database user.

05:24.820 --> 05:32.330
After that right here we will click into the allow access from anywhere.

05:32.930 --> 05:34.930
Okay, let me show you right here.

05:37.290 --> 05:38.810
Allow search from anywhere.

05:39.010 --> 05:40.210
We call it later.

05:40.570 --> 05:45.530
If your router or your Wi-Fi power up.

05:45.730 --> 05:48.570
It will change the IP address.

05:49.610 --> 05:49.890
Okay.

05:49.930 --> 05:52.170
So for that reason, if you are a current user.

05:52.210 --> 05:56.130
If you are the old IP address.

05:56.490 --> 06:02.530
And this will not work if the Wi-Fi turn off and turn on again.

06:02.570 --> 06:03.890
So it doesn't matter.

06:03.890 --> 06:07.530
We just click on the allow access from anywhere.

06:08.730 --> 06:11.810
Click on that and it will pass away.

06:12.210 --> 06:15.730
And let's go and show the connection.

06:16.290 --> 06:16.810
Okay.

06:16.970 --> 06:23.650
So here let me click into the rivers and do Node.js.

06:24.210 --> 06:29.450
And let's copy this line this line right here.

06:30.930 --> 06:38.990
And put this over here and save this application and run the holidays are here.

06:48.430 --> 06:50.910
Now let me show you.

06:53.310 --> 07:00.670
In order to create the documentation, we will define some schemas.

07:01.150 --> 07:01.670
Okay.

07:04.510 --> 07:07.750
Right here inside this is the authentication.

07:07.750 --> 07:08.230
The reason?

07:08.230 --> 07:11.670
Because I forgot to change the password.

07:12.070 --> 07:15.070
Make sure you change the password over here.

07:15.830 --> 07:17.110
Let's save us.

07:22.070 --> 07:22.670
Okay.

07:22.910 --> 07:29.550
Right now we are already connected to the database and start up the application successfully.

07:29.990 --> 07:30.590
Right?

07:33.750 --> 07:34.270
So.

07:38.870 --> 07:42.830
I think that will be enough for this video.

07:44.550 --> 07:45.510
I will see you in the next.
