separate uh files so it will make more sense okay yes good good questions uh
sense okay yes good good questions uh any anything you guys need to ask
more um I need your confirmation if all all of you guys get these
all of you guys get these things
oops okay how do we know the reserved ports yes so basically reserved ports
ports yes so basically reserved ports are uh as I mentioned the ports normally
are uh as I mentioned the ports normally we consider Reserve ports up until Port
we consider Reserve ports up until Port uh 1024 if you do a Google search you
uh 1024 if you do a Google search you will get uh Reserve
ports um
OS Port yes normally yes uh from zero to two uh uh 1023 is known as Reserve P so
two uh uh 1023 is known as Reserve P so anything above uh you can use this but
anything above uh you can use this but probably do not use like 10,24 something
probably do not use like 10,24 something like that use a higher port number the
like that use a higher port number the more higher you get you can go but there
more higher you get you can go but there is high upper limit I think 16,000 or
is high upper limit I think 16,000 or something like that so do not use
something like that so do not use Reserve Port these ports will will not
Reserve Port these ports will will not simply the operating system will not
simply the operating system will not allow to run so if I if I go here and
allow to run so if I if I go here and change this to like uh 80 so 80 or
change this to like uh 80 so 80 or something like that and if I try to stop
something like that and if I try to stop this and if I try to run
this and if I try to run this uh think the 80 is not taken at the
this uh think the 80 is not taken at the moment I have allow
moment I have allow it LO
it LO host yeah for for for this machine you
host yeah for for for this machine you get the 80 since I am not using 80 but
get the 80 since I am not using 80 but probably you would not be using a
probably you would not be using a reserved Port okay so you guys can see
reserved Port okay so you guys can see since I'm using Port 80 I do not need to
since I'm using Port 80 I do not need to use even the port 80 over here you can
use even the port 80 over here you can just simply yeah you can simply have
just simply yeah you can simply have that c but if you I'm not sure 443 is
that c but if you I'm not sure 443 is https what we call let me try if I can I
https what we call let me try if I can I get definitely get an error at
get definitely get an error at least
least Port
Port 43 still comes uh let me know a
43 still comes uh let me know a wellknown port
wellknown port like2 be
like2 be S4 still
yeah you do not use these kind of ports you know you can you can't get the hold
you know you can you can't get the hold of it sometimes it works sometimes it
of it sometimes it works sometimes it not because the port 22 is known as the
not because the port 22 is known as the SFTP ports so those ports won be in use
SFTP ports so those ports won be in use so do not use something like well known
so do not use something like well known ones use something like 3,000
ones use something like 3,000 3,33 they're like there other numbers
3,33 they're like there other numbers you guys can play around do not have
you guys can play around do not have like a very small
like a very small number so so wellknown ports uh skip
number so so wellknown ports uh skip those
those things and use a very higher up okay so
things and use a very higher up okay so probably wellknown ports are like like
probably wellknown ports are like like 22 443 80 um there are like different
22 443 80 um there are like different TCP connection based on on those things
TCP connection based on on those things do not use these
things anything else guys
so it's going to differ from the operating system as well some some
operating system as well some some operating system have different uh but
operating system have different uh but but standard wise you you don't try do
but standard wise you you don't try do not try any reserve ports up until
not try any reserve ports up until 1023 good questions yes any other things
1023 good questions yes any other things that you guys need to know before we
the the server in this I did not get the question
correctly is the port used for the as access the service is this
the as access the service is this application maybe you can explain the
application maybe you can explain the question a little bit uh I do not get
question a little bit uh I do not get the question like what you asking right
now uh last chat message I do not I can't understand actually uh
can't understand actually uh so index number I think 10 1048 but
so index number I think 10 1048 but you're asking I'm not getting that
you're asking I'm not getting that please clarify me
please clarify me more okay any other questions
more okay any other questions guys 1048 you can ask if you if you want
guys 1048 you can ask if you if you want you can unmute and
names okay what is the purpose of port number okay so the port number is
number okay so the port number is something like um when you're using a
something like um when you're using a port
port um you don't you don't have any other
um you don't you don't have any other application interfering with your data
application interfering with your data okay so for example uh a certain Port
okay so for example uh a certain Port will only only uh deliver certain
will only only uh deliver certain content Let me Give an example if if you
content Let me Give an example if if you find uh internet as a huge tube okay
find uh internet as a huge tube okay think uh the
think uh the the connections that you have is as a
the connections that you have is as a huge tube okay uh and within that huge
huge tube okay uh and within that huge tube you have different different
tube you have different different smaller tubes which is running on inside
smaller tubes which is running on inside that okay so you when you are sending a
that okay so you when you are sending a certain values in a smaller tube what
certain values in a smaller tube what will happen is the other tubes around it
will happen is the other tubes around it does not know what is the contain is
does not know what is the contain is okay what what you are sending in uh in
okay what what you are sending in uh in a smaller tube does not know or does not
a smaller tube does not know or does not interfere with other other um other
interfere with other other um other other tubes so it's the same scenario in
other tubes so it's the same scenario in here so if you if you have a single
here so if you if you have a single connection and you want to send multiple
connection and you want to send multiple data multiple protocols and uh the by
data multiple protocols and uh the by the way to divide those things is use a
the way to divide those things is use a port so when you're using a port the
port so when you're using a port the data which is
data which is coming uh from one single port is not
coming uh from one single port is not interfering with something else for
interfering with something else for example we have wellknown ports like the
example we have wellknown ports like the SSH ssh we use port 22 SSH is the well
SSH ssh we use port 22 SSH is the well known port for sshing to that means
known port for sshing to that means remote connecting to a machine we use
remote connecting to a machine we use the port 22 for that okay that is like a
the port 22 for that okay that is like a well standard you can use any other Port
well standard you can use any other Port okay with the well known Port is 22 so
okay with the well known Port is 22 so if you you if you're ssing from Port 22
if you you if you're ssing from Port 22 and the wellknown port for serving web
and the wellknown port for serving web application is Port 80 8C Z so you can
application is Port 80 8C Z so you can serve a web page in Port 80 while you
serve a web page in Port 80 while you are sing it in Port 22 so those
are sing it in Port 22 so those different two things do different things
different two things do different things so you you don't not interfere the SSH
so you you don't not interfere the SSH stuff with the HTTP stuff so make the
stuff with the HTTP stuff so make the differences and different port different
differences and different port different ports can have different uh applications
ports can have different uh applications running they can have different uh data
running they can have different uh data going on there so uh the protocols can
going on there so uh the protocols can be different and it's uh it is easy to
be different and it's uh it is easy to manage data in a in a way that they do
manage data in a in a way that they do not conflict with each other okay so
not conflict with each other okay so that's why we use ports so we can Rite
that's why we use ports so we can Rite run uh one single application in Port
run uh one single application in Port 3,000 we can WR we can run another
3,000 we can WR we can run another application in Port 4,200 or anything
application in Port 4,200 or anything above wellknown PS okay so those two
above wellknown PS okay so those two will not get interfere with each other
will not get interfere with each other those those two ports will serve content
those those two ports will serve content in different
in different hope that answer your
yes all good anyone have any other in things to ask so few things that you
things to ask so few things that you guys need to do research on your end
guys need to do research on your end first I might take this as an assignment
first I might take this as an assignment as well uh I'll send it in the
as well uh I'll send it in the group uh what
group uh what is uh
is uh rest
rest API and name for
API and name for rest
rest methods okay the second one
methods okay the second one is
is uh what is Json that one is what is
uh what is Json that one is what is XML okay so do your research
XML okay so do your research and
and find uh find what are these things and
find uh find what are these things and prepare a small assignment on that
prepare a small assignment on that okay all right any more questions yes
okay all right any more questions yes good any more questions that you need to
okay all [Music]
right okay so we we develop a very simple uh rest API using Express and um
simple uh rest API using Express and um using some of the um
using some of the um uh some of the methods only we use the
uh some of the methods only we use the rest API method called get there are
rest API method called get there are other methods while you're doing we will
other methods while you're doing we will find other methods as well learn the
find other methods as well learn the difference that is the rest commands and
difference that is the rest commands and what are the different methods that you
what are the different methods that you can work with Okay so if if if you uh if
can work with Okay so if if if you uh if you're coming to in the industry you as
you're coming to in the industry you as a web developer or maybe a mobile
a web developer or maybe a mobile developer someone else something like
developer someone else something like that you're definitely going to learn
that you're definitely going to learn right in much more detail I mean at
right in much more detail I mean at least you need to interact with this so
least you need to interact with this so better you guys know the um uh things
better you guys know the um uh things behind these uh Technologies so you guys
behind these uh Technologies so you guys get a good
get a good idea um yeah for references part use
idea um yeah for references part use Internet it's the best best I can do um
Internet it's the best best I can do um uh you would probably find um lot of U
uh you would probably find um lot of U information in Internet you guys
information in Internet you guys uh even Wikipedia would
uh even Wikipedia would do okay and uh if you if you need more
do okay and uh if you if you need more uh web Focus one I would probably use W3
uh web Focus one I would probably use W3 schools it has all these
things okay any more questions uh before we move
on so we we create a simple web service okay web
okay web server by creating this simple web
server by creating this simple web server we were able to uh generate few
server we were able to uh generate few end points which is the root end point
end points which is the root end point the message end point randika and time
the message end point randika and time end point so different endpoints give us
end point so different endpoints give us uh different outputs okay and um some
uh different outputs okay and um some all all these uh all these uh endpoints
all all these uh all these uh endpoints give us a
give us a Json uh by default that is like most
Json uh by default that is like most commonly used in rest so in here we are
commonly used in rest so in here we are using Json as well
using Json as well so
so uh uh the the Json output that we are
uh uh the the Json output that we are seeing is different from one to another
seeing is different from one to another that is okay um so you
that is okay um so you guys
guys go go and develop some simple restant
go go and develop some simple restant points like this so this is going to be
points like this so this is going to be very very uh simple one but the problem
very very uh simple one but the problem arise uh when we are developing um uh
arise uh when we are developing um uh when we are developing web
when we are developing web applications it's it's going to be it's
applications it's it's going to be it's going to get really really complicated
going to get really really complicated than this okay so for
than this okay so for example uh when we want when we want to
example uh when we want when we want to uh uh show some data in in a Json format
uh uh show some data in in a Json format it's not going to be something like uh
it's not going to be something like uh We call we call these hard code values
We call we call these hard code values okay the values are uh
okay the values are uh [Music]
[Music] the values that we get when we go to the
the values that we get when we go to the Endo are hardcoded into the source code
Endo are hardcoded into the source code okay it's it's embedded in the source
okay it's it's embedded in the source code but for some reason say for
code but for some reason say for instance we need uh some uh something
instance we need uh some uh something like um something like this information
like um something like this information some information to be fetched from the
some information to be fetched from the database okay we we we can't have those
database okay we we we can't have those everything in here so we need to connect
everything in here so we need to connect to the database and retrieve the
to the database and retrieve the database
database values uh and once we retrieve those
values uh and once we retrieve those values we need to show or we need to uh
values we need to show or we need to uh send it back
send it back so uh pretty simply the application will
so uh pretty simply the application will get complicated enough so we can't
get complicated enough so we can't handle um our request so the database
handle um our request so the database queries going to be there you guys know
queries going to be there you guys know database queries so database queries
database queries so database queries will be there we need to execute those
will be there we need to execute those queries we need to make a database
queries we need to make a database connection and um once the connection
connection and um once the connection once the query is executed we need to
once the query is executed we need to return the
uh we need to return the value there are lot of things going to
value there are lot of things going to add into this application this
add into this application this application is going to get really
application is going to get really really messy really really in a really
really messy really really in a really small time okay so in order to make sure
small time okay so in order to make sure uh that our application can grow okay
uh that our application can grow okay the application can grow and our
the application can grow and our application will have
application will have um our application will
um our application will um application will be able to scale and
um application will be able to scale and you know when the next developer comes
you know when the next developer comes uh they they won't find thousand and
uh they they won't find thousand and points within the same application and
points within the same application and we have written written a good amount of
we have written written a good amount of test cases to test our application so
test cases to test our application so this uh this way of coding this what we
this uh this way of coding this what we call the architecture the this one that
call the architecture the this one that the simple one that we have come come
the simple one that we have come come across would not suffice this this
across would not suffice this this application will simply fail okay so
application will simply fail okay so what we can do is we can develop an
what we can do is we can develop an architecture we can develop an
architecture we can develop an architecture that will be
architecture that will be less uh complicated okay remember these
less uh complicated okay remember these by applying an architecture it doesn't
by applying an architecture it doesn't not mean everything that we have is
not mean everything that we have is going to be uh it's going to be
going to be uh it's going to be [Music]
[Music] um it's going to be solved
um it's going to be solved okay by simply applying an software
okay by simply applying an software architecture it will reduce the
architecture it will reduce the complexity of course it will reduce the
complexity of course it will reduce the complexity and it uh it will um it will
complexity and it uh it will um it will be understand by the most majority of
be understand by the most majority of our uh our users or our developers so
our uh our users or our developers so for example if we develop an applic
for example if we develop an applic appliation like this this might be our
appliation like this this might be our own style okay this I can develop an
own style okay this I can develop an application like this I can I have
application like this I can I have everything working fine okay if I can
everything working fine okay if I can manage th000 end points like this yes
manage th000 end points like this yes that is fine but the problem is if I
that is fine but the problem is if I want to give this source code to someone
want to give this source code to someone else will that person understand what
else will that person understand what I'm trying to do okay will that person
I'm trying to do okay will that person will have a hard time understanding the
will have a hard time understanding the code itself so by providing a simple
code itself so by providing a simple architecture by providing a simple
architecture by providing a simple methodology to that what will happen is
methodology to that what will happen is it
it will it will guarantee that okay
will it will guarantee that okay everybody knows this is how it should
everybody knows this is how it should get done okay this is a methodology that
get done okay this is a methodology that everybody is following so the next
everybody is following so the next person would come and say ah okay I know
person would come and say ah okay I know this methodology I have to just
this methodology I have to just Implement using these things so and an
Implement using these things so and an architecture gives us uh guidance or we
architecture gives us uh guidance or we it gives us proper structure and
it gives us proper structure and uh uh proper way of doing things but um
uh uh proper way of doing things but um remember a software architecture the way
remember a software architecture the way of we organize our code the way of we
of we organize our code the way of we going to implement such and such a thing
going to implement such and such a thing is going to be different on the uh
is going to be different on the uh different uh project or different uh
different uh project or different uh application that we are developing okay
application that we are developing okay so for an web application we can have a
so for an web application we can have a different architecture for a mobile
different architecture for a mobile application we can have a different
application we can have a different architecture that's because the purpose
architecture that's because the purpose of the application is different from one
of the application is different from one one one to another so mobile application
one one to another so mobile application have different restrictions different
have different restrictions different mechanisms how they works and different
mechanisms how they works and different limitations with the resources and all a
limitations with the resources and all a web a web application such as rest API
web a web application such as rest API that we have developed it's going to be
that we have developed it's going to be running on a server we have certain
running on a server we have certain server limitations we have certain uh
server limitations we have certain uh database limitation and all all sort of
database limitation and all all sort of things so based on the application that
things so based on the application that we're going to be developing based on
we're going to be developing based on the technologies that we are having the
the technologies that we are having the architecture of the program will differ
architecture of the program will differ but most commonly with web
but most commonly with web applications right now when we are
applications right now when we are developing a web
developing a web application uh we find that the NT
application uh we find that the NT architecture or 3D architecture at least
architecture or 3D architecture at least works better with our uh with our code
works better with our uh with our code organization the NTI architecture if you
organization the NTI architecture if you write uh an NTI architecture
write uh an NTI architecture application it would make our life easy
application it would make our life easy and if somebody comes tomorrow and join
and if somebody comes tomorrow and join our team and they we can say okay uh our
our team and they we can say okay uh our application is following n architecture
application is following n architecture and we all agree upon how n architecture
and we all agree upon how n architecture should work okay we'll certain we will
should work okay we'll certain we will learn certain things in N architecture
learn certain things in N architecture so next time when you go to Industry and
so next time when you go to Industry and you guys can ask okay uh we have a web
you guys can ask okay uh we have a web application you can ask okay good what
application you can ask okay good what is the architecture that we using so
is the architecture that we using so they might say oh we are using n
they might say oh we are using n architecture so you don't need to know
architecture so you don't need to know okay n architecture by by n architecture
okay n architecture by by n architecture we have certain component we have such
we have certain component we have such and such then you will easily understand
and such then you will easily understand what what they are talking about okay
what what they are talking about okay the software architecture is something
the software architecture is something like that it is a well-known practices
like that it is a well-known practices well-known things that will
well-known things that will overcome overcome the uh common problems
overcome overcome the uh common problems that we are having so for example we all
that we are having so for example we all know okay when we are talking about n
know okay when we are talking about n architecture the whole whole development
architecture the whole whole development teams have the idea of okay when we are
teams have the idea of okay when we are developing this application there will
developing this application there will will be this this this and we have to
will be this this this and we have to follow those things so it it
follow those things so it it won't it won't make you an outcast or
won't it won't make you an outcast or the project uh leads Outcast so we know
the project uh leads Outcast so we know okay when we are developing this
okay when we are developing this application we are following these
application we are following these principles we are we are at this point
principles we are we are at this point and we are using these things okay so in
and we are using these things okay so in as I mentioned earlier for web
as I mentioned earlier for web applications so simple
applications so simple applications uh we find the NTI
applications uh we find the NTI architecture to be working perfectly
architecture to be working perfectly okay as I mentioned
okay as I mentioned earlier n architecture will not be very
earlier n architecture will not be very suitable for our mobile application we
suitable for our mobile application we we we um sometimes it might work
we we um sometimes it might work sometimes it not there are different
sometimes it not there are different architectural patterns that we can use
architectural patterns that we can use but for stus the simplest form uh
but for stus the simplest form uh developing a simple web application we
developing a simple web application we will talk about the n architecture okay
will talk about the n architecture okay so any questions uh about what we have
so any questions uh about what we have discussed why we need an architectural
discussed why we need an architectural pattern and what sort of things it um uh
pattern and what sort of things it um uh it's it try to resolve it's trying uh
it's it try to resolve it's trying uh the basically an architecture pattern we
the basically an architecture pattern we give
give formal uh formal structure to our
formal uh formal structure to our project and all the all the the software
project and all the all the the software team will be
team will be in uh in in sync up with the
in uh in in sync up with the Technologies and when you when you want
Technologies and when you when you want to when you want to learn uh the way how
to when you want to learn uh the way how software is
software is organized so you guys can refer that
organized so you guys can refer that architect and add up to that so there
architect and add up to that so there are a lot of Architects going on
are a lot of Architects going on remember based on the project those
remember based on the project those Architects can be different okay so any
um okay definitely this will be uploaded no
questions okay hope not okay let's see so we'll move into the NTI architecture
so we'll move into the NTI architecture so you guys can see in the sample
so you guys can see in the sample application the sample express
application the sample express application that we have
application that we have created um we have several things things
created um we have several things things okay we have several things so you guys
okay we have several things so you guys can see um we are accepting uh a request
can see um we are accepting uh a request okay we are accepting a request the
okay we are accepting a request the client is asking something and we are
client is asking something and we are responding to that so we have what we
responding to that so we have what we call a request and we have something
call a request and we have something called a response okay
called a response okay so uh some request some request can be
so uh some request some request can be uh can be group
uh can be group some request represent the same uh same
some request represent the same uh same set
set of uh values for example in this uh in
of uh values for example in this uh in this uh in this scenario we do not see
this uh in this scenario we do not see uh strikingly similar things so all
uh strikingly similar things so all these things are like several uh several
these things are like several uh several different things but when we are working
different things but when we are working with um a good uh applic ific ation some
with um a good uh applic ific ation some features have typed together some
features have typed together some features will um have different purposes
features will um have different purposes okay for
okay for example um we call uh normally we call
example um we call uh normally we call these things as crud operations okay
these things as crud operations okay crud operations we call these things so
crud operations we call these things so uh the crud operations stick together so
uh the crud operations stick together so what do you understand by a crud
what do you understand by a crud operation so in CR c r u we call this
operation so in CR c r u we call this create uh read update delet interest
create uh read update delet interest okay so that's that's the basic of uh
okay so that's that's the basic of uh what what it stand for at least uh crud
what what it stand for at least uh crud okay do uh uh do a simple uh Implement
okay do uh uh do a simple uh Implement look at around crud so crud stand for
look at around crud so crud stand for create read update and delete so uh in a
create read update and delete so uh in a system say for example we want to
system say for example we want to develop a simple user management system
develop a simple user management system we want to develop a simple user
we want to develop a simple user management system in that user
management system in that user management system we need to able to
management system we need to able to create users so for example uh we want
create users so for example uh we want to uh create a user with the name email
to uh create a user with the name email that's it okay we do not need anything
that's it okay we do not need anything else within our system what it will do
else within our system what it will do is create a user with a user
is create a user with a user name um username or uh
name um username or uh email uh on that we call we we need to
email uh on that we call we we need to create the user okay that's we call the
create the user okay that's we call the create
create operation and some sometimes back
operation and some sometimes back sometimes later we need to read all the
sometimes later we need to read all the users that means we need to get all the
users that means we need to get all the users within our system let's say for
users within our system let's say for example now we have 100 registered
example now we have 100 registered people we need to get those 100 people
people we need to get those 100 people okay that is what we called a read
okay that is what we called a read operation okay sometimes we do not need
operation okay sometimes we do not need the 100 uh 100 users but we need a
the 100 uh 100 users but we need a certain user one single certain user
certain user one single certain user which have the uh let's say which have
which have the uh let's say which have the email uh example.com okay we need a
the email uh example.com okay we need a one single particular user which has one
one single particular user which has one single we one single user we need to
single we one single user we need to read it back from the system so that we
read it back from the system so that we call a read we can have multiple users
call a read we can have multiple users or we can have one single user either
or we can have one single user either way we going to be reading users from
way we going to be reading users from the system and there will be other
the system and there will be other operations such as update operations
operations such as update operations what we call uh uh update request so
what we call uh uh update request so sometimes uh some sometimes we when we
sometimes uh some sometimes we when we are working with the system uh we need
are working with the system uh we need to update a particular users information
to update a particular users information for example a user can have a first name
for example a user can have a first name and a last last name and we need for
and a last last name and we need for some reason they have either misfill the
some reason they have either misfill the first name and we need to update that
first name and we need to update that record we we do not need to create a new
record we we do not need to create a new record okay we need to create we need to
record okay we need to create we need to update an existing record so we call
update an existing record so we call that a update request and finally we
that a update request and finally we have something like a delete request
have something like a delete request which will uh Delete the record from
which will uh Delete the record from from our application okay so that is
from our application okay so that is what we call a delete request
what we call a delete request so these three uh these four request
so these three uh these four request types are mostly common within a system
types are mostly common within a system that you you guys will develop so this
that you you guys will develop so this is very common in web application so we
is very common in web application so we call this crud operations so we will
call this crud operations so we will create a crud operation that is only for
create a crud operation that is only for users we can create users read users
users we can create users read users update users and delete users and we can
update users and delete users and we can have Crow operations for another thing
have Crow operations for another thing for example uh we we also want to
for example uh we we also want to manage uh let's
manage uh let's say uh schools okay so we need to create
say uh schools okay so we need to create a school we need to read an school name
a school we need to read an school name or information about one single school
or information about one single school or more than one single school so we
or more than one single school so we need to read we need to update some
need to read we need to update some certain information and we need to
certain information and we need to sometimes we need to delete okay the C
sometimes we need to delete okay the C is not like always going to be the all
is not like always going to be the all the SP things going to be there but
the SP things going to be there but basically when we are developing an
basically when we are developing an application we Implement all those craft
application we Implement all those craft operations okay so when we develop uh
operations okay so when we develop uh such a thing so we have the user C and
such a thing so we have the user C and screw crab and think about another thing
screw crab and think about another thing like we need to manage teachers okay so
like we need to manage teachers okay so the teachers C so so we have teacher
the teachers C so so we have teacher create teacher reads teacher update
create teacher reads teacher update teacher delete so you guys can see in a
teacher delete so you guys can see in a very complex system uh we will have lot
very complex system uh we will have lot of CR operations not only CR operations
of CR operations not only CR operations there will be some actions as well so we
there will be some actions as well so we will definitely we'll look into actions
will definitely we'll look into actions later on but for now we will simply look
later on but for now we will simply look at hard operations okay so when we are
at hard operations okay so when we are when we when we talk about the user use
when we when we talk about the user use head for CR operations okay let's uh for
head for CR operations okay let's uh for the for those four CR operations we will
the for those four CR operations we will have four end points okay so right now
have four end points okay so right now we have one single end point in here
we have one single end point in here another one here and another one here so
another one here and another one here so we have totally four end points but all
we have totally four end points but all are read operations these are what we
are read operations these are what we call read operation get is a read
call read operation get is a read operation but for user you can have four
operation but for user you can have four different uh um four different uh
different uh um four different uh endpoints one for create one for read
endpoints one for create one for read one for update one for delete okay so we
one for update one for delete okay so we guys you guys can see a single user will
guys you guys can see a single user will have four end points at least four end
have four end points at least four end points and uh school can have four end
points and uh school can have four end points and this
points and this file uh which handle all these uh all
file uh which handle all these uh all these request is going to get bigger and
these request is going to get bigger and bigger okay so at for four for for
bigger okay so at for four for for operations we have we we will add uh for
operations we have we we will add uh for one uh type we will have four so think
one uh type we will have four so think about we in a pro professional system
about we in a pro professional system normally it contains like um 10 to 20 uh
normally it contains like um 10 to 20 uh of such things then it will explode the
of such things then it will explode the file will not be able you can't even
file will not be able you can't even find whatever you need in the single
find whatever you need in the single file so uh what we will do what we need
file so uh what we will do what we need to do is we need to separate things we
to do is we need to separate things we need to separate okay so when we are
need to separate okay so when we are talking about user user will have its
talking about user user will have its own Crut uh operations when we talking
own Crut uh operations when we talking about the school it it school will have
about the school it it school will have a separate C operation file and so list
a separate C operation file and so list goes on so we will be developing such
goes on so we will be developing such application so we we would have the all
application so we we would have the all the C end points in the different
the C end points in the different locations okay okay
locations okay okay so uh that is one thing the C end points
so uh that is one thing the C end points the end points what we have
the end points what we have discussed and the next thing that we be
discussed and the next thing that we be that would that uh that requires is the
that would that uh that requires is the logic behind it okay the logic behind it
logic behind it okay the logic behind it so some something in here we are simply
so some something in here we are simply returning all all these things are uh
returning all all these things are uh just simply uh showing a showing a value
just simply uh showing a showing a value but in
but in reality what will happen is we we can't
reality what will happen is we we can't have such uh simple get test that means
have such uh simple get test that means we are not going to Simply show these
we are not going to Simply show these values by hardcoding this we will
values by hardcoding this we will definitely talk to a database okay we
definitely talk to a database okay we will definitely need some operations to
will definitely need some operations to happen Okay so for
happen Okay so for example uh we want to we want to
example uh we want to we want to delete uh a school okay we want to
delete uh a school okay we want to delete a school in our system there will
delete a school in our system there will be certain rules that we need to follow
be certain rules that we need to follow you can't just delete uh you can't just
you can't just delete uh you can't just delete um school from the system you
delete um school from the system you might need special permission if you are
might need special permission if you are doing such a thing okay you can't just
doing such a thing okay you can't just anybody comes and delete delete a school
anybody comes and delete delete a school that system would not be a really good
that system would not be a really good one sometimes uh if you want to delete
one sometimes uh if you want to delete uh if you want to delete such important
uh if you want to delete such important record you need permissions sometimes
record you need permissions sometimes you you you will uh as two some two
you you you will uh as two some two people should vote on it once they have
people should vote on it once they have done the voting then you can delete that
done the voting then you can delete that that's kind of what we call Logics going
that's kind of what we call Logics going to be there we call those things logic
to be there we call those things logic in system like this we call those things
in system like this we call those things as business logic okay when we want to
as business logic okay when we want to operate something we want when we want
operate something we want when we want to do something we we will have
to do something we we will have something called a business Logics okay
something called a business Logics okay say for instance that logic should be
say for instance that logic should be implemented in here as well so somebody
implemented in here as well so somebody send a delete request and delete request
send a delete request and delete request need to be going through some business
need to be going through some business Logics and you need to check all those
Logics and you need to check all those Logics and everything and this file what
Logics and everything and this file what will happen all those Logics going to be
will happen all those Logics going to be within this simple file this file will
within this simple file this file will explod okay and when somebody is looking
explod okay and when somebody is looking at this file the file is going to be
at this file the file is going to be like 10,000 or 20,000 long and it will
like 10,000 or 20,000 long and it will not make sense to look like look into a
not make sense to look like look into a hinge file like
that all right so what we will do is we rather than writing everything in one
rather than writing everything in one single file or one single location we
single file or one single location we will move the business logic into a
will move the business logic into a separate file or we call a separate
separate file or we call a separate layer okay so all the request that are
layer okay so all the request that are coming the
coming the request that can be a read request
request that can be a read request update request delete request or any CR
update request delete request or any CR request so all the request that is
request so all the request that is coming will be handled by a a single
coming will be handled by a a single layer okay all the request handling will
layer okay all the request handling will be done by a single layer and once that
be done by a single layer and once that layer get the message the business logic
layer get the message the business logic will be handled in a separate layer okay
will be handled in a separate layer okay it will be handle in a separate layer so
it will be handle in a separate layer so why we are layering these things the
why we are layering these things the first thing is the complexity will grow
first thing is the complexity will grow okay everything if you put everything in
okay everything if you put everything in one single one single file one single
one single one single file one single layer the layer will really be uh really
layer the layer will really be uh really really will get big and you can't have
really will get big and you can't have all these Logics and everything in one
all these Logics and everything in one single file it's hard to read okay so
single file it's hard to read okay so what we'll do is all the requests that
what we'll do is all the requests that we are getting will be in one single
we are getting will be in one single layer
layer and once the request is receiv received
and once the request is receiv received to us the business logic will be in a
to us the business logic will be in a different layer okay the business logic
different layer okay the business logic will be in a different layer okay so the
will be in a different layer okay so the business logic when we when we move the
business logic when we when we move the business logic to a different layer the
business logic to a different layer the business logic might
business logic might need uh something uh from
need uh something uh from another uh another place for example in
another uh another place for example in order to in order to uh get in order to
order to in order to uh get in order to create uh in order to create a single
create uh in order to create a single single user or something like that the
single user or something like that the business logic need to talk to a
business logic need to talk to a database we need to talk to a database
database we need to talk to a database in a scenario where we want to talk to a
in a scenario where we want to talk to a database then uh the database
database then uh the database connections and everything should be in
connections and everything should be in uh in that business logic so that's
uh in that business logic so that's going to crowd the business logic layer
going to crowd the business logic layer so in order to access
so in order to access databases anything related to database
databases anything related to database we separate the data layer the data
we separate the data layer the data communication layer especially with the
communication layer especially with the database or another service we separate
database or another service we separate another layer out of the business logic
another layer out of the business logic to a data layer so we have three layers
to a data layer so we have three layers now the first one is the request layer
now the first one is the request layer second one is the business logic layer
second one is the business logic layer third one is the data layer so any
third one is the data layer so any request coming in we will first
request coming in we will first encounter with the request layer
encounter with the request layer anything that need to be calculated any
anything that need to be calculated any business logic need to be happened we
business logic need to be happened we will do it in the uh business logic
will do it in the uh business logic layer and we have a third layer which
layer and we have a third layer which will be accessing all those data okay so
will be accessing all those data okay so you guys can see three tiers the request
you guys can see three tiers the request tier distance logic and the data okay so
tier distance logic and the data okay so that's how a three tier architecture
that's how a three tier architecture representation happens so we have three
representation happens so we have three tiers request business logic and model
tiers request business logic and model or the database
or the database to so this is like the common
to so this is like the common architecture pattern that you guys can
architecture pattern that you guys can use okay it is only three layers but it
use okay it is only three layers but it is not limited to three as I mentioned
is not limited to three as I mentioned earlier the architectural patterns the N
earlier the architectural patterns the N architecture pattern n okay the word n
architecture pattern n okay the word n represent any number but for more most
represent any number but for more most common problems that you will see today
common problems that you will see today with um with uh applications such as web
with um with uh applications such as web application three tier would be enough
application three tier would be enough okay I'm not saying it is always going
okay I'm not saying it is always going to be the case three tiers will be
to be the case three tiers will be enough if you want more layers of course
enough if you want more layers of course you can add say for example your
you can add say for example your business logic is really complex okay
business logic is really complex okay the business logic is really complex in
the business logic is really complex in in a case like that you can divide the
in a case like that you can divide the business logic into
business logic into two or three layers so that will add
two or three layers so that will add more layers in between okay it is not
more layers in between okay it is not limited to three but you can have
limited to three but you can have multiple layers okay depending on your
multiple layers okay depending on your project and it is it is
project and it is it is complexity so the request layer normally
complexity so the request layer normally stays around with one layer that is that
stays around with one layer that is that is like uh that is like normal but as I
is like uh that is like normal but as I mentioned earlier it is not limited to
mentioned earlier it is not limited to having one single layer for handling
having one single layer for handling request it it can have multiple layers
request it it can have multiple layers that is also fine this logic as I
that is also fine this logic as I mentioned earlier if it is very complex
mentioned earlier if it is very complex we separate the business logic into
we separate the business logic into separate layers data layer is also there
separate layers data layer is also there normally we can have many more layers
normally we can have many more layers okay but simply there will be three
okay but simply there will be three layers as most you sometimes somebody
layers as most you sometimes somebody can use two layers if they want but a
can use two layers if they want but a recommendation for a web application my
recommendation for a web application my recommendation at least what of what
recommendation at least what of what most users will get is a three tier or
most users will get is a three tier or three uh three tier architecture right
three uh three tier architecture right now we have all those three tiers in one
now we have all those three tiers in one single file okay so we have the request
single file okay so we have the request this is the request endpoint and we have
this is the request endpoint and we have our business logic in here since we do
our business logic in here since we do not have a data layer the data layer is
not have a data layer the data layer is also in here okay so all these three
also in here okay so all these three three layers three things are within one
three layers three things are within one single request so so this is considered
single request so so this is considered to be bad practice let me tell you why
to be bad practice let me tell you why this is bad after we Implement a sample
this is bad after we Implement a sample application using 3ar architecture okay
application using 3ar architecture okay so this is uh this is working okay this
so this is uh this is working okay this is working perfectly anyone can anyone
is working perfectly anyone can anyone can code like this a project can run
can code like this a project can run like this yes you can but uh on the long
like this yes you can but uh on the long term long run this would definitely give
term long run this would definitely give us headache Okay so so we have the
us headache Okay so so we have the request layer we have the uh business
request layer we have the uh business logic layer and we have the data layer
logic layer and we have the data layer all in one single location we will try
all in one single location we will try to tear this up into three different
to tear this up into three different layers and see how we can work with that
layers and see how we can work with that okay so anyone have any questions um
okay so anyone have any questions um with the three tiers the request
with the three tiers the request distance logic and the data anyone have
distance logic and the data anyone have any questions regarding those three
any questions regarding those three layers anything that need to be
layers anything that need to be clarified
okay suppose everybody got uh the DTs that we'll be working on and we will see
that we'll be working on and we will see how we can create a simple web
how we can create a simple web application that represent this 3s okay
application that represent this 3s okay so as you guys can see I used a very
so as you guys can see I used a very simple um single
simple um single um single file the appjs file to create
um single file the appjs file to create a simple application that as as
a simple application that as as mentioned
mentioned earlier nowadays we do not uh develop
earlier nowadays we do not uh develop application like this okay so you need
application like this okay so you need to find all the packages we need to have
to find all the packages we need to have all these things um there are like
all these things um there are like certain other aspect of program that we
certain other aspect of program that we need to work on like certainly the
need to work on like certainly the structure of the program how we going to
structure of the program how we going to structure it okay and what are the um
structure it okay and what are the um what are the testing Frameworks of
what are the testing Frameworks of course our code need to be tested okay
course our code need to be tested okay so what is the testing framework that we
so what is the testing framework that we going to use and how we going to set up
going to use and how we going to set up within our
within our program and what are the things that we
program and what are the things that we that we will be using uh to deploy this
that we will be using uh to deploy this okay so all those things are done over
okay so all those things are done over and over and over again we come to a
and over and over again we come to a what we call a template okay a template
what we call a template okay a template that we can that we can use to or to
that we can that we can use to or to start Kickstart our project okay rather
start Kickstart our project okay rather than putting all the de dependencies all
than putting all the de dependencies all the testing Frameworks and all the
the testing Frameworks and all the building script and everything you don't
building script and everything you don't need to worry all this all this from
need to worry all this all this from scratch what we can do is we can use a
scratch what we can do is we can use a code
code generation uh tool that will help us to
generation uh tool that will help us to create an application so that we don't
create an application so that we don't know to do the heavy lifting when we are
know to do the heavy lifting when we are creating a file so that's what I use uh
creating a file so that's what I use uh in
in here
here uh we use the program called
uh we use the program called uh
uh um We call we use the program called NX
um We call we use the program called NX okay the NX is a tool that we can boost
okay the NX is a tool that we can boost up our application that we can create an
up our application that we can create an application so we don't have to create
application so we don't have to create in from scratch okay so in we first we
in from scratch okay so in we first we need to install NX like we did injs we
need to install NX like we did injs we need to install NX okay or we can use NX
need to install NX okay or we can use NX uh NX based simple tools that we can um
uh NX based simple tools that we can um that we can create the application let
that we can create the application let me um
me um okay
okay let me stop the current application I will see the
I will see the back so in order to create uh an NX
back so in order to create uh an NX application as I mentioned earlier there
application as I mentioned earlier there is the website called NX Dev okay so you
is the website called NX Dev okay so you can create a simple workspace that means
can create a simple workspace that means a simple project uh using um this
a simple project uh using um this command so you can install this npx
command so you can install this npx create NX workspace command in order to
create NX workspace command in order to create a new
create a new Fresh uh fresh web web um web
Fresh uh fresh web web um web application okay so what I did was I use
application okay so what I did was I use this command npx create workspace at
this command npx create workspace at latest that means we I am going to
latest that means we I am going to create a new workspace and I'm going to
create a new workspace and I'm going to name it
name it SF SF that is the workspace name that
SF SF that is the workspace name that can that's think as the project name
can that's think as the project name that that I'm giving for this okay so
that that I'm giving for this okay so I'm going to give that name
I'm going to give that name and by using this it will ask some basic
and by using this it will ask some basic questions what are the Frameworks and
questions what are the Frameworks and all I think we have already covered if
all I think we have already covered if you want to go back and see the video
you want to go back and see the video once again basically it will create a
once again basically it will create a simple
simple application that is
application that is uh close
one close window I don't not need this yes that is this application you guys
yes that is this application you guys can see there are all I mean don't get
can see there are all I mean don't get overwhelmed by all the things that you
overwhelmed by all the things that you see it in here basically it it has set
see it in here basically it it has set up a simple web application to us okay
up a simple web application to us okay simple very simple web application with
simple very simple web application with all the uh testing Frameworks it's all
all the uh testing Frameworks it's all the basic starting point for application
the basic starting point for application and all the dependencies and everything
and all the dependencies and everything to run our project okay so um there are
to run our project okay so um there are a lot of uh prebuilds things uh done for
a lot of uh prebuilds things uh done for us especially with the you know when we
us especially with the you know when we when we are done with the application we
when we are done with the application we need to build this application this is
need to build this application this is the source code once we need to uh once
the source code once we need to uh once once we are done with the source code we
once we are done with the source code we need to uh run it somewhere before we
need to uh run it somewhere before we run it we need to build it so we have
run it we need to build it so we have the build script running we have the
the build script running we have the developments um script uh de script are
developments um script uh de script are there building script are there testing
there building script are there testing script are there so basically a simple
script are there so basically a simple web application is created for us by by
web application is created for us by by simply using those uh code generation
simply using those uh code generation tools so first thing that we need to
tools so first thing that we need to look at is this package Json okay as you
look at is this package Json okay as you guys can remember with the express one
guys can remember with the express one so we are not seeing Express directly
so we are not seeing Express directly but if you go to to njs C and something
but if you go to to njs C and something like that you would would find Express
like that you would would find Express bu deep behind them so there are other
bu deep behind them so there are other libraries that we are using or packages
libraries that we are using or packages that we are using and there are de de
that we are using and there are de de packages that we are using that means
packages that we are using that means while developing we will be using these
while developing we will be using these packages but when we want to deploy
packages but when we want to deploy these things these are no longer valid
these things these are no longer valid we do not need these things in the
we do not need these things in the running application so for
running application so for example um we have testing Frameworks
example um we have testing Frameworks right we will test our program while we
right we will test our program while we are building it while we are in the
are building it while we are in the development place okay once we
development place okay once we developments are done once we want to go
developments are done once we want to go to a hosting server and once we want to
to a hosting server and once we want to share this with the world we do not need
share this with the world we do not need the uh tools that we use while we are
the uh tools that we use while we are testing the frame testing the
testing the frame testing the application so we would
application so we would have we would have left left down all
have we would have left left down all the test T in stuff um while we are
the test T in stuff um while we are building the application after we build
building the application after we build it we do not use the testing libraries
it we do not use the testing libraries so that's why we have two dependencies
so that's why we have two dependencies type uh the D dependencies which
type uh the D dependencies which represent uh the dependencies that we'll
represent uh the dependencies that we'll be using while we are developing and
be using while we are developing and dependencies so these are dependencies
dependencies so these are dependencies we need in order to run and develop at
we need in order to run and develop at the same time okay so these are
the same time okay so these are development time need
development time need and these are on time needed okay
and these are on time needed okay so we will not look into these libraries
so we will not look into these libraries we we probably won't be looking more
we we probably won't be looking more into this unless we need to add a
into this unless we need to add a certain certain functionality to our
certain certain functionality to our application for example if you want to
application for example if you want to add database connectivity then we will
add database connectivity then we will install a certain package that we will
install a certain package that we will be using okay we will see that uh in a
be using okay we will see that uh in a moment right now
moment right now uh we'll be we'll be focusing on uh
uh we'll be we'll be focusing on uh getting the N architecture and running
getting the N architecture and running it once again okay so in order to get uh
it once again okay so in order to get uh uh the application structure so we need
uh the application structure so we need to know the package Json we can have a
to know the package Json we can have a look around it and the most important
look around it and the most important folder is going to be this SRC de okay
folder is going to be this SRC de okay so
so SRC stand for Source at the the source
SRC stand for Source at the the source code of our application and inside there
code of our application and inside there are few files the main main file which
are few files the main main file which is something like the adjs file that we
is something like the adjs file that we have seen earlier on
have seen earlier on and probably you will find something
and probably you will find something similar the app directory and we will
similar the app directory and we will have the listen Port thing so it's going
have the listen Port thing so it's going to also run on Port
to also run on Port 3000 okay so we we can also while we are
3000 okay so we we can also while we are running we can change that but if we if
running we can change that but if we if you do not specify something it's
you do not specify something it's automatically going to run on Port 3,000
automatically going to run on Port 3,000 okay so this is like do not worry about
okay so this is like do not worry about all these uh Global Prix and everything
all these uh Global Prix and everything which uh which and the bootstrap methods
which uh which and the bootstrap methods all these things just think uh when we
all these things just think uh when we run this application it's going to start
run this application it's going to start a web service on to 3,000 okay you can
a web service on to 3,000 okay you can have look around these things in in
have look around these things in in later on
later on right now we are running an application
right now we are running an application with Pro 3,000 and uh you guys can
with Pro 3,000 and uh you guys can remember the end points that we had on
remember the end points that we had on the njs application right now uh as a as
the njs application right now uh as a as a good practice we uh we
a good practice we uh we have uh endpoint prefix uh with all the
have uh endpoint prefix uh with all the apis that that means we I'll show you
apis that that means we I'll show you that means if you if you have endpoint
that means if you if you have endpoint call message by default it will it will
call message by default it will it will be it will be Rewritten to API message
be it will be Rewritten to API message if you have an endpoint called user by
if you have an endpoint called user by default it will be ritten to API users
default it will be ritten to API users okay so that that is something uh the
okay so that that is something uh the community follows when we are developing
community follows when we are developing an rest API we normally have the prefix
an rest API we normally have the prefix called API in front of that okay so when
called API in front of that okay so when we run this application it will uh start
we run this application it will uh start it will start application in code 3,000
it will start application in code 3,000 okay so let me run this application
okay so let me run this application simply I will I will um I will go to the
simply I will I will um I will go to the directory uh from the terminal where I
directory uh from the terminal where I start the application so uh it is
start the application so uh it is in uh s swt so this is the location that
in uh s swt so this is the location that I have choose uh the project right now
I have choose uh the project right now it is in the TMP and SF sft directory it
it is in the TMP and SF sft directory it can be within your programs or
can be within your programs or documents projects whatever the location
documents projects whatever the location that you say so basically uh go to
that you say so basically uh go to your terminal or command line uh open
your terminal or command line uh open the command line where your project is
the command line where your project is there so how do you know that is the
there so how do you know that is the same directory so you guys can see the
same directory so you guys can see the package Jon okay if you like try to
package Jon okay if you like try to explore it and if you see the package
explore it and if you see the package Jon right there then that that is that
Jon right there then that that is that means you are in the correct location
means you are in the correct location okay make sure the packages and or the
okay make sure the packages and or the at least what whatever the files that
at least what whatever the files that you have seen is visible that means you
you have seen is visible that means you are in the correct location okay so in
are in the correct location okay so in order to run this application like what
order to run this application like what we did in the earlier on we we have
we did in the earlier on we we have certain other things uh uh prepared for
certain other things uh uh prepared for us especially what we call a hot preload
us especially what we call a hot preload and there are certain things uh we we we
and there are certain things uh we we we have already configured in this so if
have already configured in this so if you guys can remember when I write the
you guys can remember when I write the next year's
next year's application uh if I do a change I need
application uh if I do a change I need to stop and I need to run it again and
to stop and I need to run it again and uh if I do a simple modification on my
uh if I do a simple modification on my source code I need to stop it and run it
source code I need to stop it and run it again but uh with the with this project
again but uh with the with this project setup that we have come across we do not
setup that we have come across we do not need to do that whenever we do a project
need to do that whenever we do a project uh when we do a project change and we
uh when we do a project change and we save it and it will be automatically
save it and it will be automatically reload for us we don't need need to
reload for us we don't need need to reload our servers we do not need to
reload our servers we do not need to stop or anything like that we do our
stop or anything like that we do our coding we save it and it will be
coding we save it and it will be automatically reloaded okay so you don't
automatically reloaded okay so you don't have to stop every time and go back and
have to stop every time and go back and do those things so everything is set up
do those things so everything is set up for us we don't want to worry about that
for us we don't want to worry about that we'll simply try to run this application
we'll simply try to run this application so we can run these application by by
so we can run these application by by simply looking at one single command
simply looking at one single command under the package H Json file you'll
under the package H Json file you'll find scripts okay these scripts are what
find scripts okay these scripts are what able to run this application so in order
able to run this application so in order to run there is the commands might be
to run there is the commands might be different but in in this in this in this
different but in in this in this in this example or in this project we can see
example or in this project we can see the start script that means we will be
the start script that means we will be starting our server then we there will
starting our server then we there will be build script that means it will build
be build script that means it will build our build our application and there test
our build our application and there test script that means it will test our
script that means it will test our application so the name implies what it
application so the name implies what it does so if I want to start the
does so if I want to start the application I can run this script okay
application I can run this script okay so simply I can uh run by npm start
so simply I can uh run by npm start command okay if I run if I run npm start
command okay if I run if I run npm start the application will start and if I want
the application will start and if I want to build I can uh run this script in
to build I can uh run this script in different way okay so if I want to test
different way okay so if I want to test I can run npm this by looking at it I
I can run npm this by looking at it I will say npm startop okay so if I hit
will say npm startop okay so if I hit npm staff you guys can see uh it will
npm staff you guys can see uh it will take a little bit time for the first
take a little bit time for the first time and it is uh not like the njs
time and it is uh not like the njs application uh sorry the express JS
application uh sorry the express JS application that we created it will show
application that we created it will show some logs okay it we say okay our
some logs okay it we say okay our application is running on localport 3000
application is running on localport 3000 and API we'll just simply go there and
and API we'll just simply go there and see what's going on so the API endpoint
see what's going on so the API endpoint is given for us you can just simply copy
is given for us you can just simply copy or we and just uh copy uh copy this
or we and just uh copy uh copy this and uh paste it in our application and
and uh paste it in our application and what you guys get a simple me uh message
what you guys get a simple me uh message saying hello API okay so we will get a
saying hello API okay so we will get a simple message a simple
simple message a simple Json uh the key is message and the value
Json uh the key is message and the value is hello AP okay so we get a
is hello AP okay so we get a simple Json response when we go to Local
simple Json response when we go to Local Host port 3,000 and API inome okay
Host port 3,000 and API inome okay so you you you guys might think okay
so you you you guys might think okay there is app. get like what we have seen
there is app. get like what we have seen in the previous example there will be
in the previous example there will be something
like something similar there right yes but it bit little bit of different is
but it bit little bit of different is that we
that we have in this uh in this framework in
have in this uh in this framework in this m this framework we have introduced
this m this framework we have introduced what we called tier architecture we will
what we called tier architecture we will see the ti
see the ti architecture anything with this project
architecture anything with this project setup I know the there are lot of files
setup I know the there are lot of files in here with kep config what are these
in here with kep config what are these don't do not want to worry about these
don't do not want to worry about these files in in in this stage all you just
files in in in this stage all you just need to know okay the package is there
need to know okay the package is there and the SRC directory is here at least
and the SRC directory is here at least SRC and familiar one is not modules as I
SRC and familiar one is not modules as I mentioned earlier this contain all the
mentioned earlier this contain all the runtime libraries and other things just
runtime libraries and other things just for now just ignore any questions up
for now just ignore any questions up until this okay at least you guys need
until this okay at least you guys need to create a project and you need to
to create a project and you need to start okay so you know where to get the
start okay so you know where to get the script you can say npm start and the
script you can say npm start and the application will start okay and there is
application will start okay and there is another command that you can run if you
another command that you can run if you look at the project Jon so Project G
look at the project Jon so Project G sorry not the project Jon package Json
sorry not the project Jon package Json file the start command is also can be
file the start command is also can be achieved by index Ser okay you can say
achieved by index Ser okay you can say two things you can say npm start or you
two things you can say npm start or you can say NX
can say NX server the both will do the same thing
server the both will do the same thing it will start the application okay any
it will start the application okay any questions up until this because we will
questions up until this because we will be into the enti architecture
okay awesome if you guys have anything just interrupt me anytime
just interrupt me anytime okay all right let's go back to the
okay all right let's go back to the source code
source code itself as we uh discuss we will be
itself as we uh discuss we will be starting from the SRC directory and we
starting from the SRC directory and we looked at the main just simply look at
looked at the main just simply look at it as
it as uh it's starting the web server on Port
uh it's starting the web server on Port 3000 and it's starting the boot strap
3000 and it's starting the boot strap okay
okay and one thing that we need to look is in
and one thing that we need to look is in here something
here something called uh app module okay there is a uh
called uh app module okay there is a uh there is when you are looking at this
there is when you are looking at this file it is creating or it is using
file it is creating or it is using something called app module this is what
something called app module this is what this is not something that you find in
this is not something that you find in the nests application we we have but
the nests application we we have but simply uh in here what we have done is
simply uh in here what we have done is uh as I mentioned earlier we will be
uh as I mentioned earlier we will be splitting up our application we'll be
splitting up our application we'll be separating these things in different
separating these things in different forms so module is modularization is
forms so module is modularization is something that we will consider so a
something that we will consider so a module think a module
as as a single uh single uh feature within our application
single uh feature within our application for
for example we we talked about uh several
example we we talked about uh several things in our system we talked about
things in our system we talked about users we talked about schools and we
users we talked about schools and we talked about um teachers okay so within
talked about um teachers okay so within our system we will have three uh three
our system we will have three uh three features user
features user School user school and teachers so we
School user school and teachers so we have three different features within our
have three different features within our application so we can we can categorize
application so we can we can categorize or we can uh have things related to
or we can uh have things related to users within the user module okay
users within the user module okay something related to user we will have
something related to user we will have within the user module something related
within the user module something related to
to um something related to the school we
um something related to the school we can have a school modu if something
can have a school modu if something related to teacher we can have a teacher
related to teacher we can have a teacher module so think of the
module so think of the um think all the DS and everything
um think all the DS and everything linking to one another linking to
linking to one another linking to another as in a single entry point or
another as in a single entry point or single packaging point or single feature
single packaging point or single feature point we can call it as a module okay so
point we can call it as a module okay so the app module is a special module in in
the app module is a special module in in this framework okay the app module is
this framework okay the app module is where we have
where we have uh all the modules report this is like
uh all the modules report this is like the starting point for our application
the starting point for our application okay so we have a starting point for
okay so we have a starting point for application so the uh app module uh have
application so the uh app module uh have uh few things you guys can see these an
uh few things you guys can see these an what we call these decorations do not
what we call these decorations do not worry about these things right now so we
worry about these things right now so we have things like controllers so if you
have things like controllers so if you guys can remember we have three tiers
guys can remember we have three tiers within our application the first one is
within our application the first one is the uh end point or the controller layer
the uh end point or the controller layer what we call so we can have all the
what we call so we can have all the controllers defined in a controller
controllers defined in a controller layer okay and we can have the business
layer okay and we can have the business Logics we discuss business logic we call
Logics we discuss business logic we call in this framework we call these things
in this framework we call these things providers okay do not expect uh all the
providers okay do not expect uh all the Frameworks in the world we'll call these
Frameworks in the world we'll call these things as uh control
things as uh control or endpoint uh business Logics or data
or endpoint uh business Logics or data layers okay each Frameworks has its own
layers okay each Frameworks has its own definition okay so in NJ the um the
definition okay so in NJ the um the controller layer is basically controlers
controller layer is basically controlers but the business logic layer what we
but the business logic layer what we call is something called uh we in in
call is something called uh we in in here we call like providers or Services
here we call like providers or Services okay and in the data layer in a data
okay and in the data layer in a data layer we do not call that as a data
layer we do not call that as a data layer but we call it as a repository
layer but we call it as a repository okay so different things have different
okay so different things have different namings but the architecture the three
namings but the architecture the three tis will remain most of the time the
tis will remain most of the time the same okay so within the app module you
same okay so within the app module you will find controllers and services okay
will find controllers and services okay the providers and controllers so these
the providers and controllers so these are the controllers that we saw if I go
are the controllers that we saw if I go to the app. controller file you will see
to the app. controller file you will see the
the um controller as you guys can
um controller as you guys can remember you guys can see the to API
remember you guys can see the to API nothing no end points are available
nothing no end points are available there so it's going to be responding for
there so it's going to be responding for this okay and the data that we are
this okay and the data that we are getting is coming from the app service
getting is coming from the app service okay and you guys can see the thing that
okay and you guys can see the thing that we have seen in here that is called the
we have seen in here that is called the hello APM okay that is what we are
hello APM okay that is what we are getting here so we will forget about all
getting here so we will forget about all these things just want to show you guys
these things just want to show you guys how it works and we will create a module
how it works and we will create a module from scratch okay we'll create a module
from scratch okay we'll create a module from scratch we will Define the uh
from scratch we will Define the uh controller layer we will Define the
controller layer we will Define the service layer and uh probably a dummy
service layer and uh probably a dummy repository layer okay because we do not
repository layer okay because we do not have the database everything set up
have the database everything set up right now right now we will create uh a
right now right now we will create uh a simple module and we will incorporate
simple module and we will incorporate into our application okay we'll see how
into our application okay we'll see how we can create multiple modules and
we can create multiple modules and incorporate okay so basically
Click on any text or timestamp to jump to that moment in the video
Share:
Most transcripts ready in under 5 seconds
One-Click Copy125+ LanguagesSearch ContentJump to Timestamps
Paste YouTube URL
Enter any YouTube video link to get the full transcript
Transcript Extraction Form
Most transcripts ready in under 5 seconds
Get Our Chrome Extension
Get transcripts instantly without leaving YouTube. Install our Chrome extension for one-click access to any video's transcript directly on the watch page.