Now let's continue with the core concept of Nest.js.
The next thing will be the modules.
Okay.
Let's click on that.
And now what is the modules?
The whole purpose of the module is to help you organize the application structure.
Okay.
Now for example I have some API for the e-commerce website for example like that okay.
We will have a many modules like user module, order modules and chat module okay.
We will organize that in the something called modules okay.
That is the module.
And now you can see the rule of the module.
Each application has at least one module with a root module.
Okay.
And what is the root module?
Actually the app module right here is the root module right.
The reason is the root module because it does not depend on other modules.
You can say you can see right here this is the top level module right.
This is not depend on something module.
Right.
And for that reason this will be just the root module.
And it will use the bootstrap application.
You can see.
And now let me discuss about some properties inside the module.
Like
Inside the module.
It has a provider controller.
Imports and exports.
You can see inside the app module it has an imports controller, providers.
Right.
And it also has an export.
And right now we already know what is the provider and what is the controller.
Right.
The provider you will be for the dependency injection of the NestJS
And the controller we will register some controller inside here.
Inside the controller.
Array
And we haven't yet discussed about what is import and what is export, right?.
And I will discuss this later because we will use this a lot.
Okay.
This is very important.
And let me scroll down.
You can read more about us inside the Nest.js.
Okay.
And we can organize the code in some way.
For example, in src folder, I have inside the root of the src, we have an
app module and main.ts.
Right.
But we can organize that in some folder structure like class and controller module service.
Right.
And I will discuss what is the DTO and the interface later.
Don't worry about that right now.
And share module actually the import and export right here.
Now the import and export right here.
is used for the share module.
I will discuss that later.
Let me see how something like this.
Okay.
We can import and export.
I will discuss that, don't worry.
Now you can see, we already know the provider, right?
It used for dependency injection.
Okay.
And global global module.
We can use something like this.
You can read more about that right here.
Okay.
Anyway that is the module.
And it just organize the application structure.
And in the next video I will show you how to create the module in NestJS.
I will see you in the next one.