This content is a comprehensive, practical guide for aspiring DevOps engineers, covering essential tools and concepts from foundational Linux commands and Git to Docker, CI/CD pipelines, AWS deployment, and Kubernetes basics.
Mind Map
Click to expand
Click to explore the full interactive mind map • Zoom, pan, and navigate
Hey everyone, welcome back to the
channel. So in this particular video, we
are going to cover each and everything
that you need to know to start your
journey as a DevOps engineer. Right. So
before even I start explaining all the
curriculum and everything that we are
going to cover, one thing I wanted to
mention and you can see it's very
clearly mentioned that this is a
practical course. So what I mean by
that? So that means uh we are going to
use man application as a base
application or demo app and then what
will happen right? We are going to cover
concepts and flows and then whatever we
have learned from those two sections
we'll be applying all the concepts in
our man applications. So that is the
reason it will be a completely practical
course. Also one more thing I wanted to
mention that I've given lot of effort
while creating this particular video. So
it will be very helpful. So if you
please can like comment subscribe and
also can share with your friends right
and see if I get good response I will
give my word. I will be uploading part
two and part three of this particular
series. So each and everything that we
are going to cover in this complete
series. Another thing I wanted to
mention that uh all the code and all the
notes you will be getting the
description. So what you need to do
right you have to just visit my website
that is completely free sdebop.com and
from there you can download all the
notes and the source code that we are
going to use for this particular video.
Second thing I wanted to mention that
I've added one more link uh that is
actually my friend's channel. So he also
makes similar kind of videos and his
content is also very good. So if you are
interested so I'll leave the link in the
description. You can check his channel
and also please subscribe. It will be
very helpful. Now let's see what are the
things that we are going to cover in
this particular uh video or this is the
part one of our DevOps practical food
course. So as you can see that so this
will be the complete overview that first
we'll be having the our introduction
section or introductory section that
we're going to then we'll move to github
and environment management we're going
to cover build docker continuous
integration AWS deployment cicd and then
kubernetes basics now let's go through
each and every section for the part one
but before that I just wanted to quickly
show you that what are the things that
we are going to cover in the part two
and part three so in Part two for now I
have decided all of this. So this will
definitely going to change. So I will be
uploading the detailed curriculum after
some days in my channel community post
or you can also see the same in my
website also. So next part we are going
to cover GitHub in depth. Docker will be
in depth. Okay. Then we are going to
cover the Kubernetes intermediate only.
Then we are going to cover genkins
because genkins is in uh standard. So in
the first part we are going to cover
GitHub actions and the second part we
will be using genkins and then we are
going to cover configuration management.
Okay. And then in the part three we are
going to cover the advanced Kubernetes
infrastructure as code monitoring and
login. These will be in depth. Right.
We're going to cover Prometheus kafana
each and everything. Then we're going to
cover dev six ops. All right. So
security and devops and then at the end
we'll be covering advanc CI/CD
pipelines. Now again I wanted to mention
that this is just temp I have added
temporary I have added for part two and
part three. But this both is going to uh
this all the curriculums maybe it will
change. So if it's uh change I'm going
to upload all this in my channel. Now
let's go back to the part one and see
that what are the things we're going to
cover in depth because this is very very
important before you can jump directly
to the uh conceptual or the theory part.
So first one will be DevOps. So we're
going to understand what is DevOps right
why actually we need DevOps right what
will be the flows like DevOps complete
life cycle we are going to cover Linux
in DevOps basic Linux commands file
system navigation find and search
selfcripting why we need scripting in
automation and we're going to write our
first script okay then we'll move to the
next part where we're going to cover the
basics of github right very very basics
you'll see that I'll be covering
everything from ground up with practical
ical implementation. So it will be easy
to understand right. G commands, G
ignore file, how you can set up repo,
remote course, branching strategies,
environment management, what is dev
environment, stage environment, prod
environment, why we need all those
environment, all the things. All right.
Next, we're going to go to build and
containerization. So here we are going
to cover Docker. What is Docker? Why we
need Docker architecture diagram in
details? We will see that how you can
install Docker run first container. What
is Docker engine images containers
right? Then we are going to use Docker
in our man application. Right? We'll be
understanding how you can create Docker
for our server side, client side. What
is Docker Compose? Why we need Docker
Compose each and everything in details.
Next, we'll be moving to another
extremely important life cycle in DevOps
that is continuous integration. So, what
is continuous integration or CI? Why
actually you need that? We're going to
set up GitHub actions write CI flow and
also we're going to implement build and
lint in our project uh in our man
application uh right and also pre-tier
right you'll be understanding all the
things how it will work next we'll move
to extremely important I think manufure
also suggested to cover AWS deployment
so we are going to deploy our man
application in EC2 so uh so here we I
will add all these notes and everything
right how we are going to create AWS
account launching EC2 instance creating
instance, how you can install Docker,
Docker, Docker Compose in EC2, how you
can deploy man application inside EC2
practically and then how we can access
our app via public IP. Next, we'll be
moving to CD, right? CD means CI/CD like
continuous deployment. So, we have
already covered the CI in the previous
section. Then, we'll move to CD. So,
we're going to use GitHub actions and
then we are going to automate our
deployment. So what whenever we are
going to push any changes it will
automate automatically deploy all the
changes in our EC2 instance right it
will be very very important and then
we're going to cover another very
popular and important tool in DevOps
that is Kubernetes and this is very very
complex like Kubernetes is not simple
but still I decided to keep the basic
part only in this first section the
reason is because it will be easy for
you whenever we are going to cover and
go into the details in the next part so
we'll be discussing in details what is Kubernetes
Kubernetes
So in this particular section there will
be more concepts why we need Kubernetes
right what are the advantages highle
architecture how we are going to set up
local structure using mini cube right
installing cube uh cubectl mini cube
start uh cluster verify we are going to
deploy my application on kubernetes from
scratch right how you can build load
images into kubernetes how you can
create deployment and also how you're
going to create services so there are a
lot of things that we are going to cover
you might think that this is only like
almost 6 hours of video but believe me
if you watch this video right even 12
hours video can't defeat this video
right this is that much good so I've
given that much effort and thinking
behind this particular video and you'll
understand that how I'm going to cover
each and everything simply so without
further any more time let's get started
and good luck all right so let's get
started so in the previous section we
have discussed in details all the intro
curriculum and what are the things that
we are going to cover in the next parts
now before I start this intro and the uh
Linux and cell scripting fundamentals. I
wanted to mention the same thing again
and again that this will be a practical
DevOps course. So what I mean by that?
So I'll just confirm all of these one
second. So we are we will not keep each
and everything very conceptual because
all the details and everything we are
going to cover in the next parts, right?
So when we'll be covering the part one
and part three you will see that we'll
be having more concepts because we will
be learning the concepts more in depth.
So what this video we are going to
cover. So this will give you a very
basic DevOps concept related all the
ideas like what is it why it is needed
what will be the flow if we have any
commands that we are going to learn and
then how we are going to apply all of
these in our man application. You'll
understand what I mean. So this will be
a perfect flow. If for if you are a
complete beginner right instead of going
too much in depth because see when I
make any videos on YouTube right I
usually go through each and every videos
that is already available in this
particular topic for example let's I'll
search on this devops and I'll see that
how many videos are there and how they
have teach what they have teach in those
videos right and most of the videos I
see that they have done really good job
but some videos we have lot of concepts
some videos we have too much practical
so what I will do the complete deop
series right I'll try to keep a balance
of both but for the first part let's
start with learning both concepts and
then we are going to learn all those
concept by applying in the man
application which will be practical but
it will be you can consider this one in
general a practical devops course okay
so now the first thing what you're going
to understand that what is devops right
so what I'm going to do right so let's
probably take some save and then I'm
going to just write each and everything
because these concepts are very very
important and I'm going to add all of
these in my website so you can go there
and download. So first we need to
understand that what is actually DevOps right
right
and I'll try to keep these concepts
little simpler and short. So what is
DevOps? Now see we can say that DevOps
is like a set of practices
that we usually combine in our software
development or IT operations. It can be
IT operations also which will help us in
automating and improving the flow of
software development. Right? So starting
from development, testing and
deployment. So we try to write this one
in a simpler way. So it's a set of practices
combine software
software development.
development.
Okay. Software development, right? and
also I operations where we actually aim
and automation or automating
and improving
the flow of dev means development plus
or like development then we have testing
and then we have also deployment. So
this will be the basic definition of
DevOps right. So it's a set of practices
that we usually combine in our software
development life cycle where we are
actually aiming and automation or
automating and improving the flow of the
entire life cycle. Flow of the entire
life cycle means starting from
development to deployment. Whatever
things will come in between that
actually lies in a DevOps life cycle.
Okay. So now in short if I try to
explain so what will be DevOps? This
will be development actually this is
important. So it will be development
plus it will be operations right and
that's it. Now this will be the
definition. Now we will go in depth
instead of spending like half an hour
explaining what DevOps is right in a
conceptual wise I'm talking about. So
it's like development plus operations.
Now next what it actually helps now
three points very very important. So it
helps in build faster right. Second it
will be deployment or deploy deploy safe
or safer and then we are also going to
it will be like I will write in a
simpler way that it is easy to maintain
right it will be easy to maintain or
maintainable. So three will be the main
key advantages. So build will be faster
deploy will be safe and easy to maintain
as simple as that. Now see when we don't
have devops right before that we usually
have lot of a lot of problems right so
whenever development development team
usually write code and they can do
whatever they like right so let's say
you don't have any process so you can
just write it without any testing also
you can deploy that code and it will
break in production right whenever it
will be userfacing application and this
will create a lot of issue even it can
bring the business down right because
when you have uh I think I also going to
explain this P 0 P1 type of application
So what I mean by that? Let me explain.
So whenever you working on a very big
company, right? So big companies have
different layer of applications. So
let's say you have a company A, I'm not
going to write any name. I just don't
want to write. So consider any fan
companies, right? So they usually have
lot of applications, right? They don't
have a single website, right? And each
and every application is designated to a
certain level. So what I mean? So for
example let's say I have a P 0 then I
have P1 then I have P2. If you're
working you'll know that whatever I'm
writing it's 100% true and if you're
college and once you get into company
you'll understand all of these right
then P3 P4 something. Now what this
means is right these things are very
important. So when it's a P application
means it's a userfacing application it's
very very very sensitive like very
important right. So for example let's
say uh we are using something like
chatgd. Now chatgpd when you are typing
chatgpbd.com that's a userfacing
application. Now let's say something
some developer make some mistake and
something breaks and chargity goes down
for 1 hour. What will happen? Now think
in 1 hour how much it can like bring
this charge revenue and everything down.
Right? I hope you're getting what I'm
trying to say. So this level each and
every company has different different
type of applications and they have
designated level when it's a P 0 P1 even
P2 it is very very sensitive and very
important. Now in this type of
application you need some kind of
security right so and also
maintainability so that we can actually
maintain those kind of application in a
smooth way and whenever we are going to
deploy it we don't usually face any
issues I hope you're getting. So this is
what DevOps actually solves right as
simple as that. So how it will solves?
So now when you're talking about the
life cycle of DevOps, here comes the
very very important thing and these
things you will get in your interview
questions also right that what is
actually development of sorry life cycle
of a DevOps. Now I'm talking about the
seven pillars that I have noted down. So
starting with plan. So we have plan. I'm
going to explain what it all of this is.
Then we are going to have develop.
Next we are going to have build. Next we
are going to have test. Next we are
going to have release. Next we are going
to have deploy. And next we are going to
have monitor.
Right? Consider this one a complete deop
life cycle steps. Starting with plan.
Right? Whenever you are working on any
application any product it can be
anything doesn't matter. You can 100%
give guarantee that there will be a plan
before doing the development. What we
mean by plan? Plan is nothing but your
business requirement, right? So, so you
have some business requirement, right?
So, from business requirement, it comes
to products, product department. So,
product what it will do, right? Product
usually captures those business
requirement and they will create a
skeleton kind of thing. I'm giving you a
very very detailed explanation, right?
So, what usually this life cycle
happens. So, whenever so let's say
company A is launching a new feature. So
what they will do right on the company
business level there will be 10 business
requirements then it will be the duty or
responsibility of product managers right
or product department that they will
actually save all those business
requirement and then they're going to
create a detailed documentation workflow
whatever doesn't matter then what will
happen right so you are going to gather
all the requirements so product will
gather all the requirements and all the
features and then they'll come to the
engineering team this is how easily it
works Then now in between there are a
lot of other steps like for example
let's say you have a product managers
they're gathering requirements and then
in between you you'll be having UX and
UI team right so UX team is going to
design the application or product
whatever you'll be working and then
usually what product team is going to
work with the engineering team so they
will give the requirement to the
engineering team and engineering team
will see the reliability of those
requirements that okay this requirement
this uh feature is feasible this is not
and then they're going to have a
detailed conversation maybe 1 month 2
months some sometime it go it can go
till 6 months right it depends on the
complexity once you have all the
requirements ready that actually
completes the plan okay so this is the
first step next we're going to have the
develop I don't have to explain anything
once everything is done we are going to
set up set uh setting up our repository
we'll be writing our code and the coding
uh flow like It can go till 1 year, 2
year depending on the product that you
are developing. Right? Build. Now next
after develop you need to build the code
right. So build is one of the uh step
here where we usually use some CI tools.
So that we are going to explain in
details. CI is nothing but continuous
integration right. So that means
whenever we are going to develop and
push the code we don't have to manually
build it right. So it will automatically
getting built. maybe some we are going
to use GitHub access and then we you'll
be having genkins that is genkins is
actually very standard that I'm going to
cover in the next part not in this part
so third part will be third step will be
sorry third step will be build so after
build we'll be having test right test
can be two two type of test mostly we
are going to focus again I'm not going
to cover testing in this one because
we'll be covering automation automated
testing and lot of other things that
will be in the next uh couple of parts
right so test will be a unit test then
you're going to have the automated test
right so this is nothing but to check
your code quality so this will be a
fourth step next we are going to have
release so once every testing and
everything is done then we are going to
deploy the code to different different
environments now again here I can talk
about this like 1 hour but I'm going to
keep this one simple release is also
very very important and when you have a
very like very sensitive application
you're going to have very very complex
release. Complex in the sense tight
release. Again, tight in the sense means
you just not casually release your
feature on prod, right? It's not
possible. Your team must be following a
very very uh like tight uh I will say
like flow to release your feature to
prod. So maybe you have some multiple
environments. So you have a dev
environment then you have a stage
environment then you're going to have a
pre-pro environment then prod
environment. I hope you're getting I
have worked previously some in some
teams they actually follows these many
uh like staging environments or product
like deployment environments that
they're having. So they're having a dev
environment. If dev environment is
successful, you're going to raise a PR
to stage from stage to pre-pro. Preprod
is nothing but so let's say you're going
to release a features tomorrow and then
we are going to move the team is going
to move the feature from stage to
pre-pro day before day before the uh pro
deployment will happen maybe one day or
two day before and once pre-ro uh
validation is successful then they they
are going to deploy this one to prod on
the next day right so this will be your
uh release and then we are having
talking about release or deploy like
both are together so once We're going to
release it. We are going to deploy it.
So it will automatically deploy
definitely. So you're going to have
continuous deployment CD. And then
you're going to have another extremely
important part. This is de this
definitely will come under devop life
cycle that when you're going to deploy,
you need to monitor everything, right?
That if something goes wrong, we need to
get some kind of triggers, X matters,
those lot of complex things are there.
You'll be having some uh like charts
like Kwana. So Kibana is very industed.
So what will happen right whenever user
if it's a userf facing application or it
can be anything user is going to do some
actions you're going to capture all
those actions in your kana dashboard and
let's say if something goes down it'll
be automatically getting notified from
there right so you'll be able to
understand okay something goes wrong
there so I need to fix this code so
these will be the all the seven steps
that we usually follow in devops life
cycle so we starting from plan develop
build test release deploy monitor okay I
hope this will
This is clear. So now what will be our
next? So next I'm going to quickly cover
two things. One will be Linux for
DevOps. Second will be cell scripting.
Now both the things I'm giving my word
these both the like both the section
that I'm going to cover in the next
part. This alone I can create a 8 hours
course with only Linux and sales
creating. But it's impossible for me to
cover each and everything in a single
video where I'm covering only the uh
like the uh beginner level of DevOps
concepts. Now again this will depend if
this particular part will get really
good response from all of you. So I'm
going to create a separate video only on
Linux and sales scripting. Okay 100% I
will do that but only if I get good
response. See good response is nothing
but I'm talking about the money. For me,
money is not the important thing. For
me, when my videos goes to more people,
that means my channel will be more
popular and I'll get I'll be getting
more motivation to make more videos.
Right? I hope you're getting if I get
very less views. I usually get see these
video these kind of videos takes months
to create. I do research. I just
normally just don't go to charge GBD and
then uh tell chity that give me devos
concept and then I can easily come and
explain all the concepts to you. Right?
It's it will take me like not even one
week to complete all of these and I'll
be uploading four five videos in a
month. But I want my video to be very
very detailed. So that is the reason I
do lot of research. So if I get good
response from all of you, I'll be
creating more parts probably even four
five parts of DevOps only. Okay, it will
depend. But let's start. So I'm going to
give some very basic idea that what is
Linux and how sales scripting will help
us when you'll be working as a DevOps
engineer. Okay. So let's start with both
the things Linux for DevOps and sales
scripting in the next section. All right
everyone. So first we will be uh so
let's quickly discuss that why we
actually need Linux for DevOps and then
after next section we'll be starting the
sales scripting. Now see Linux what is
Linux? So it's a free and open-source OS
rights operating system. Now the main
reason why we need to learn Linux
because Linux is one of the mostly
widely used in prod environments. Why?
Because it's very very stable. its
security is very good and it's give
fantastic performance right so you can
say like it's like a backbone of many
many devops tools and process and you'll
understand that why it's what I'm
telling it's actually true that lot of
devops tools actually use Linux as their
OS right so that is the reason it's
absolutely mandatory you need to know
some of the basic con I know that you
have to do you have to be Linux expert
but some very basic concepts or commands
you definitely need to Okay. Now when
I'm talking about let's say DevOps tools
like Docker, Kubernetes, CI/CD tools,
right? GitHub accents, whatever you name
it, these are actually optimized for
Linux environments, right? So that is
the reason you need to know Linux. Also,
Linux is also the primary environment
for cloudbased services. Extremely
important. you name it AWS, Google cloud
as your all these actually uses de uh
this Linux as the DevOps workflows.
Okay. Now because I'm using Windows so
we need to have in uh WSL installed
right and this why we need so WSL is uh
so the full form will be if I'm not
wrong it's something called Windows
subsystem for Linux something like that
you can uh see Windows subsystem for
Linux. So this is actually allow us to
run our Linux uh Linux distribution like
Ubuntu on our Windows machine. Right now
again it depends if you're using Mac or
something else you need to search it. So
please research it's very very basic
just based on your OS you just search it
that we need to install Ubuntu in our
system right. So here what will happen
WSL will allow us to run Linux
distribution like Ubuntu on our Windows
machine. Okay. So here we actually need
it to run Linux based DevOps tool in a
Windows environment. What we going to
do? Simply type WSL download for
Windows. Go to the first link and then
you just have to open your PowerShell.
Okay. So just do PowerShell
and then you need to do right click and
then do run as administrator. I already
have installed this and then you don't
have to do anything. Just type WSL
install. Right. This command will enable
features necessary to run WSL install
Ubuntu distribution of Linux. Okay, so
that is the reason if you're using some
older build then you need to use this
manual steps. But if I'm pretty sure
most of you are using latest. So you
just have to open the powers with
administrator and then just type WS
install and it is going to install this
one. Now if you want to check it. So now
what I'm going to do right simply. So,
we'll just go to let's open PowerShell.
Okay. And then I'm just going to type a
vert.
You can see that I already have this one
installed. Okay. So now what I need to
do right. So here once we'll run that uh
WSL - install command, it will be
installed. Okay. And then you can just
simply open the power cell. And here I'm
just going to type WSL. That's it. And
then or you can also type here Ubuntu.
It will also open. But from here I'm
just going to type or uh WSL and hit enter.
Okay. So now couple of things we need to
understand here. Okay. Now again I want
to mention one. I always forget this. If
you're doing this one for the first
time, right? So it will ask for some
maybe if I'm not wrong it will ask to
create a user and password and you need
to follow that prompts right in case
you're getting any issues committed down
or else what I'm going to do as uh in
the where in my website where you'll be
downloading all these resources I will
try to add all of these processes that
how you can install this one from
scratch if you are doing this one for
the first time. So now I've divided this
one into multiple basic command
sections. So first we're going to
understand how we are going to navigate.
Okay. Second how we're going to create
files, read file, search files, all of
these. So let's start with the first
one. So first one is navigating your
home directory. Okay. So now you can see
that I'm currently inside actually WSL.
So here what will happen? You can see
that this is my path, right? So this is
my user path. This is my name. You can
see that. Now here what I'm going to do,
right? In case you want to get the
location here, the current location,
what you're going to type, you will do
pwd. And you can see that this will give
you the current location that you were
at. Okay, pwd. So, whatever comments
that I'm going to mention from this
point, all of this will be actually
important. Now again here second thing
will be important that you want to check
all the files and folder that are
listed. So in that case what I'm going
to do I'm simply going to type ls and
it's going to give me all the details.
So I'm going to hit enter and you can
see that this is giving me all the
folders files blah blah whatever I'm I
am having here inside this particular
directory. Okay. If you want to go to a
certain directory certain folder so as
simple as that you need to do cd and
then you have to maybe let's say you
want to go to links right and you can
see that I'm inside links.
Now here if you want to go back so not
go so you can do simply see like this cd
double dot and if you want to go to the
root of this directory direct uh
directly to the root so what you need to
do right you need to do cd and then you
have to give this slash once you do that
you you can see you're currently at the
root directory okay now let's go inside
so I'm just going to copy this path and
I'll do this inside my user path Okay.
So now the second thing I'm want to
explain one more thing. So ls I already
told you that it will list all the files
in the current directory. If you want to
see more detailed information like what
will be the size permissions and owners
and everything you need to type ls - a.
So this will give you the all the all
the details not my word ls- l. Okay. So
a will be to when we are going to see
the hidden file. So that I'm going to
explain now. So ls-l
it's going to give you more detailed
information. So I'm going to hit enter
and you can see that it's actually
giving me lot of other information right
size permissions and lot of other
things. And if you want to see the
hidden files you have to do ls- a.
Okay. So this will give you all the
other if you notice that all these some
of the files and folders you will not
see when you're going to simply typing
ls. But for ls - a you are going to see
all the hidden files also. Okay. So
three important things I will not say
three I will say five. So one is the ls
one is ls- ls-
a cd then the directory name. So here
directory name I'm talking about the
directory that you want to go to. Right?
Then cd to go back. I think these are
very normal. And then you can also use
this right cd. I don't know what this
called this uh icon. So you can do that.
You'll go to the root and you can also
do the same thing with cd - space. So if
I go to this sorry cd
and then if I do cd space slash I'll be
going to the root. Okay.
All right. Now if I do pwd this will
give you the path. So you can see that
you're in the home path or root path.
I'll say awesome. So I think this is
done. So let's see one more thing. I
think this I'll clear this. So let's see
if I again go here,
right? So I'll go to CD documents
documents
and I'll do pwd and you can see that
this is giving me the path the current
path. Okay, awesome. So now what I'm
going to do, right? So let's do one
thing. So I'm going to go to desktop. So
first I'm going to do cd desktop
and now here I will create a empty file.
Now to create a empty file what we are
going to do right we need to use touch.
Okay. Now here I will be going here and
maybe let's create a new file is it? So
I'll do new file dot txt. Now remember
I'm actually creating this one inside my
desktop and I'm going to touch the file
name txt. Hit enter and go here and you
can see that there is a new file. Okay.
And also let's add some content here.
Maybe I'll add some hello or something.
That's it. Okay. So this will create a
new file. So for now just remember this.
Next thing what we going to do right?
Let's say how we going to create a
directory. Now directory creation is
very very simple. So what you need to do
you need to use is mkdir and the
directory name. So maybe I'll give this
one as uh let's do a test maybe enter.
So new directory or new folder is been
created. Okay. So now what I'm going to
do right
so let's say let's create one more file.
Okay. So I will probably create here
only. This I'll do touch
file dot txt mean I want to delete this
file. So I create one more file. And now
here maybe I want to delete this one.
And to delete delete this one I just
need to use rm and I'll do to delete
filet txt. Enter. And it's deleted.
Awesome. So this will be to delete. Now
if you want to delete a directory
directory means let's say I want to
delete this folder. So what I need to do
because I'm in this path so I'll do rm
okay- r and the directory name. So in
this case directory name will be test
right if I'm not wrong it's test. So
here I need to do rm - r then test enter
and you can see that this is deleted.
Awesome. So we have learned that how you
can create a file delete a file delete
create a directory delete a directory.
Okay. So now what I'm going to do right
simply so let's create some more files maybe
maybe
or I think we already have one I think
this will be more than enough so I think
this is fine so one file we already have
so now let's say what I need to do right
I need to find this particular or maybe
let's do one thing let's create some
more file I think it will be easier so
I'll do touch and what is the name we
have new file so I'll do new file
let's do new file file dot no new file
1.xt txt new file 2
txt enter
so there will be two more file and I'm
new file two okay
so I think this is done so now we'll go
here and let's say I want to find a
particular file and how We are going to
do that now to find a particular file.
So because see we have created this one
in desktop right. So what we are going
to do simply from here we can directly
do this. So what I can do? So we need to
or let's do this one like this. So I I'm
going to go to the root.
Now I'm just going to do find
here. What I'll do I'll simply copy this
the path that I need to find desktop.
Then we need to give the name that by
which name I want to find this and the
name of the file. So name of the file
will be new file txt right enter. And
you can see that you have this file
here. Now what I'm going to do simply
I'll do new file.10 enter. You can see
that it is not going to find the file
because it file is not exist. Right? In
case if you do new new file dot new file
1.txt txt because this file already have
here and uh I'm going to hit enter and
you can see that it's going to find the
file. So what you need to do find
command the path the name is the tag
here and the name of the file that you
want to find. Then we have another
important command that is called grip
gr. So this is nothing but so let's say
you have a file with lot of content and
you want to search a certain string
inside that particular file. Okay. So if
you see that if I go in this file we
have this particular text right hello.
So let's say I want to search this one.
So what I can do simply look grape.
First let's go to this path. So I'm
Okay I'll do grape and here I'm going to
find the text as hello and I need to
tell that in which file I to test it. So
I'll do new what is new file. So do new file
file
dot txt enter and you can see that you
are getting this right. So let's see if
I change this one you'll not get this.
So this will be to find a particular
string inside a text. So I think this
will be I think rm command we already
have covered right that rm will use to
delete that particular file. So let's
say maybe I will go to the root first
and then what I'll do right I'll do rm
and I will copy this path
and let's say I want to delete this uh
particular file right
maybe this new file so I'll go here and
then I'll do / new file txt something like
like
see this new file is now deleted okay so
rm will be to delete the file so now the
basic ones We have covered right that
how you're going to create a new file,
create delete a file, create a
directory, how you can get the current
path using pwd command, right? How we
are going to uh what else we have
covered? Uh find a new file from a
particular directory and how we are
going to search a content inside a file.
So all these are very very basic
commands that you need to know when we
will work with Linux in DevOps. Right.
Again this is not at all all the things
we have covered. There are a lot of
advanced things that we can cover but
for now I think this will be more than
enough. This is all the things that we
actually need for this particular video
to cover the basics. Then we are going
to later part we're going to cover the
advance. So now in the next section what
we're going to do right we'll be start
learning uh again the basic things of
cell scripting. What is script? Why
actually you need that in DevOps life
cycle or how that fits into DevOps. So
those kind of things we're going to
cover and then some of the very basic
commands. So once we'll do that then
we'll start uh with our main DevOps life
cycle that will be G and GitHub and a
lot of other things. So let's start with
the cell scripting part. All right. So
now we'll start with a very small
section for cell scripting right that
what actually cell scripting is and why
Okay. See the first one is like again
I'm going to give a very basic
explanation that it's a script as the
name suggest.
Okay. Now you can consider this one as a
text file right so it's cell script is a
text file that contains that contents
means where we are going to write series
of commands series of commands of what that
that
the Linux
S right will execute this is the
simplest explanation of what cell
scripting is so it's a text file
where we're going to write a series of
command that Linux will understand.
Okay, just think in that way. The L
Linux will understand this B. This is
the Linux cell. I'm just giving one
example. So this one of the Linux cell
which will execute this particular
commands. Now it's like you are doing
like this. Okay, let's say you want to
go go to a certain place and then while
going to that particular place you need
to do certain things multiple times
repeatedly. Okay. Now instead of doing
that one repeatedly you have done
something which will do all these
repeated things and you can go to that
particular place very easily right so
it's a series of command where you have
like you'll write all the commands 10 12
15 commands it this Linux is going to
execute that command and it will simply
so in simple it's going to automate that
okay so it's going to run all these
commands and it's going to execute this
is the simplest explanation that I can
give uh for cell scraping. Now why we
actually need that? So simply say I
already mentioned it's automation,
right? So instead of typing multiple
commands repeatedly, you just writing in
a single file and it's going to run all
of these and it's going to increase your
efficiency as simple as that. But it
will need that software installation,
system configuration, right? Let's say
you want to take some backups, you want
to run some chron jobs. I'm just giving
one example. But don't take all the
things that I'm taking telling. I'm just
trying to make things simpler. So it's
like it is going to increase your efficiency.
efficiency.
What will be the structure, right? So
what will be the structure? See, so this
cell script it actually follows a
certain method of writing commands,
right? And that we simply called as uh I
don't know how to pronounce this C band.
Okay? So it's something start like this.
So you have this has then this then
you're going to write bin then bas okay
so it start with typically starts with
this cand and then we're going to write
some commands that we want to run okay
now let's see how this will work so
let's do one thing uh let's do one thing
let's go to let's open wsl only okay
so we're going to write some very basic
things that how we are going to write
and create. Okay, now we are here and
then the first thing what I'm going to
do first I'm going to do cd desktop
and then I'm just going to create a new
script file. Now to create a new script
file what I going to do simply we are
going to write nano. All right and then
the name of the file that we want to
write. So what we'll do maybe first script
Okay. And then here extension you need
to use as sh enter. All right. So here
what we going to do? We need to write so
then we're going to do bin bass and then
we going to write an eco
and then I'm going to write a message
that hello world. So now I have written
the script. Now what I need to do I need
to save it. I need to exit because this
is inside this particular script
interface. Right? Now here you need to
do three-step process. Very very
important. Many of you get confused
here. You need to do Ctrl O. Remember
Ctrl O. So this is the first step. Then
you're going to do enter
and then you're going to exit. Ctrl X.
Awesome. So dot control O enter. Ctrl X.
If I go here you can see that it's
created a script file. So now what I
need to do I need to run this right this
file. Now here it's very very important
before we are going to run this file we
are going to make this one executable.
So executable is nothing but we're going
to give permission to the file and here
what I'm going to do we are going to
write this
plus x
and then the name of the file. So this
is the name is my first script file. the
first script
file dotsh.
Okay. So now we can execute this and to
execute this one is extremely simple
because currently you are in this
particular directory. You have to just
remember all of this and then you have
to go to this path, right? This is the
current path. This is nothing to
explain. This is very simple. So you're
in this path. You go to that path and
I'm just going to do first script file.
So name of the file that I want to
execute and then sh enter and you're
getting this message right hello world
because this is the same we've written.
So if I do just do nano first script
file dosh
and maybe let's say I'll change this one
to hello world edited
to test then control O entertrl x and
then run again.
Okay so this is working. So now this is
so this is like three-step process. You
create a file. No four step I'll say not
three. You create a file. You write the
script. You make that file executable
and you are going to run it. So create,
write, execute. No, create, write, make
it executable, run. So sorry, four uh
four step. So create, I'm going to
repeat once again. So create, write,
execute, run. Okay, so this is done. Now
let's see how the variable and
everything works here. Right? So what
I'm going to do right I'm going to do
nano and then I'm going to write
variables dosh
and here again we need to do the same thing.
thing.
All right. And here what I'm going to
do, right? I'm going to write a variable
here. And I'm going to do a name equal to
to
someone. And here I'm going to do equal.
And here we need to give hello. And
because we writing a dynamic variable
here, we need to give this dollar.
And then you need to give name. Right?
That's it. And then you're going to do
the same thing again. Ctrl O enter.
Control X. Okay. Then we are going to
All right. So getting with the variable right
right
also you can write conditional
statements. So I'm going to show that
also. I thought this also will be more
than enough that because in this uh when
you're going to write any script and
everything right this is the this is the
main thing that we are going to do in
this particular video like creating a
script file uh write the code execute
and run it but let's explain the
conditional also then you have functions
and lot of other things loops functions
also lot of things are there right uh
those things it's absolutely not not
possible guys because docker CI/CD AWS
deployment ment continuous development
kubernetes all all the things we are
going to cover in a practical way it
will be very very complex so let's keep
it like this so I'm going to explain the
conditional and then I think that will
be more than enough so I'll do
conditionals dosh
and here what I'm going to do right I'll
take a number okay
let's take this one maybe equal to five.
So now I am going to just write if
okay so if this number that we are
having if this greater than so I'll do gt
gt 5
5
then what I going to do so I'll do then
I will simply do equal
the maybe the number is greater than
five. Okay. Else
I'm going to do echo
the number
is not
greater than five. So if number it's
very simple just like how you do in
JavaScript and all others right number
is five if it is greater than then it is
greater than else it is less than. Now
we need to exit from this and to exit
from if else you need to use this fi.
Okay. So this is the command that we
need to follow. All right. So now let's
save this. So dot control o entertrl x
control o enter x and then I'm just
Uh we need this space here.
Okay, we need to give this space after
these brackets. So now let's save this.
It should work.
So run this. Okay, so getting the number
is not greater than five. So if I want
to change this
to 50
and run it and you can see that the
number is greater than five. So I think
this will be more than enough. So what
are the things that we have learned that
what is cellcript right? Why actually
you need that. Now what is cell script
and why actually need that these kind of
things are important in interview also
like this is not about cell scripting.
This is for each and every sections that
we are going to cover in this whole
video. Right? For example, what is
docker? Why we need docker? What is CI?
Why we need CI? I hope you're getting
right. All these are very very
important. Okay.
Then we have learned that how you can
create a script, right? How how we are
going to write some of the basic script.
How you're going to execute the script
and how we are going to run the script.
Okay. With this we have covered the
basic section with Linux for DevOps and
cell scripting that we needed. So now
we'll be moving to the next part where
we'll start with g and github
environment management docker docker
compose ci linting pretier cd aws
deployment lot of things. So let's get
started and good luck. So first uh let's
start with one thing right. So first
I'll start with so let me just close
this. So let's see the project overview
that what is the project that we are
going to cover in this particular
section right. So we will have a man
project. Now why I have decided to keep
man project because see if you're
talking about a client side and server
side. So client side react is one of the
most popular. I don't have to explain
also it's very very popular. If you go
to any product based service based
companies most of the companies that uh
were in legacy they're trying to convert
all those application in in react and
this is I'm talking from my real world
real life experience and not just faking
in uh for sake of this video right it's
actually true so when I'm talking about
manstack the reason is see here we will
have a front end right so you will have
a front end correct and then you are
going to have a back end now I already
mentioned that there will be lot of
concepts Right? Normally in my videos
you'll see that I'll directly jump into
project but for this DevOps uh video it
will not be same. We need to cover a lot
of concepts. It's actually important and
then you are going to have a back end.
Now in front end if you talk about now
here let me just go there and then take
a sip. Now what we usually have let me
change the color to black now here and
also I'm going to change the this one to white.
white.
See we normally have a react right?
Angular is also widely used then you
have view then you have other uh
technologies normal JS applications are
also available like that are built on
normal HTML CSS and JS and then if you
talk about back end so back end I always
tell that Java is the final boss. Why I
mean by final boss is like if you go to
any product company it's like uh for
example Amazon, Microsoft or whatever
any company Oracle, Walmart or Netflix
normally most of the companies uses Java
as their back end. Then also node is
widely used then you have Python ASP.NET
and lot of other things. Now the reason
I choose MST because I'm not talking
about a professional who is working and
trying to learn DevOps but this will be
helpful for couple of other people. So
for example, let's say you are working
for any uh freelancing, right? So if
you're working for freelancing, this
will be helpful. If you're a college
student, it will be easy because let's
say you're working for your final year
project, you can actually easily choose
react as your uh front end and node as
your back end it will be easy. So see
from project perspective, it doesn't
matter that what technology I'm using.
DevOps is completely separate thing. The
reason why I've chosen man step because
it's very popular and it will be easy to
apply those DevOps commands or concepts
to this particular project. I hope
you're getting right. So this is the
first point I want to mention that if
some of you actually uh think that why
I've chosen man. So this is the reason.
So we have created I've created one
project and this project has a simple
structure. I'm going to actually discuss
because it's very very important that
what actually we are using. So you see
that we have client side folder and we
have a server side folder as simple as
that. In the server side we have a
normal simple node js back end where
I'll show you in the package.json that
what are the things we are using here
because these things are very very
important to understand. So we have
express we have mongos so we are using
mongoDB and then some other uh text that
doesn't uh anything related to devos but
you need to understand and then we have
some very basic structure. See we have a
controllers models models we have a
simple task model in the controllers we
have a task controller so we simply
create the logic the back end logic is
in task controller the reason why I'm
explaining because maybe some of you are
watching this video not from react or
node background so you don't have any
idea so that is still I will say that
you don't have to skip this like this
nothing related to react or node I hope
you're getting once I'll cover this
right we are going to start directly
jump into devops related things so this
is where we have the main logic like how
we can create task fetch list of task
and then we have route route is nothing
but that whenever we are going to hit
any particular API we need to tell that
okay to hit that particular let's say to
get all task which route I need to hit
so here we have all the routes so you
can see that we have mainly three routes
very very simple we have a get then we
have a post to create a new task and
then we have a delete to delete a task
that's it so this is our overall uh
structure for server side to show you
have a models folder, controllers
folder, routes folder and then we have
server.js JS file which is our main
entry and also I think I have created
this g ignore for now let's delete this
we need to explain all of this later
that what is this so in this server do
js so this is nothing but this is your
main entry so let me just give you some
of the idea if you're not from st
background that how this is working so
if I go to let's take maybe this one and
let's choose this one so here if you
notice so okay I need to I think
So here we have a client side. We have
the server side. Okay. So we have a
front end and we have a back end. Right?
So what is happening? Front end is
actually communicating with back end and
back end is giving response back to
front end. And in the front end we have
our UI. UI is nothing but what is UI? So
UI is what you our user is actually
seeing on the screen. So this is our UI
and then this is our back end. So back
end is built on NodeJS MongoDB. Okay. So
in the back end we have all the logics
to create all the task and then save
that task to our DB. Okay. So this is
the very simple structure. Now coming to
front end. So in the front end we are
using React and for this one we are also
using V. Okay, also let me remove this
lead ignore from here. So now if you go
to structure here also go to
package.json. So we have some react
packages. So you can see that and then
in the structure we just have some
components and some folder what you are
actually simply seeing on the screen.
This is all this explanation for if
you're not from React background or
NodeJS background. Now here how this is
working. So here you'll be getting the
list of task. You will be able to add a
new task. So let's I'll add a new task here
here
and then I can create this and this new
task I'll be seeing here. I'll be able
to also delete a task and if I refresh
this I'll be getting the updated list of
task here. So I hope the main part the
intro part this part uh this section was
actually very important to give you some
idea before we start with our main uh
DevOps related concept and section. So
now let's directly jump to the next one.
Also in the next one we'll be start
learning G and GitHub from scratch. All
right. So let's start with our first
section. Now from this section we are
going to cover a couple of concepts. As
I already mentioned I'm going to repeat
again. I will not start applying all of
these in project. It will be very
difficult for beginners to understand.
So let's start with G and GitHub. I'm
pretty sure if you're watching this
video you already know G and GitHub. But
I will still highly suggest please don't
skip right because this video is related
to DevOps related life cycle or
ecosystem. So we are all the things we
are going to cover that a beginner
should know right. See what is g the
first thing you need to understand. So
what we are going to do right so I'm
going to write each and everything here
so that I can share this doc and you can
practice based on that. See first I'm
going to write all the key items or key
concepts. So I'll give here like this G
so that whenever you go through this
documents you'll be able to understand.
See G is a distributed version control
system. So it sort is called DVCS.
So we called distributed version
version
control system. Okay. So, G is a
distributed version control system. What
do we mean by that? Distributed version
control system tracks changes in your
source code during your software
development life period. Right? So that
means if I'm going to write here so the
g is a distributed control sorry
distributed version control system that tracks
tracks
changes in your source code as simple as
that. So this is the basic
definition and if you go to the official
definition here you can see that it's a
distributed version control system that
tracks version of file. So it doesn't
like it it's like same like you are
writing some code right every every time
you're going to write some code or make
some changes or delete some file or add
some file it's going to track each and
every step that you are actually doing
okay next okay so you need to go here
next two things we need to understand
what is distributed and what is version
control so distributed is actually so let's say in your team you have two
let's say in your team you have two developers okay each and every developer
developers okay each and every developer will have a copy right So let's say you
will have a copy right So let's say you are working on one functionality and the
are working on one functionality and the other developer is working on another
other developer is working on another functionality. That means each developer
functionality. That means each developer will have a full copy of the particular
will have a full copy of the particular repo and the history. Right? So that
repo and the history. Right? So that means we no need to manage no need of
means we no need to manage no need of central server always. Second version
central server always. Second version control means version control basically
control means version control basically helps you to manage changes in the code
helps you to manage changes in the code documents configures and let's say you
documents configures and let's say you are having read mem file and everything.
are having read mem file and everything. Okay. Second, why sorry second not why
Okay. Second, why sorry second not why what is GitHub? So G is I think we have
what is GitHub? So G is I think we have covered that it's a distributed version
covered that it's a distributed version control system that tracks changes in
control system that tracks changes in your source code. So I think you should
your source code. So I think you should only remember these two things. That's
only remember these two things. That's it. Coming to GitHub. So what is GitHub?
it. Coming to GitHub. So what is GitHub? So I'm going to
So I'm going to GitHub.
GitHub. So GitHub is actually different. So it's
So GitHub is actually different. So it's not uh any control system. It's actually
not uh any control system. It's actually a hosting service. It's a cloudbased
a hosting service. It's a cloudbased hosting service. So I'll give cloudbased
hosting service. So I'll give cloudbased hosting service and this actually lets
hosting service and this actually lets you to work with git. So what I mean by
you to work with git. So what I mean by work with git? So it's actually lets you
work with git? So it's actually lets you to store all the g repositories remotely
to store all the g repositories remotely and you can collaborate with others and
and you can collaborate with others and also you can implement automation, you
also you can implement automation, you can automate things and lot of other
can automate things and lot of other things you can uh I'll give this one
things you can uh I'll give this one equivalent to. So, GitHub is you can
equivalent to. So, GitHub is you can think of I'll give here you can think of
think of I'll give here you can think of you can
you can think of like see I'll very very easy
think of like see I'll very very easy you'll be able to understand like it's
you'll be able to understand like it's like Google drive I'm pretty sure you
like Google drive I'm pretty sure you able to understand so let's say you are
able to understand so let's say you are having some documents in your mobile but
having some documents in your mobile but you want to store it someplace uh let's
you want to store it someplace uh let's say you just uh lost your mobile or
say you just uh lost your mobile or something bad happened in your mobile so
something bad happened in your mobile so you'll be able to still get your code
you'll be able to still get your code from some place so it's like like you
from some place so it's like like you want to store it in some cloud-based
want to store it in some cloud-based application. In this case, it's Google
application. In this case, it's Google Drive and you'll be able to access it
Drive and you'll be able to access it anytime whenever you want to do it. So,
anytime whenever you want to do it. So, it's similar. So, GitHub is like
it's similar. So, GitHub is like cloud-based hosting service that lets
cloud-based hosting service that lets you to store all your G repositories
you to store all your G repositories remotely and you can work with others.
remotely and you can work with others. You can collaborate, you can automate
You can collaborate, you can automate those kind of things, right? Normally,
those kind of things, right? Normally, if you go to the GitHub official
if you go to the GitHub official documentation, right? So, you can see
documentation, right? So, you can see that it uses actually g. So it's
that it uses actually g. So it's actually uses G to provide distributed
actually uses G to provide distributed version control and also it provide
version control and also it provide access control bug tracking software
access control bug tracking software feature lot of other things right CI/CD
feature lot of other things right CI/CD that we are going to discuss later so
that we are going to discuss later so now I think the definition wise this
now I think the definition wise this will be clear right what is g and github
will be clear right what is g and github now we need to understand that how
now we need to understand that how github actually work with g right so
github actually work with g right so let's do one thing so here see I'm going
let's do one thing so here see I'm going to repeat once again I already mentioned
to repeat once again I already mentioned that these concepts are actually very
that these concepts are actually very very important so g is a tool tool that
very important so g is a tool tool that tracks changes locally on your machine.
tracks changes locally on your machine. So let's say I'm going to write some uh
So let's say I'm going to write some uh here we'll give something like let's go
here we'll give something like let's go here and take this and I'll just copy
here and take this and I'll just copy and paste right so you have g
and paste right so you have g and this is your github right so g what
and this is your github right so g what it is doing it's actually tracks changes
it is doing it's actually tracks changes in your
in your local machine Right? So all your changes
local machine Right? So all your changes currently in your laptop and you're
currently in your laptop and you're using g. So g is actually tracking all
using g. So g is actually tracking all the changes that you are doing. GitHub
the changes that you are doing. GitHub is actually a platform
is actually a platform what it is doing where all the g managed
what it is doing where all the g managed projects
projects all g manage
all g manage projects
projects that you have that lives mean that store
that you have that lives mean that store online. Why it is needed? It's needed
online. Why it is needed? It's needed for backup.
for backup. You want to share your code with
You want to share your code with someone. So sharing it's actually it's
someone. So sharing it's actually it's needed. You want to collaborate, right?
needed. You want to collaborate, right? Uh collaborate
Uh collaborate and also very very important automation,
and also very very important automation, right? So this is like the relation. So
right? So this is like the relation. So your this G and this G both are actually
your this G and this G both are actually connected, right? So both are
connected, right? So both are interconnected. So oh my god. So like
interconnected. So oh my god. So like get your code in in your local machine.
get your code in in your local machine. You are adding all this code in in
You are adding all this code in in GitHub. GitHub is actually keeping all
GitHub. GitHub is actually keeping all your code it actually help you for your
your code it actually help you for your backup, sharing, collaboration and
backup, sharing, collaboration and automation. Right now what will happen?
automation. Right now what will happen? How you're going to how it will actually
How you're going to how it will actually work. So that means when you have your
work. So that means when you have your code in your GitHub you need to somehow
code in your GitHub you need to somehow link that code to your GitHub repo.
link that code to your GitHub repo. Correct? So we need to link it. So this
Correct? So we need to link it. So this is the second step and then to have that
is the second step and then to have that code in your GitHub what you need to do
code in your GitHub what you need to do you need to push that code in your
you need to push that code in your GitHub right so it's like uh two-step
GitHub right so it's like uh two-step process I will say so first you have
process I will say so first you have your code in your local you're going to
your code in your local you're going to link your code from your GitHub local
link your code from your GitHub local sorry G local to your GitHub repository
sorry G local to your GitHub repository and then you're just going to push your
and then you're just going to push your changes to GitHub once you push all your
changes to GitHub once you push all your code changes will be in GitHub right now
code changes will be in GitHub right now if you're complete beginner you might
if you're complete beginner you might get these question in interview also. So
get these question in interview also. So you can note this one down that what is
you can note this one down that what is the difference between g and g. I think
the difference between g and g. I think g g and github. I think we've already
g g and github. I think we've already discussed in very details right. So I'm
discussed in very details right. So I'm going to repeat once again. So g is a
going to repeat once again. So g is a tool right or command line.
tool right or command line. GitHub is a web- based platform or
GitHub is a web- based platform or cloud-based platform right. G tracks
cloud-based platform right. G tracks your changes locally. This is actually
your changes locally. This is actually very important. GitHub host your all G
very important. GitHub host your all G based repositories online. Right? If you
based repositories online. Right? If you want to collaborate in G you can't do it
want to collaborate in G you can't do it like you have to do it manually. So you
like you have to do it manually. So you have to share your code changes if you
have to share your code changes if you if you want to share with someone in
if you want to share with someone in GitHub it's very very easy. So all your
GitHub it's very very easy. So all your changes will be in GitHub. You just can
changes will be in GitHub. You just can pull your changes from GitHub and that
pull your changes from GitHub and that will be available to you. Right? And
will be available to you. Right? And then G is a version control very very
then G is a version control very very important and GitHub is actually built
important and GitHub is actually built based on G. So I'm going to repeat this
based on G. So I'm going to repeat this point once again. G is a version control
point once again. G is a version control but GitHub is built based on G. I'm
but GitHub is built based on G. I'm pretty sure now with this the definition
pretty sure now with this the definition of G and GitHub will be clear. Right now
of G and GitHub will be clear. Right now let's see how the workflow will work in
let's see how the workflow will work in details. So I'm going to do this. So
details. So I'm going to do this. So I'll go here. Okay. And I'm going to
I'll go here. Okay. And I'm going to just add here. So let's add here G. So
just add here. So let's add here G. So I'm going to give here G.
I'm going to give here G. And then you have your GitHub here.
And then you have your GitHub here. Okay.
Now this G this is developer is working and this is
this is developer is working and this is in your local. Okay. This is in a local.
in your local. Okay. This is in a local. You're going to do what? You're going to
You're going to do what? You're going to add
or you're going to commit. Okay. Or you're going to push or pull means once
you're going to push or pull means once you will code is you know local so
you will code is you know local so you're going to push your code to GitHub
you're going to push your code to GitHub right so this GitHub will keep your G
right so this GitHub will keep your G repo
repo in your in the cloud so you have the G
in your in the cloud so you have the G repo here then every time you're going
repo here then every time you're going to add or commit any changes this GitHub
to add or commit any changes this GitHub repo will be updated and every time
repo will be updated and every time someone else is going to push or pull
someone else is going to push or pull from this GitHub have that code will be
from this GitHub have that code will be available in their local machine in
available in their local machine in their local machine. Okay, I hope this
their local machine. Okay, I hope this is clear. Now if you want to understand
is clear. Now if you want to understand this one more clearly if you're like
this one more clearly if you're like very very beginner so I'll give you one
very very beginner so I'll give you one very basic idea and this time it will be
very basic idea and this time it will be easy. So I'm going to take one more. Now
easy. So I'm going to take one more. Now let's say I have two teammate one name
let's say I have two teammate one name is John and then I have another teammate
is John and then I have another teammate other name is Travis. any name. So I
other name is Travis. any name. So I leave Travis here. Travis John has his
leave Travis here. Travis John has his code in their local which is managed by
code in their local which is managed by G. Very very important in it is
G. Very very important in it is available in John's local only not in
available in John's local only not in traverse local. Similarly traverse has
traverse local. Similarly traverse has their G code in their local and it is
their G code in their local and it is available only in traverse local.
available only in traverse local. Got it? Then you have GitHub. So I'm
Got it? Then you have GitHub. So I'm going to again copy this. Then you have
going to again copy this. Then you have GitHub. So consider both John and Travis
GitHub. So consider both John and Travis working in a team, right? Sorry.
working in a team, right? Sorry. So just add this here.
Okay. So they both are working and their code is actually
code is actually connected
connected here and Traverse code is also connected
here and Traverse code is also connected in GitHub. Means every time John is
in GitHub. Means every time John is going to push his changes, that code
going to push his changes, that code will be available in GitHub in the same
will be available in GitHub in the same repository. Similarly, Traverse is going
repository. Similarly, Traverse is going to push his changes. It will be added in
to push his changes. It will be added in the same repository. Now, next time when
the same repository. Now, next time when John is going to pull the changes. So,
John is going to pull the changes. So, what will happen? Traverse changes also
what will happen? Traverse changes also he will get. Similarly, Traverse is
he will get. Similarly, Traverse is Traverse when he's going to pull the
Traverse when he's going to pull the changes John's changes he will get. So,
changes John's changes he will get. So, it's like a collaboration, right? It's
it's like a collaboration, right? It's keeping all everyone's changes and then
keeping all everyone's changes and then you you will be able to work with
you you will be able to work with multiple team members. Just think like
multiple team members. Just think like that. But what g is doing? G is actually
that. But what g is doing? G is actually locally managing the tracking and
locally managing the tracking and everything of John's code. Similarly for
everything of John's code. Similarly for travers code. So this will be the
travers code. So this will be the complete life cycle or workflow how G
complete life cycle or workflow how G and GitHub works together. Okay. I hope
and GitHub works together. Okay. I hope I think I have covered a lot of things.
I think I have covered a lot of things. I think normally so many people will not
I think normally so many people will not this much depth but you should know all
this much depth but you should know all of these things how this is working. So
of these things how this is working. So I think we have understood what is the
I think we have understood what is the definition of g what is the definition
definition of g what is the definition of github how g and github works
of github how g and github works together what is the process that how it
together what is the process that how it actually works as a collaboration tool
actually works as a collaboration tool automation and everything we are going
automation and everything we are going to learn later so this will be the
to learn later so this will be the conceptual part now let's move on to the
conceptual part now let's move on to the next one we are going to understand how
next one we are going to understand how we can install git also I'm going to
we can install git also I'm going to give you some of the idea that what are
give you some of the idea that what are the things that we are going to cover
the things that we are going to cover from the next part so we are going to
from the next part so we are going to understand
understand installation of git how we can
installation of git how we can initialize a g in locally first and then
initialize a g in locally first and then we are going to see how g and github
we are going to see how g and github works together and those concepts we are
works together and those concepts we are going to apply in our man project and if
going to apply in our man project and if you notice that I don't have anything
you notice that I don't have anything related to g or github here not github
related to g or github here not github anything related to g here and that is
anything related to g here and that is intentionally because we are going to
intentionally because we are going to apply all of this from scratch so let's
apply all of this from scratch so let's do that in the next part all right so
do that in the next part all right so now let's see how we are going to
now let's see how we are going to install g so first just search for g
install g so first just search for g click Click on the first link and then
click Click on the first link and then go to downloads.
go to downloads. Okay. Now depends. I'm using Windows. If
Okay. Now depends. I'm using Windows. If you're using Mac, you need to click Mac
you're using Mac, you need to click Mac or I think it will come automatically.
or I think it will come automatically. I'm not sure. If you're using Linux or
I'm not sure. If you're using Linux or Unix, you can download. For Windows, I'm
Unix, you can download. For Windows, I'm simply going to download from here. Now
simply going to download from here. Now again, I already have this installed,
again, I already have this installed, but still I'm going to download it. So,
but still I'm going to download it. So, let's click here. And then you can see
let's click here. And then you can see that we are getting some options that uh
that we are getting some options that uh this is the so here I think you can just
this is the so here I think you can just click here to download or you can just
click here to download or you can just download some particular versions. So
download some particular versions. So I'm going to click here and this is
I'm going to click here and this is going to download. So I'll just click on
going to download. So I'll just click on download. So I'll wait for some time.
download. So I'll wait for some time. Once this is done then we are going to
Once this is done then we are going to install this. All right. So download is
install this. All right. So download is done. So let's click on this. So I'm
done. So let's click on this. So I'm going to double click as usual just like
going to double click as usual just like you install other application. So let's
you install other application. So let's click on yes.
So let's click on next, next, and install. I think that's it. So
next, and install. I think that's it. So it's you can see it's going to remove
it's you can see it's going to remove the previous G version and install the
the previous G version and install the latest version.
And you can see that it's actually done. And now let's do launch gb.
And now let's do launch gb. Click on finish.
Click on finish. And you're getting some of these first.
And you're getting some of these first. Let's ignore that for now. I'm going to
Let's ignore that for now. I'm going to just simply open the command line here.
just simply open the command line here. So here we have already command prompt
So here we have already command prompt and then just search for G sorry write
and then just search for G sorry write for G - version right and if it is
for G - version right and if it is install you'll be getting the version.
install you'll be getting the version. So we already have the G version 250.0
So we already have the G version 250.0 Windows.1. So that means G installation
Windows.1. So that means G installation is completed. Okay. So this is done. Now
is completed. Okay. So this is done. Now what we going to do right? See because
what we going to do right? See because we will be using this man project as our
we will be using this man project as our demo project and all the concepts we are
demo project and all the concepts we are going to apply incrementally. So I'm
going to apply incrementally. So I'm going to use this uh VS code terminal
going to use this uh VS code terminal only. Now again uh here if you want you
only. Now again uh here if you want you can directly go to your command line you
can directly go to your command line you can navigate to this project directory
can navigate to this project directory and you can do the same commands again.
and you can do the same commands again. So what I mean by that either you can do
So what I mean by that either you can do this in VS code terminal or you can do
this in VS code terminal or you can do it from here also you can also do it
it from here also you can also do it from gp others command line also it
from gp others command line also it doesn't make any difference at all.
doesn't make any difference at all. Okay. So for this one I'm going to use
Okay. So for this one I'm going to use the integrated one because this is very
the integrated one because this is very very convenient and you'll be seeing all
very convenient and you'll be seeing all the things that are happening here. So I
the things that are happening here. So I will highly recommend you can do from
will highly recommend you can do from here integrated terminal only. All
here integrated terminal only. All right. So installation is done. So let's
right. So installation is done. So let's go here. So what will be our next step?
go here. So what will be our next step? The next step we need to understand that
The next step we need to understand that how we can tell our project. So this is
how we can tell our project. So this is our project. Tell that okay you need to
our project. Tell that okay you need to use g. So that means I need to somehow
use g. So that means I need to somehow tell my project that okay you need to
tell my project that okay you need to use g. So that means somehow I need to
use g. So that means somehow I need to add g in this project and that is called
add g in this project and that is called g initialization. So how we are going to
g initialization. So how we are going to initialize a g repository here. Right?
initialize a g repository here. Right? So let's how we are going to do that not
So let's how we are going to do that not repository sorry we need to add g here.
repository sorry we need to add g here. And to do that here I'm going to go and
And to do that here I'm going to go and let's say do g
let's say do g let's close this and I'll do g
let's close this and I'll do g initialization. So I'll do G
initialization. So I'll do G initialization
and to do a G initialization what you need to do go to your repository and
need to do go to your repository and then you just need to use
then you just need to use so I'll do side by side you'll be able
so I'll do side by side you'll be able to understand when I'll share this so
to understand when I'll share this so you need to use g
you need to use g and then you need to tell init so once
and then you need to tell init so once I'll do get init so that means I'm
I'll do get init so that means I'm telling that Okay, I need to use g. So,
telling that Okay, I need to use g. So, it will initialize a g here, right? So,
it will initialize a g here, right? So, let's go here. It will initialize this
let's go here. It will initialize this project as a g repository to start using
project as a g repository to start using g. So, I'll go here. And now, if you
g. So, I'll go here. And now, if you notice, I'm actually at the root
notice, I'm actually at the root directory. Root directory mean I'm not
directory. Root directory mean I'm not inside client. folder. I'm outside.
inside client. folder. I'm outside. Okay. And I'll simply do g. And let's do
Okay. And I'll simply do g. And let's do init. Enter. and say you can see that
init. Enter. and say you can see that it's actually telling that it
it's actually telling that it initialized empty g repository here okay
initialized empty g repository here okay and if you just directly go to the go to
and if you just directly go to the go to reveal in file explorer
reveal in file explorer and you can see there is a g folder here
and you can see there is a g folder here notice right so what it will do right
notice right so what it will do right every time you're going to make any
every time you're going to make any change or do whatever this folder is
change or do whatever this folder is going to track everything locally
going to track everything locally remember I told you that g always tracks
remember I told you that g always tracks your changes locally right so that means
your changes locally right so that means you to understand the first thing that
you to understand the first thing that how you're going to initialize a g
how you're going to initialize a g repository in local right and whenever
repository in local right and whenever you're going to creating any fullstack
you're going to creating any fullstack project or anything you should normally
project or anything you should normally initialize this at the root of your
initialize this at the root of your application so here our root will be
application so here our root will be outside right so that is the reason we
outside right so that is the reason we have kept it outside or else we can just
have kept it outside or else we can just do do like this we can go to client and
do do like this we can go to client and server we should not do that because we
server we should not do that because we need to have both client and server side
need to have both client and server side code all right so I think this is done
code all right so I think this is done so now we need to understand how the
so now we need to understand how the life cycle or workflow of G works.
life cycle or workflow of G works. Right? So let's go to the documentation
Right? So let's go to the documentation again. So I'm going to copy this and
again. So I'm going to copy this and paste it and I'm going to do here
paste it and I'm going to do here get
get let's do get life cycle
or workflow. So here first I'm going to
So here first I'm going to copy and paste this one
copy and paste this one three times. So this is my local working
three times. So this is my local working directory. So let's consider this one as
directory. So let's consider this one as local working directory.
local working directory. Then here you already have g means I
Then here you already have g means I already have g. So g is already tracking
already have g. So g is already tracking my changes. Tracking changes what?
my changes. Tracking changes what? Locally right. So it is tracking the
Locally right. So it is tracking the changes locally. And then you have your
changes locally. And then you have your GitHub or your G repo. I'm going to tell
GitHub or your G repo. I'm going to tell this one as G repo because this is where
this one as G repo because this is where my repository will have in between there
my repository will have in between there should be something and it is called the
should be something and it is called the staging area. Oh my let's keep it like
staging area. Oh my let's keep it like this. It's called staging area. So what
this. It's called staging area. So what is my staging area? So let's say I have
100 file changes here.
file changes here. Okay, all the file changes locally g
Okay, all the file changes locally g will track but it is actually unttracked
will track but it is actually unttracked because you these 100 file changes are
because you these 100 file changes are not present in your GitHub. So that
not present in your GitHub. So that means what we need to do we need to
means what we need to do we need to stage all these file changes into our
stage all these file changes into our staging arena area first and this we
staging arena area first and this we usually do by doing g
usually do by doing g and then we'll do g add.
and then we'll do g add. Okay. So once we do get gad we are
Okay. So once we do get gad we are telling that okay these 100 file I need
telling that okay these 100 file I need to stage it because I need to push it to
to stage it because I need to push it to my GitHub. So this is your staging area.
my GitHub. So this is your staging area. This is where my snapset will be
This is where my snapset will be snapshot will be ready. Snapshot will be
snapshot will be ready. Snapshot will be ready. So this is shortcut snapshot
ready. So this is shortcut snapshot ready. And then once my staging area is
ready. And then once my staging area is uh ready I'm going to commit these
uh ready I'm going to commit these changes. So I need to do commit here. So
changes. So I need to do commit here. So how we are going to do commit? So we'll
how we are going to do commit? So we'll do usually get and then we'll do commit.
Okay. So I have my working directory where my changes although g is tracking
where my changes although g is tracking the changes locally but still my changes
the changes locally but still my changes are unttracked right but because these
are unttracked right but because these files are not present in my github I'm
files are not present in my github I'm going to do g add it will go to staging
going to do g add it will go to staging area staging area from this staging area
area staging area from this staging area means now I am actually my stage is
means now I am actually my stage is ready so think like that okay that my
ready so think like that okay that my stage is ready now I need to launch it
stage is ready now I need to launch it or I need to push it. So to push it I
or I need to push it. So to push it I need to commit these changes. So I need
need to commit these changes. So I need to commit it to my GitHub. Okay. So this
to commit it to my GitHub. Okay. So this is the uh life cycle or workflow very
is the uh life cycle or workflow very very simple way because there are a lot
very simple way because there are a lot of other things but as a beginner this
of other things but as a beginner this will be more than enough for you to
will be more than enough for you to understand. All right. So now let's see
understand. All right. So now let's see uh this process right we are going to
uh this process right we are going to practically implement that we have our
practically implement that we have our changes locally. We are going to stage
changes locally. We are going to stage our changes and then we are going to
our changes and then we are going to push our changes in our GitHub. So now
push our changes in our GitHub. So now let's go here first and then if you
let's go here first and then if you notice one thing in the left side we
notice one thing in the left side we it's showing that 6,000 plus files that
it's showing that 6,000 plus files that are in that we have actually made
are in that we have actually made changes. Now you might be thinking that
changes. Now you might be thinking that okay why these many files are coming
okay why these many files are coming right and actually some of you already
right and actually some of you already know from where it is coming and this is
know from where it is coming and this is actually coming from your node modules
actually coming from your node modules because what actually node modules does
because what actually node modules does so node modules is nothing but so it's
so node modules is nothing but so it's actually different from project like
actually different from project like tech to tech like let's say here we are
tech to tech like let's say here we are using man we are node modules because we
using man we are node modules because we are using node so node modules is
are using node so node modules is nothing but here we are having all the
nothing but here we are having all the project dependencies and the subd
project dependencies and the subd dependencies whenever we are going to
dependencies whenever we are going to install any package that package will be
install any package that package will be added in our node modules But normally
added in our node modules But normally we don't have to push that in our
we don't have to push that in our GitHub. Why? Because to track this we
GitHub. Why? Because to track this we already have something called a
already have something called a configuration file. So here we call this
configuration file. So here we call this one as a package.json. So this package
one as a package.json. So this package dojson is actually tells that okay in
dojson is actually tells that okay in this project I already have this
this project I already have this dependencies and the dev dependencies.
dependencies and the dev dependencies. So every time someone else is going to
So every time someone else is going to take this or pull this project from
take this or pull this project from GitHub, they just need to install this
GitHub, they just need to install this in their local. So you don't have to
in their local. So you don't have to push these changes. So with this we have
push these changes. So with this we have learned one more important concept in g
learned one more important concept in g that there are some files we don't have
that there are some files we don't have to push to GitHub and that files we
to push to GitHub and that files we actually write inside a special file
actually write inside a special file that is called g ignore. So that means
that is called g ignore. So that means we will have one file. So let me just
we will have one file. So let me just close this. So I'm going to copy this
close this. So I'm going to copy this here paste it
here paste it and I'm going to add here that what is g
and I'm going to add here that what is g ignore file right? So we do g ignore. G
ignore file right? So we do g ignore. G ignore. So g ignore is a special file
ignore. So g ignore is a special file where it's a plain text file. Okay. So
where it's a plain text file. Okay. So it's a plain text file where you list.
it's a plain text file where you list. Let me just keep this one big so that it
Let me just keep this one big so that it will be easy here. It will be like this.
will be easy here. It will be like this. Dot get ignore.
Dot get ignore. Okay. So it's a plain text file where
Okay. So it's a plain text file where you list all files
you list all files and directories
and directories that G should not track should not track
that G should not track should not track or basically
or basically they can ignore or basically G can
they can ignore or basically G can ignore right so this actually very very
ignore right so this actually very very important you will understand this one
important you will understand this one later why this is very very important in
later why this is very very important in the next section let's say you're adding
the next section let's say you're adding some sensitive informations you don't
some sensitive informations you don't want to add that on in or public G
want to add that on in or public G repository right so anyone can come and
repository right so anyone can come and access your password so you don't want
access your password so you don't want so you have to ignore all this file so
so you have to ignore all this file so this is where this one is very very
this is where this one is very very important so first before we will apply
important so first before we will apply the con life cycle workflow here the
the con life cycle workflow here the basic one we need to create a g ignore
basic one we need to create a g ignore file so I'll go here and then I'm going
file so I'll go here and then I'm going to add a file I'll create this one
to add a file I'll create this one outside so I'm going to create a file
outside so I'm going to create a file and I'll simply do I'll do g and I'll do
and I'll simply do I'll do g and I'll do ignore see so it's a g ignore file so
ignore see so it's a g ignore file so What are the things that these files
What are the things that these files should we should keep? So we need to
should we should keep? So we need to keep all the sensitive data all the
keep all the sensitive data all the local dependencies just like we have
local dependencies just like we have discussed the node modules and
discussed the node modules and everything. If there is any build
everything. If there is any build related artifacts like sometime we do
related artifacts like sometime we do npm run build and then we'll create a
npm run build and then we'll create a dig folder or build folder we don't have
dig folder or build folder we don't have to add that and also there can be some
to add that and also there can be some system related files that we can ignore
system related files that we can ignore here. Right? So normally first now let's
here. Right? So normally first now let's say I want to ignore this node modules
say I want to ignore this node modules folder here. So what I need to do right
folder here. So what I need to do right you just have to write the folder name
you just have to write the folder name here. So I'm going to do node and then
here. So I'm going to do node and then I'll do underscore modules right and the
I'll do underscore modules right and the moment I'll save this see what will
moment I'll save this see what will happen. Notice here see now we have only
happen. Notice here see now we have only 25 files. This is the main file that I
25 files. This is the main file that I need to push to GitHub. That means I'm
need to push to GitHub. That means I'm actually ignoring all these file and
actually ignoring all these file and every time you're going to add any file
every time you're going to add any file or directory in GitHub you'll see the
or directory in GitHub you'll see the color will actually change. And this is
color will actually change. And this is not only inside the client folder. This
not only inside the client folder. This will be inside your server folder also.
will be inside your server folder also. See you have any notebook. So whatever
See you have any notebook. So whatever files just think like that. It's like a
files just think like that. It's like a key concept. Whatever files or
key concept. Whatever files or directories you want to ignore, you can
directories you want to ignore, you can add it here. As simple as that. For now
add it here. As simple as that. For now we have node modules. We don't have to
we have node modules. We don't have to add anything else. We are going to later
add anything else. We are going to later add this. But for now just ignore any
add this. But for now just ignore any node modules. And the moment we'll do
node modules. And the moment we'll do that all these files will be ignored. So
that all these files will be ignored. So now you can see you are not getting any
now you can see you are not getting any node modules related files here. So this
node modules related files here. So this is the first step. So these things are
is the first step. So these things are very very basics everyone like this you
very very basics everyone like this you need to know like as a beginner right
need to know like as a beginner right first you need to initiate a g
first you need to initiate a g repository and to do that you need to
repository and to do that you need to use g in it create a g ignore file and
use g in it create a g ignore file and then you start working on the pushing
then you start working on the pushing the changes next thing what we need to
the changes next thing what we need to learn we need to learn how we are going
learn we need to learn how we are going to stage our changes so what I mean g
to stage our changes so what I mean g add remember g add so we'll go here and
add remember g add so we'll go here and then I'll tell that okay now I'm ready
then I'll tell that okay now I'm ready to push my changes or st my uh sorry
to push my changes or st my uh sorry stage my changes status and stage is
stage my changes status and stage is different. Stage my changes. So I'll
different. Stage my changes. So I'll simply do G and then what you need to do
simply do G and then what you need to do here. So you need to do add G space add.
here. So you need to do add G space add. And then you need to do dot and here
And then you need to do dot and here what will happen. It's going to you can
what will happen. It's going to you can see what happened. All the changes are
see what happened. All the changes are actually staged. Notice what is actually
actually staged. Notice what is actually happening here. I think you can ignore
happening here. I think you can ignore all of these. You see now you have
all of these. You see now you have staged changes here. Notice here. And
staged changes here. Notice here. And now the moment I can unstage the
now the moment I can unstage the changes. So I'm going to do click here.
changes. So I'm going to do click here. See what will happen. Now you're getting
See what will happen. Now you're getting changes. See these things are important.
changes. See these things are important. So first you have changes again if you
So first you have changes again if you just compare this. So you have changes
just compare this. So you have changes unttracked local changes which is
unttracked local changes which is tracked by G. Fine. But you need to
tracked by G. Fine. But you need to stage those changes. So that is the
stage those changes. So that is the reason we are doing get add. You can
reason we are doing get add. You can also directly do from here. See there
also directly do from here. See there there is a plus icon here in VS code. So
there is a plus icon here in VS code. So it's actually add all the changes. So
it's actually add all the changes. So I'm going to do plus. So it's now all
I'm going to do plus. So it's now all your changes is staged. So that means
your changes is staged. So that means all your changes are in this step. Now
all your changes are in this step. Now we need to do a commit. So now I am
we need to do a commit. So now I am actually ready to push my changes to
actually ready to push my changes to GitHub. But nothing we have created
GitHub. But nothing we have created anything related to GitHub. Forget about
anything related to GitHub. Forget about that. We need to first keep ready in our
that. We need to first keep ready in our local. So now we need to do what? We
local. So now we need to do what? We need to do g commit. And to do g commit
need to do g commit. And to do g commit what we need to do here. So I will go
what we need to do here. So I will go here and then I'll just do clear
here and then I'll just do clear and I'll do get
and I'll do get commit
commit minus m. Here we are going to add a
minus m. Here we are going to add a message. Now these messages are very
message. Now these messages are very very important. These messages will
very important. These messages will actually tell that these changes is
actually tell that these changes is related to what? So for example, let's
related to what? So for example, let's say you are working on a manst
say you are working on a manst application, e-commerce application and
application, e-commerce application and you just created your product listing
you just created your product listing page. So whenever you're going to add
page. So whenever you're going to add this commit these changes you need to
this commit these changes you need to add here that product listing changes
add here that product listing changes addit got it so let's say you are adding
addit got it so let's say you are adding you have just added a payment related
you have just added a payment related feature so we'll do payment feature for
feature so we'll do payment feature for PayPal
PayPal added very very important whenever
added very very important whenever you're working on a team or else it will
you're working on a team or else it will create confusion so please be very
create confusion so please be very careful when you're adding some uh this
careful when you're adding some uh this message here so this is our first commit
message here so this is our first commit right so I'll do initial commit
initial commit and then let's do added client and server structure
client and server structure got it now I'm going to do enter see
got it now I'm going to do enter see what will happen so it's created a mode
what will happen so it's created a mode and it's actually changed it's actually
and it's actually changed it's actually telling the 25 changes file changes uh
telling the 25 changes file changes uh changed and these many lines is
changed and these many lines is inserted. Okay, if if you remove
inserted. Okay, if if you remove something, it will tell that okay, these
something, it will tell that okay, these many files removed. Now you are in this
many files removed. Now you are in this step. Sorry, you are in this in this
step. Sorry, you are in this in this step that g commit is also done. So now
step that g commit is also done. So now your changes are in commit state. You
your changes are in commit state. You need to now add your changes in GitHub.
need to now add your changes in GitHub. Correct. Now one very important concept
Correct. Now one very important concept that what actually commit does. So
that what actually commit does. So commit will store a snapshot. I think I
commit will store a snapshot. I think I already mentioned huh snapshot of your
already mentioned huh snapshot of your codebase as of now. So that means you
codebase as of now. So that means you are actually now ready to push your
are actually now ready to push your changes to GitHub. All right. So now
changes to GitHub. All right. So now here very very important you can also go
here very very important you can also go and then I'm going to clear this and
and then I'm going to clear this and just type your G status. So here it is
just type your G status. So here it is telling that it is on branch master. You
telling that it is on branch master. You have nothing to commit because you have
have nothing to commit because you have already committed and your working tree
already committed and your working tree is clean. Okay. Now what I need to do
is clean. Okay. Now what I need to do right let's I'll go here and I'll go to
right let's I'll go here and I'll go to commit and then let's do undo last
commit and then let's do undo last commit. So I'm going to undo the commit
commit. So I'm going to undo the commit once again. Now see once you do that
once again. Now see once you do that now again it is showing in the initial
now again it is showing in the initial changes. I I need to explain why. Now
changes. I I need to explain why. Now what I'm going to do right I'm going to
what I'm going to do right I'm going to add all these changes again. So I'm
add all these changes again. So I'm going to st this.
going to st this. Okay. And now what I'll do now changes
Okay. And now what I'll do now changes are stash. I'm going to clear and let's
are stash. I'm going to clear and let's do get status again. Now you see what is
do get status again. Now you see what is it is showing that you don't have any
it is showing that you don't have any commit yet. You are currently on the
commit yet. You are currently on the branch master. You have changes to be
branch master. You have changes to be committed and these all the changes you
committed and these all the changes you have actually created. New file, new
have actually created. New file, new file, new file whatever blah blah. Now
file, new file whatever blah blah. Now why it is important actually I just want
why it is important actually I just want to make prove that point that if you
to make prove that point that if you notice that g is actually tracking all
notice that g is actually tracking all your changes locally. So that means all
your changes locally. So that means all your changes currently in local and it's
your changes currently in local and it's actually tracking your changes. Got it?
actually tracking your changes. Got it? So that is the reason I just want to
So that is the reason I just want to mention. So G status will give you all
mention. So G status will give you all the status current status. Now I'm going
the status current status. Now I'm going to clear this and again I'm going to
to clear this and again I'm going to commit. So let's commit. So now your
commit. So let's commit. So now your changes are committed. So now we need to
changes are committed. So now we need to push our changes to GitHub. But before
push our changes to GitHub. But before doing that we need to create a
doing that we need to create a repository in GitHub, right? So let's do
repository in GitHub, right? So let's do that in the next section. All right. So
that in the next section. All right. So now we are going to uh create a
now we are going to uh create a repository in GitHub. So search for
repository in GitHub. So search for GitHub. Just go here and then you can
GitHub. Just go here and then you can see that this is my dashboard. And here
see that this is my dashboard. And here what I'm going to do right now see if
what I'm going to do right now see if you're seeing this one for the first
you're seeing this one for the first time which I'm actually guessing that
time which I'm actually guessing that you are not I think you already have
you are not I think you already have some idea on GitHub. But if you're
some idea on GitHub. But if you're seeing so there are quite a few things
seeing so there are quite a few things here. So you need sometime we can't
here. So you need sometime we can't cover each and everything in this
cover each and everything in this particular video. I'll try my best
particular video. I'll try my best throughout this video. So for example we
throughout this video. So for example we are going to cover access GitHub accense
are going to cover access GitHub accense and then how we are going to create
and then how we are going to create tokens access token those kind of things
tokens access token those kind of things SSH key is in the later part but for now
SSH key is in the later part but for now let's see how we are going to create a
let's see how we are going to create a repository. So here you can see that we
repository. So here you can see that we are getting in the dashboard we'll be
are getting in the dashboard we'll be getting this new option. So from here
getting this new option. So from here you can create or you can also go from
you can create or you can also go from here and then go to your repositories
here and then go to your repositories and from there also you can create. So
and from there also you can create. So let's go to your repositories
let's go to your repositories and then I'm going to create some new
and then I'm going to create some new repository. Okay. And here let's give
repository. Okay. And here let's give this one name as maybe DevOps
this one name as maybe DevOps YouTube
YouTube course
course 2025.
2025. Okay. Now you need to choose like
Okay. Now you need to choose like whether you want to keep this one as
whether you want to keep this one as public or private. So I'll keep this one
public or private. So I'll keep this one as public for now. And then I'm just
as public for now. And then I'm just going to create the repository. So once
going to create the repository. So once I'll create so I'll be getting a URL. So
I'll create so I'll be getting a URL. So this URL I need to use to add the
this URL I need to use to add the origin. So this add origin will actually
origin. So this add origin will actually tell from our local that okay I need to
tell from our local that okay I need to push to this particular repository
push to this particular repository whatever code I will be having in my
whatever code I will be having in my local. So now what we going to do simply
local. So now what we going to do simply if you notice that we have already
if you notice that we have already actually created all this step. So we
actually created all this step. So we already have g in it initialization g
already have g in it initialization g add we have already done g commit also
add we have already done g commit also we have already done and then you can
we have already done and then you can see that it's doing something like this
see that it's doing something like this get branch minus a main. So what this is
get branch minus a main. So what this is mean is this is actually renaming the
mean is this is actually renaming the name from master to main. Now this is
name from master to main. Now this is actually a standard uh approach that we
actually a standard uh approach that we should actually do it. So you can also
should actually do it. So you can also we can also do the same right. So what
we can also do the same right. So what we can do simply if you go to my local
we can do simply if you go to my local you'll see that we have this master. So
you'll see that we have this master. So you can change this name from master to
you can change this name from master to main. To do this one we just have to use
main. To do this one we just have to use this g branch m and then you have to
this g branch m and then you have to pass main. So I'll just copy this
pass main. So I'll just copy this and then I'm going to clear this and now
and then I'm going to clear this and now let's paste it and enter.
let's paste it and enter. Okay. So now you can see that this is
Okay. So now you can see that this is changed to main. So here this is this
changed to main. So here this is this command is actually to rename any
command is actually to rename any branch. So once this is done then what
branch. So once this is done then what we will be uh sorry what will be our
we will be uh sorry what will be our next step. So next step will be we need
next step. So next step will be we need to add a remote URL. So here so let's
to add a remote URL. So here so let's now copy all of this right. Let's copy
now copy all of this right. Let's copy this maybe.
Okay. And then I'll come here and then I'm going to add some of the things that
I'm going to add some of the things that we needed. I'm going to keep it like
we needed. I'm going to keep it like this. Now when I'll say right, you have
this. Now when I'll say right, you have to actually manage like this. So I'll be
to actually manage like this. So I'll be I'm sure that you'll be able to
I'm sure that you'll be able to understand because if you just go
understand because if you just go through this video, let's say you're
through this video, let's say you're watching the video and side by side you
watching the video and side by side you are keeping the doc it will be easy for
are keeping the doc it will be easy for you to understand. So here let me just
you to understand. So here let me just write it. So I'm going to remove this.
write it. So I'm going to remove this. So you have learned what get in it right
So you have learned what get in it right then what you have learned get add
then what you have learned get add then you have learned g commit
then you have learned g commit right then you have learned that how we
right then you have learned that how we are going to rename a branch so to
are going to rename a branch so to rename this one we need to use greet
rename this one we need to use greet branch
branch hyphen m and then the name of the branch
hyphen m and then the name of the branch that you want to give so we'll do name
that you want to give so we'll do name of the branch
of the branch then we are going to now learn how we
then we are going to now learn how we are going to use or add a origin to to
are going to use or add a origin to to add origin we are going to use we'll do
add origin we are going to use we'll do add origin we need to do get remote
add origin we need to do get remote and then we are going to do add origin
and then we are going to do add origin and then the URL and this URL you'll be
and then the URL and this URL you'll be getting whenever you're going to create
getting whenever you're going to create a new repository right so I'm going to
a new repository right so I'm going to copy this simply
and then clear and I'm going to just hit enter and
and I'm going to just hit enter and you'll See it will do something here. So
you'll See it will do something here. So it's now what happened? So now our
it's now what happened? So now our remote origin is actually added. If you
remote origin is actually added. If you want to verify so I'm going to just do
want to verify so I'm going to just do here verify
here verify origin.
origin. So here you can do simply get remote
So here you can do simply get remote v. If I go here and let's say I'll do g
v. If I go here and let's say I'll do g remote v. So it's going to give you the
remote v. So it's going to give you the origin. So this is the origin from where
origin. So this is the origin from where you are going to fetch and this is the
you are going to fetch and this is the same origin where you are going to do
same origin where you are going to do push. So how the process will work
push. So how the process will work right? So let's say uh I'll take this or
right? So let's say uh I'll take this or maybe this one. So let's say you have a
maybe this one. So let's say you have a code your local code and your github
code your local code and your github repository right. So either you're going
repository right. So either you're going to fetch from here or you're going to
to fetch from here or you're going to push right means you're adding a new
push right means you're adding a new code or you're getting the updated code
code or you're getting the updated code from let's say you have two team member
from let's say you have two team member team one and then team member team
team one and then team member team member two. So they are pushing some
member two. So they are pushing some changes. So whenever they're pushing
changes. So whenever they're pushing they'll be pushing in your github right.
they'll be pushing in your github right. So whenever you need to get their
So whenever you need to get their changes, you need to fetch. Correct?
changes, you need to fetch. Correct? Similarly, when this team member two
Similarly, when this team member two needs to take your changes, you need to
needs to take your changes, you need to push. So either push or fetch. So that
push. So either push or fetch. So that is the reason you are getting origin
is the reason you are getting origin this. So this is the fetch URL and this
this. So this is the fetch URL and this is the push URL. Now if you talk about G
is the push URL. Now if you talk about G and GitHub, right? I will be very honest
and GitHub, right? I will be very honest like if I want I can create a single
like if I want I can create a single video of like 6 to 10 hours only on G
video of like 6 to 10 hours only on G and G and GitHub. like it's very vast.
and G and GitHub. like it's very vast. There are a lot lot of commands and I
There are a lot lot of commands and I can't cover each and everything in a
can't cover each and everything in a single video. It's very very simple.
single video. It's very very simple. It's a DevOps beginner course. I'll try
It's a DevOps beginner course. I'll try my best so that I'll be able to cover
my best so that I'll be able to cover all the basic necessity that you need to
all the basic necessity that you need to start your journey as a DevOps engineer.
start your journey as a DevOps engineer. Like you need to know all these process
Like you need to know all these process or let's say you're doing freelancing,
or let's say you're doing freelancing, you need to know all of these, right? If
you need to know all of these, right? If you are working on any client project.
you are working on any client project. So those many things you're going to
So those many things you're going to learn. I never said that I'm going to
learn. I never said that I'm going to cover each and everything. It's actually
cover each and everything. It's actually not possible, right? This video will be
not possible, right? This video will be very very long. So now how sorry what
very very long. So now how sorry what are the processes that we have
are the processes that we have completed. So see working repository
completed. So see working repository this part we have done staging we have
this part we have done staging we have already completed and now I need to push
already completed and now I need to push my changes commit also have completed.
my changes commit also have completed. So I need to push my changes. So to push
So I need to push my changes. So to push my changes my remote is already now
my changes my remote is already now added. So my GitHub my g knows that
added. So my GitHub my g knows that where I need to push the changes and to
where I need to push the changes and to push the code what we'll do simply we'll
push the code what we'll do simply we'll do g push
do g push hyphen u and we're going to simply tell
hyphen u and we're going to simply tell origin. So I'll do origin and then you
origin. So I'll do origin and then you need to tell that which branch you want
need to tell that which branch you want to push. So I want to push the main
to push. So I want to push the main branch. So I'll do main. Now here I'll
branch. So I'll do main. Now here I'll just write this command here. So let me
just write this command here. So let me just close this.
just close this. So I'll do push
So I'll do push changes to it. So this will be
changes to it. So this will be get push - u origin main. What is this
get push - u origin main. What is this hyphen u? So this hyphen u it's a flag
hyphen u? So this hyphen u it's a flag that sets upstream right and that means
that sets upstream right and that means what will happen? So whenever so future
what will happen? So whenever so future so whenever
so whenever in future you will push
in future you will push or uh like in sort let's do so future
or uh like in sort let's do so future poses
poses can be just get push just get push so
can be just get push just get push so you don't have to do this every time so
you don't have to do this every time so simply do get push you will know
simply do get push you will know actually because you are already setting
actually because you are already setting the upstream here Right, that's it. So
the upstream here Right, that's it. So now what I'll do simply so lit p-en u
now what I'll do simply so lit p-en u origin and the name of the branch. I'll
origin and the name of the branch. I'll just do enter. Now see what will happen.
Awesome. So now changes are added. You can also directly do from here also but
can also directly do from here also but always it's better to know all the
always it's better to know all the commands. So now it's actually you can
commands. So now it's actually you can see the changes are pushed. refresh this
see the changes are pushed. refresh this page
page and now you're seeing the client side
and now you're seeing the client side code, server side code and the g ignore.
code, server side code and the g ignore. So in the g ignore you already have only
So in the g ignore you already have only non modules. If you go to client side
non modules. If you go to client side code you see you don't have the node
code you see you don't have the node modules and in the server side also you
modules and in the server side also you don't have the non modules.
don't have the non modules. So now let's recap everything right it's
So now let's recap everything right it's actually important. So what we have
actually important. So what we have learned so far? So learn that g in it
learned so far? So learn that g in it will initialize a uh repository right
will initialize a uh repository right then let me change the color here
maybe let's give white. So get in it we have learned g add will stage your
have learned g add will stage your changes. This will commit and create a
changes. This will commit and create a snapshot. G branch- m is going to rename
snapshot. G branch- m is going to rename the branch. G add origin this going to
the branch. G add origin this going to add a remote origin where you're going
add a remote origin where you're going to push your changes it's going to
to push your changes it's going to verify the remote get remote v and then
verify the remote get remote v and then at the end to push the changes you need
at the end to push the changes you need to do get push hyphen origin and the
to do get push hyphen origin and the name of the branch that which branch you
name of the branch that which branch you want to push now this will give you all
want to push now this will give you all the basic very very basic necessity at
the basic very very basic necessity at least you need to know right so now I
least you need to know right so now I think this is done so what will be our
think this is done so what will be our next step so next step I am going to
next step so next step I am going to cover the branching strategies that how
cover the branching strategies that how you can create branch how you can switch
you can create branch how you can switch from one branch to another branch and
from one branch to another branch and how you can merge those kind of things.
how you can merge those kind of things. Once this is done then I can say the
Once this is done then I can say the very very basic like very basics of g
very very basic like very basics of g and github will be completed then we'll
and github will be completed then we'll move to the next section because there
move to the next section because there are lot of things we need to cover in
are lot of things we need to cover in this full video. So let's move on to the
this full video. So let's move on to the next one. All right. So now let's see uh
next one. All right. So now let's see uh that why actually we we need branches.
that why actually we we need branches. Right. So there's main two reason. The
Right. So there's main two reason. The first one is uh let me just take one
first one is uh let me just take one save here.
save here. So here the first reason will be which
So here the first reason will be which is very very important and that is
is very very important and that is whenever you're working on any new
whenever you're working on any new feature correct or you are working on
feature correct or you are working on any fixes. So what happen you don't
any fixes. So what happen you don't directly want to do on the main branch.
directly want to do on the main branch. Let's say your main branch is currently
Let's say your main branch is currently deployed in prod. So what you need to
deployed in prod. So what you need to do? You need to implement parallel
do? You need to implement parallel development. Right? Parallel means you
development. Right? Parallel means you are doing side by side. You are not
are doing side by side. You are not directly pushing the changes in main. So
directly pushing the changes in main. So this is one of the main reason of
this is one of the main reason of keeping branches. Second is whenever
keeping branches. Second is whenever you're working in a team, right? Team
you're working in a team, right? Team members definitely needs to work on
members definitely needs to work on different different branches. So I'm
different different branches. So I'm going to give you real life example how
going to give you real life example how this processes actually works.
this processes actually works. So let's take some time. So let's say uh
So let's take some time. So let's say uh here I am going to take
here I am going to take a black color.
a black color. Now what happened right? Oh man I need
Now what happened right? Oh man I need to again select this.
Okay see so you have your main branch. This is your main branch.
main branch. This is your main branch. Correct. And you have
Correct. And you have three team members. Correct. So you have
three team members. Correct. So you have team member one,
team member one, team member two, team member three.
team member two, team member three. So this is one scenario. It's possible
So this is one scenario. It's possible you are working alone. This is also
you are working alone. This is also possible, right? Let's say you are
possible, right? Let's say you are working on some freelancing project.
working on some freelancing project. This is your main codebase every in both
This is your main codebase every in both the scenarios because this is how real
the scenarios because this is how real uh projects work, right? Even though
uh projects work, right? Even though whatever projects you can say there will
whatever projects you can say there will be always one main branch will be there.
be always one main branch will be there. This is deployed to product. Now there
This is deployed to product. Now there can be two possibility that this let's
can be two possibility that this let's talk about this scenario. Your team
talk about this scenario. Your team member team t1 team member get gets a
member team t1 team member get gets a story that he needs to implement a new
story that he needs to implement a new feature.
feature. Team two they gets story of enhancement
Team two they gets story of enhancement and team three they gets another story
and team three they gets another story to a bug fix.
Okay. Now what will happen if both the teams
Now what will happen if both the teams they have actually let's say they didn't
they have actually let's say they didn't fork it. So forking we are going to not
fork it. So forking we are going to not we'll just skip for now let's say they
we'll just skip for now let's say they have actually have all their repository
have actually have all their repository in their local machine. So everyone has
in their local machine. So everyone has the repository in the local machine and
the repository in the local machine and every one team member every one of them
every one team member every one of them start working on this main branch right.
start working on this main branch right. So what will be the risks here? It's a
So what will be the risks here? It's a huge risk, right? When you are
huge risk, right? When you are implementing a new feature specifically
implementing a new feature specifically new feature and bug fix you should not
new feature and bug fix you should not or I will say you never should push the
or I will say you never should push the code directly to main branch. So what
code directly to main branch. So what you need to do there will be a bridge in
you need to do there will be a bridge in between. It's called parallel
between. It's called parallel development. So what you're doing you're
development. So what you're doing you're simply have your main branch and every
simply have your main branch and every one of them like this is actually same
one of them like this is actually same in both the scenario whether you are
in both the scenario whether you are working alone as a freelancing or let's
working alone as a freelancing or let's say in a team. So you have a main branch
say in a team. So you have a main branch you will cut so you will cut a branch
you will cut so you will cut a branch from main.
from main. So let's say your you have a branch.
So let's say your you have a branch. So branch one. So what do you mean by
So branch one. So what do you mean by cut? So whenever you're going to cut or
cut? So whenever you're going to cut or create so it's like you can say cut or
create so it's like you can say cut or create. Whenever you're going to cut a
create. Whenever you're going to cut a branch from main, all the main code will
branch from main, all the main code will be available in the branch one. Correct?
be available in the branch one. Correct? Now your team member made some changes
Now your team member made some changes and they push the changes to this
and they push the changes to this branch. These changes, whatever changes
branch. These changes, whatever changes he have made, it can be feature, it can
he have made, it can be feature, it can be bug fix, it can be enhancement,
be bug fix, it can be enhancement, whatever blah blah. First all the
whatever blah blah. First all the changes will be tested
changes will be tested in lower environment. Lord environment
in lower environment. Lord environment means we are going to we will be having
means we are going to we will be having environment section next part only but
environment section next part only but for now just uh think like you have
for now just uh think like you have another environment you don't you don't
another environment you don't you don't want to test directly in production
want to test directly in production because production will be accessible by
because production will be accessible by real user so you don't want any wrong
real user so you don't want any wrong thing happens in the production right so
thing happens in the production right so all your changes will be first tested in
all your changes will be first tested in the branch one if it looks okay that
the branch one if it looks okay that means all the changes are fine then only
means all the changes are fine then only you are going to create a pull request
you are going to create a pull request that we are going to discuss you're
that we are going to discuss you're going to create a pull request And then
going to create a pull request And then you will be merging your changes to main
you will be merging your changes to main branch. Right? So branching is very very
branch. Right? So branching is very very very important. Even though you are
very important. Even though you are working on freelancing for any client
working on freelancing for any client project, you are working as let's say
project, you are working as let's say you are in final year project you are as
you are in final year project you are as a student you are creating a project
a student you are creating a project still you should follow this approach.
still you should follow this approach. You should never have a single branch
You should never have a single branch and then push all the changes blindly.
and then push all the changes blindly. Right? So you need to create a branch
Right? So you need to create a branch and always we should always what will
and always we should always what will happen right? We usually create a branch
happen right? We usually create a branch from main. Why? because all the latest
from main. Why? because all the latest code changes, latest code changes will
code changes, latest code changes will be available in the main branch. So now
be available in the main branch. So now you have idea that why we need branches,
you have idea that why we need branches, right? So now let's see how we are going
right? So now let's see how we are going to implement these branches in our
to implement these branches in our project. Let me give you one more uh
project. Let me give you one more uh visual diagram and it will be easy.
visual diagram and it will be easy. Okay, so let me just take this.
Okay, so let me just take this. So I'll take this okay and I'll just
So I'll take this okay and I'll just copy and put it here.
copy and put it here. I'll just
I'll just put it one more here.
put it one more here. So this is your main branch.
So this is your main branch. Okay, you you will be doing release. So
Okay, you you will be doing release. So this is let's say you are doing release
this is let's say you are doing release here. This is not a branch. This is just
here. This is not a branch. This is just you are doing release. Okay, so this is
you are doing release. Okay, so this is where you'll be releasing your changes
where you'll be releasing your changes to prod. And then you have a de branch.
to prod. And then you have a de branch. Oh my god, we need to keep it. Huh?
Oh my god, we need to keep it. Huh? you have a D branch
you have a D branch and then I'm going to just copy one more
and then I'm going to just copy one more time
and then paste it. Paste it. So you'll do commits
then you'll do commits and you'll do commits.
and you'll do commits. Right? So you do commit
Right? So you do commit means what you are simply doing from
means what you are simply doing from this D branch you are doing multiple
this D branch you are doing multiple commits right these commits will be
commits right these commits will be pushed where in your GitHub repository
pushed where in your GitHub repository you're going to deploy first this dev
you're going to deploy first this dev branch in lower environment so here
branch in lower environment so here release means you have in between some
release means you have in between some steps like you have some lower
steps like you have some lower environment like stage environment where
environment like stage environment where you're doing the testing of these
you're doing the testing of these changes and then these changes will be
changes and then these changes will be merged to main and main you're going to
merged to main and main you're going to release again. Okay, so this is not
release again. Okay, so this is not complete but I just give you some of the
complete but I just give you some of the idea. So this dev branch will do all the
idea. So this dev branch will do all the commits. Once all the changes are
commits. Once all the changes are tested, you're going to merge those in
tested, you're going to merge those in main and then main is here we are going
main and then main is here we are going to do the release. Okay. So now let's
to do the release. Okay. So now let's see how we going to do that. So first
see how we going to do that. So first I'll go here and let's check the current
I'll go here and let's check the current branch. So I'm going to just do get
branch. So I'm going to just do get branch. So this will give you main which
branch. So this will give you main which is the current branch.
is the current branch. And now I want to create a branch. Now
And now I want to create a branch. Now there are multiple commands you can do.
there are multiple commands you can do. Either you can create a branch and then
Either you can create a branch and then you can switch or you can directly
you can switch or you can directly create and switch. Okay. So to create a
create and switch. Okay. So to create a branch you can simply do get branch and
branch you can simply do get branch and then the name of the branch. You can
then the name of the branch. You can also do like old old style we used to do
also do like old old style we used to do like this. G check out minus b and then
like this. G check out minus b and then name of the branch. But for now I'll
name of the branch. But for now I'll suggest you will do g branch and then
suggest you will do g branch and then name of the branch I'll give div. Okay.
name of the branch I'll give div. Okay. Hit enter. Now you notice one thing it's
Hit enter. Now you notice one thing it's actually created a branch. If I click
actually created a branch. If I click here, right, there is a dev branch. See,
here, right, there is a dev branch. See, we have main and then dev. But it didn't
we have main and then dev. But it didn't switch the branch. And to switch, what
switch the branch. And to switch, what you need to do? You need to do g switch
you need to do? You need to do g switch and the name of the branch which is dev.
and the name of the branch which is dev. Hit enter. Now it is in the dev branch.
Hit enter. Now it is in the dev branch. And notice this branch is not present in
And notice this branch is not present in the GitHub. So if I go here and let's go
the GitHub. So if I go here and let's go here,
here, refresh this.
refresh this. And notice we don't have any other
And notice we don't have any other branches, right? Means this branch is
branches, right? Means this branch is now currently locally available locally
now currently locally available locally tracked. It's not available in the
tracked. It's not available in the GitHub. Now I'll give you one more
GitHub. Now I'll give you one more command that you want to directly switch
command that you want to directly switch and create. Both the things you can do.
and create. Both the things you can do. So for that what you need to do right?
So for that what you need to do right? You need to do G switch
You need to do G switch and then I'll do minus C and then the
and then I'll do minus C and then the name of the branch. Now let's I'll
name of the branch. Now let's I'll create one more branch some temp branch.
create one more branch some temp branch. So I'll do temp. So what will happen
So I'll do temp. So what will happen right? It will create a branch and then
right? It will create a branch and then it's going to switch. Enter. See, it's
it's going to switch. Enter. See, it's create a branch and then again it switch
create a branch and then again it switch to a new branch temp. And if you go
to a new branch temp. And if you go here, you can see we have now three
here, you can see we have now three branches. Got it? So now what you're
branches. Got it? So now what you're going to do simply also I'm going to
going to do simply also I'm going to show you that how we are going to uh
show you that how we are going to uh delete a branch. So let's say for this
delete a branch. So let's say for this one this temp branch we want to delete.
one this temp branch we want to delete. So maybe first let's do one thing. Let's
So maybe first let's do one thing. Let's switch to main. So do get switch main.
switch to main. So do get switch main. So we are in the main and now I'm simply
So we are in the main and now I'm simply going to do get branch and you need to
going to do get branch and you need to do minus d for delete minus minus or
do minus d for delete minus minus or hyphen d and then the name of the
hyphen d and then the name of the branch. So I'll do temp. Hit enter. You
branch. So I'll do temp. Hit enter. You can see it's actually deleted. If you go
can see it's actually deleted. If you go here, you have only two branches. I hope
here, you have only two branches. I hope you got it. So now what will happen? So
you got it. So now what will happen? So we actually created already a dev
we actually created already a dev branch. So I'm going to change to the
branch. So I'm going to change to the dev branch. So I'm going to get switch
dev branch. So I'm going to get switch and I'll do div. I'm in the dev branch
and I'll do div. I'm in the dev branch and I'm going to make some changes. So
and I'm going to make some changes. So let's say just do any changes. Okay. So
let's say just do any changes. Okay. So maybe I'll go here
maybe I'll go here and I'll do setting down gracefully to
and I'll do setting down gracefully to changed
to setting down gracefully. Just save this.
setting down gracefully. Just save this. So we have one changes. Okay. Now if you
So we have one changes. Okay. Now if you notice I will be pushing the changes to
notice I will be pushing the changes to my dev branch. So that means I'm
my dev branch. So that means I'm directly not making changes in my main
directly not making changes in my main branch. Got it? So now what I'm going to
branch. Got it? So now what I'm going to do now remember we know all the commands
do now remember we know all the commands from here. So I'll do again add.
from here. So I'll do again add. So it's added the changes. I'll do g
So it's added the changes. I'll do g commit
commit m and I'm just going to do maybe uh
m and I'm just going to do maybe uh let's do div temp console changes. Got
let's do div temp console changes. Got it. Hit enter. So now added. And then
it. Hit enter. So now added. And then what we need to do remember we have
what we need to do remember we have gy-en
gy-en u origin and then the name of the branch
u origin and then the name of the branch name of the branch will be dev. Okay. So
name of the branch will be dev. Okay. So now we are actually simply push the
now we are actually simply push the changes. So now this branch will be now
changes. So now this branch will be now added.
added. All right. And if you go here you notice
All right. And if you go here you notice one thing. See now you see this this is
one thing. See now you see this this is a very cool feature. So you'll be
a very cool feature. So you'll be automatically getting that if you want
automatically getting that if you want to create a pull request here or not. So
to create a pull request here or not. So for now let's refresh this.
for now let's refresh this. Okay. And then you can see that you have
Okay. And then you can see that you have now two branches. If you click here
now two branches. If you click here so here you'll be getting the history
so here you'll be getting the history also directly from here. So you can
also directly from here. So you can simply click and see the changes that
simply click and see the changes that whatever changes we have actually done
whatever changes we have actually done here. Right? You can add comment and
here. Right? You can add comment and everything. I'll not go into those
everything. I'll not go into those details that will be very detailed. Now
details that will be very detailed. Now if you want to add or create a pull
if you want to add or create a pull request you can directly do compare and
request you can directly do compare and pull request.
pull request. And now what you need to do you are
And now what you need to do you are simply doing that compare dev means we
simply doing that compare dev means we are push merging from div to main right
are push merging from div to main right so this is from where you want to add
so this is from where you want to add the changes and this is where you so
the changes and this is where you so this is your source and this is destin
this is your source and this is destin destination just thing like that so
destination just thing like that so you're merging from dev to main okay so
you're merging from dev to main okay so this is one way sometime see after
this is one way sometime see after sometime this banner will not come if
sometime this banner will not come if you want to manually create pull request
you want to manually create pull request you can go to pull request on top so you
you can go to pull request on top so you have pull request request
have pull request request you're going to do new pull request
you're going to do new pull request and then here you need to change the
and then here you need to change the branches right so for example let's say
branches right so for example let's say I change go to dev dev to main once you
I change go to dev dev to main once you do that you'll be seeing the changes
do that you'll be seeing the changes like what changes you are having so this
like what changes you are having so this is plus means this is the changes you
is plus means this is the changes you have in the dev branch and this is the
have in the dev branch and this is the changes you have in the master branch
changes you have in the master branch sorry main branch so this is the
sorry main branch so this is the difference and here you can create a
difference and here you can create a pull request from here directly got it
pull request from here directly got it so this This is one way. Another thing
so this This is one way. Another thing is that how you can directly merge this
is that how you can directly merge this de branch into main branch. And to do
de branch into main branch. And to do this what you can do right go there. I'm
this what you can do right go there. I'm going to do clear. Now notice one thing
going to do clear. Now notice one thing first what I'll do first I'm going to
first what I'll do first I'm going to change currently I'm in the dev branch.
change currently I'm in the dev branch. So I'm going to do get switch
So I'm going to do get switch main
main and you can see this is now changed
and you can see this is now changed because this is what we have here. And
because this is what we have here. And now what I'm going to do simply I'll do
now what I'm going to do simply I'll do that get merge and the name of the
that get merge and the name of the branch. So I'll give here div
branch. So I'll give here div enter see
enter see updated right. So you also it will so
updated right. So you also it will so fast forward because there is no much
fast forward because there is no much conflict now sometimes conflict will
conflict now sometimes conflict will come. So here what will happen it is
come. So here what will happen it is actually showing that this is the
actually showing that this is the changes and now you can again just do
changes and now you can again just do gate post. See what will happen. You
gate post. See what will happen. You don't have to set the upstream. Remember
don't have to set the upstream. Remember we have already set hyphen u. So now
we have already set hyphen u. So now we'll simply do get push and see what
we'll simply do get push and see what will happen.
It's actually push the changes right and if you go back
if you go back go to main
go to main right and here if you go to this see
right and here if you go to this see server we have these changes temp
server we have these changes temp console changes and see this is already
console changes and see this is already changed right. So if you go to that
changed right. So if you go to that content also you'll be able to verify.
content also you'll be able to verify. So let's go to server.js JS and you can
So let's go to server.js JS and you can see changed to is now coming right so
see changed to is now coming right so this is command in the directly in the
this is command in the directly in the command prompt you can directly merge
command prompt you can directly merge with G merge and the name of the branch
with G merge and the name of the branch but it's always always best practice to
but it's always always best practice to merge your changes through pull request
merge your changes through pull request right so now I'm going to do so let's
right so now I'm going to do so let's say G switch
say G switch dev
dev and I'm going to do changed again just
and I'm going to do changed again just change this
change this so now I have the changes try to
so now I have the changes try to practice all of these And then I'll do G
practice all of these And then I'll do G add
add right I'll do G commit
console message again
again right and then I'll do get push
and you can see You are again getting the same that you have already pushed
the same that you have already pushed some changes whether you want to create
some changes whether you want to create a pull request or not. Yes, I am want to
a pull request or not. Yes, I am want to do it. So we'll go there and here I'm
do it. So we'll go there and here I'm merging dev to main. So just add some
merging dev to main. So just add some messages or description whatever like
messages or description whatever like added some console message
added some console message and here I'm going to do a create pull
and here I'm going to do a create pull request
right and here it will show if there is any conflict any merge conflict or
any conflict any merge conflict or anything right
anything right and then what you can do simply you're
and then what you can do simply you're going to merge this poll request right
going to merge this poll request right so you should have some review and
so you should have some review and everything that you can configure but
everything that you can configure but this is only If you're working on any
this is only If you're working on any with any team or let's say you are
with any team or let's say you are working with with any open source you
working with with any open source you are working as a open source contributor
are working as a open source contributor so that time you will be having some re
so that time you will be having some re so will just nothing like they will just
so will just nothing like they will just approve your pull request and then you
approve your pull request and then you can just do merge. So you can just merge
can just do merge. So you can just merge this and then let's say do confirm
this and then let's say do confirm merge.
merge. So this is already now merged right and
So this is already now merged right and if you go here now you can go here what
if you go here now you can go here what will happen right? So you can go to your
will happen right? So you can go to your master branch sorry main branch. So I'll
master branch sorry main branch. So I'll go here right. So we have changed to and
go here right. So we have changed to and if you notice one thing here that you
if you notice one thing here that you don't have that changes why because this
don't have that changes why because this local is now not synced with your
local is now not synced with your updated code. To do that what you can do
updated code. To do that what you can do right is simply do get pull. Right. Let
right is simply do get pull. Right. Let me just clear this first and I'll do get
me just clear this first and I'll do get branch. So I mean the main branch you
branch. So I mean the main branch you can see and then I'll do get pull.
See now we have G changed again too. So you got the updated. So what you should
you got the updated. So what you should do right this is a very good practice.
do right this is a very good practice. You should always pull your latest
You should always pull your latest changes. Let's say you are working in a
changes. Let's say you are working in a team you have five team members someone
team you have five team members someone made some changes. So you need to get
made some changes. So you need to get those changes in your local right? So
those changes in your local right? So you need to pull the changes. So you
you need to pull the changes. So you need to do get pulls.
need to do get pulls. So that means I think we have covered
So that means I think we have covered most of the things that you need to know
most of the things that you need to know right. So for example if you if I go
right. So for example if you if I go here so we have covered all this right.
here so we have covered all this right. So get any g add commit how to create a
So get any g add commit how to create a branch rename a branch add a origin
branch rename a branch add a origin verify the origin p the changes create a
verify the origin p the changes create a new branch switch to a new branch merge
new branch switch to a new branch merge one branch with another branch how you
one branch with another branch how you can create a pull request
can create a pull request how you can merge the changes and those
how you can merge the changes and those kind of things for now I think this will
kind of things for now I think this will be more than enough so now what you
be more than enough so now what you should do right I will give you a very
should do right I will give you a very very good homework that is So I'm
very good homework that is So I'm thinking that you are already following
thinking that you are already following all of these right along with this
all of these right along with this video. But what you should do right once
video. But what you should do right once the video you have already completed.
the video you have already completed. I'm talking about not the G and GitHub
I'm talking about not the G and GitHub section. Uh I'm talking about the
section. Uh I'm talking about the complete video. Once you completed right
complete video. Once you completed right try to create any project on any
try to create any project on any technology doesn't matter whether it has
technology doesn't matter whether it has to be react or uh node or like whatever
to be react or uh node or like whatever any project like HTML CSS JavaScript
any project like HTML CSS JavaScript Java or whatever try to apply all the
Java or whatever try to apply all the commands in that project not this one
commands in that project not this one because this one you have already have
because this one you have already have actually done I'm assuming while
actually done I'm assuming while watching the video that way you will be
watching the video that way you will be able to practice all of this and it will
able to practice all of this and it will be easier I always mention these kind of
be easier I always mention these kind of things in every video whoever watches my
things in every video whoever watches my video they actually know these things
video they actually know these things right I never told that don't follow
right I never told that don't follow exactly what I am doing right you need
exactly what I am doing right you need to always apply your own idea and try to
to always apply your own idea and try to apply or add some more things that then
apply or add some more things that then I am actually doing in the video so when
I am actually doing in the video so when you you try to explore by yourself right
you you try to explore by yourself right it will be easy I'll not say like you
it will be easy I'll not say like you directly take help from chat GPD but you
directly take help from chat GPD but you make use of AI tools right not direct
make use of AI tools right not direct answer but if you are stuck someplace so
answer but if you are stuck someplace so try to get the answer and then try to
try to get the answer and then try to implement Right? So what you can do
implement Right? So what you can do right again I'll repeat sum up all the
right again I'll repeat sum up all the things that you have learned. Right? So
things that you have learned. Right? So sum all sum up all the things. See we
sum all sum up all the things. See we have learned quite a few things right
have learned quite a few things right here. Notice lot of things you have
here. Notice lot of things you have added. So and then add all these uh
added. So and then add all these uh commands in a notebook or let's say you
commands in a notebook or let's say you have some online tool just keep all of
have some online tool just keep all of these and also add the definition. For
these and also add the definition. For example what why this G in it is needed?
example what why this G in it is needed? What is the use of this G add? What is
What is the use of this G add? What is the use of G commit? Once you complete
the use of G commit? Once you complete all of these move to the next one. So
all of these move to the next one. So now I think with this this part is
now I think with this this part is completed. Now let's move on to the next
completed. Now let's move on to the next section.
section. All right. So now moving to the another
All right. So now moving to the another very very important section. I've
very very important section. I've noticed that almost no one actually
noticed that almost no one actually covered in the YouTube videos whatever
covered in the YouTube videos whatever videos I've noticed that this concept
videos I've noticed that this concept which is very important that is
which is very important that is environment management. Okay. Now these
environment management. Okay. Now these all things whenever you will be working
all things whenever you will be working on any very big companies right you'll
on any very big companies right you'll notice that they will take these things
notice that they will take these things very very seriously right so what do you
very very seriously right so what do you mean by environment management see
mean by environment management see environment management if I talk about
environment management if I talk about the definition it's like how you're
the definition it's like how you're going to configure and manage different
going to configure and manage different runtime environments so it can be your
runtime environments so it can be your dev environment stage environment
dev environment stage environment production environment right and the
production environment right and the main idea is to so that your code runs
main idea is to so that your code runs correctly safely because whenever you'll
correctly safely because whenever you'll be working on any client facing projects
be working on any client facing projects that can be possibility that you are
that can be possibility that you are using some client uh not client like
using some client uh not client like some very very highly secure credentials
some very very highly secure credentials and everything and you don't want to
and everything and you don't want to push all those changes in GitHub. I'm
push all those changes in GitHub. I'm going to show you one very important
going to show you one very important thing that I have done intentionally. If
thing that I have done intentionally. If you go to my server side code and go to
you go to my server side code and go to the server.js, you notice that I
the server.js, you notice that I actually push this URL which I can
actually push this URL which I can share with all of you because this is
share with all of you because this is nothing there. Like I'm going to also
nothing there. Like I'm going to also change this one later after the video is
change this one later after the video is done. The moment I actually push these
done. The moment I actually push these changes, right? See what happened. I
changes, right? See what happened. I actually got an email from GitHub that
actually got an email from GitHub that you maybe by mistake you push some uh
you maybe by mistake you push some uh secure credentials directly to GitHub.
secure credentials directly to GitHub. So you should not do that, right? So
So you should not do that, right? So this is what I'm talking about. So these
this is what I'm talking about. So these things we need to actually manage
things we need to actually manage somehow that it will not be exposed to
somehow that it will not be exposed to the outside world like that. Now let's
the outside world like that. Now let's go back. So what are the things can be
go back. So what are the things can be uh man like considered as uh environment
uh man like considered as uh environment management variables and everything
management variables and everything right? So these can be couple of things.
right? So these can be couple of things. The first one let me just take one uh
The first one let me just take one uh zip here. Okay.
zip here. Okay. So this can be something like
it can be port. Let's say you're using some port. Uh let me just increase this
some port. Uh let me just increase this one.
one. It can be port, it can be DB URL. Just
It can be port, it can be DB URL. Just now I have showed you. It can be some
now I have showed you. It can be some VPS related configuration, right? Some
VPS related configuration, right? Some credentials.
credentials. Let's say you're using some Google O. So
Let's say you're using some Google O. So O credentials. I'm just giving example,
O credentials. I'm just giving example, right? Let's say you're using some URL
right? Let's say you're using some URL uh some URLs. It can be any URLs, right?
uh some URLs. It can be any URLs, right? Then there can be some quotes related
Then there can be some quotes related configuration and lot of other things.
configuration and lot of other things. Lot of other things.
Lot of other things. So these things can be considered as
So these things can be considered as your environment uh configuration system
your environment uh configuration system configuration like whatever you need to
configuration like whatever you need to run that particular application. Now
run that particular application. Now there can be multiple types of
there can be multiple types of environment right. So let me just give
environment right. So let me just give you one example. So let's say you have a
you one example. So let's say you have a dev environment. So this is your dev.
dev environment. So this is your dev. Then you have a pre-production
Then you have a pre-production environment which is called stage. Now
environment which is called stage. Now this one right every company says or
this one right every company says or like manage different different way some
like manage different different way some companies also has another stage before
companies also has another stage before that believe me it is true like they
that believe me it is true like they will let's say there are some banking
will let's say there are some banking projects or something they're very very
projects or something they're very very secure like there can be customer data
secure like there can be customer data involved so they are not going to push
involved so they are not going to push the changes directly to stage and then
the changes directly to stage and then you'll be having pro definitely so they
you'll be having pro definitely so they will actually not do that so what I'll
will actually not do that so what I'll do right there will be some pre-stage
do right there will be some pre-stage environment so they're going to first
environment so they're going to first push the changes test there from pre to
push the changes test there from pre to it will go to stage again they will test
it will go to stage again they will test and then only they're going to push the
and then only they're going to push the changes to prod right so this is the dev
changes to prod right so this is the dev environment so dev as the name suggest
environment so dev as the name suggest this is used for your development so
this is used for your development so this is can be unstable right
this is can be unstable right here you're going to use some fake data
here you're going to use some fake data also which is fine so you can use fake
also which is fine so you can use fake data
here uh this is going to the stage so this is has to be stable able
this is has to be stable able right this has to be stable there has to
right this has to be stable there has to be realistic data so I'll do realistic
be realistic data so I'll do realistic data right and here the security very
data right and here the security very very important security should be equal
very important security should be equal to prod so whatever security you are
to prod so whatever security you are having then only you'll be able to
having then only you'll be able to replicate if something going wrong in
replicate if something going wrong in this prod or not because you if your
this prod or not because you if your stage is not replicating the prod
stage is not replicating the prod behavior it is very very difficult to
behavior it is very very difficult to understand that whether something is
understand that whether something is going wrong or not. I hope you're
going wrong or not. I hope you're getting right. And also there can be
getting right. And also there can be there should be CI/CD pipelines in this
there should be CI/CD pipelines in this also but we are going to discuss that
also but we are going to discuss that one later. And at the end you're going
one later. And at the end you're going to have the product, right? So this will
to have the product, right? So this will be highly stable. Right? I'm just giving
be highly stable. Right? I'm just giving the shortcuts. There should not be no
the shortcuts. There should not be no debug logs. No debug logs. No logs.
debug logs. No debug logs. No logs. This is very important. If you notice,
This is very important. If you notice, right, we're adding console logs and
right, we're adding console logs and everything. Those should not have any
everything. Those should not have any logs here. This should have full
logs here. This should have full security.
security. And this should have real user data.
And this should have real user data. Real user data in sort. Okay. So for now
Real user data in sort. Okay. So for now we have a dev development environment
we have a dev development environment stage and prod right.
stage and prod right. So now how we are going to manage and
So now how we are going to manage and here also again I already mentioned
here also again I already mentioned right that why we need multiple
right that why we need multiple environments. I think this we have
environments. I think this we have already done for your testing CI/CD
already done for your testing CI/CD workflows to handle multiple secrets or
workflows to handle multiple secrets or to test different behavior and those
to test different behavior and those kind of things. But how we are going to
kind of things. But how we are going to manage all of these? Now here we need to
manage all of these? Now here we need to understand some of the flows. So let me
understand some of the flows. So let me just take one more here. So I'm going to
just take one more here. So I'm going to take this maybe let's take a different
take this maybe let's take a different one now. So I'm going to take this one.
one now. So I'm going to take this one. So let's let's say this is my GitHub.
Okay. And then I am going to have my dev
And then I am going to have my dev environment here. Got it? So let's say
environment here. Got it? So let's say this is my dev environment. And this dev
this is my dev environment. And this dev environment normally run on localhost
environment normally run on localhost 3000. And here I'm going to use
3000. And here I'm going to use so let me just give one more here. So
so let me just give one more here. So I'm going to use dot env
I'm going to use dot env dotdev.
dotdev. Okay. So I'm just giving example like
Okay. So I'm just giving example like how these these things are these things
how these these things are these things usually work. So you have a env
usually work. So you have a env specially for your dev environment.
specially for your dev environment. Okay. Then
Okay. Then you have your stage or let's do staging.
you have your stage or let's do staging. Staging will have another one. So let's
Staging will have another one. So let's say here I'll give so let's say your
say here I'll give so let's say your website URL is something like maybe what
website URL is something like maybe what I'll do let's do here. So I'll do www.
So this is your pro URL. So what will happen in stage? You can't use the same
happen in stage? You can't use the same URL, right? So you have to use something
URL, right? So you have to use something like let's say you have a stage URL. So
like let's say you have a stage URL. So where you will do all the testing. into
where you will do all the testing. into ww
y z dot com. So this is your div url. Got it? So for
So this is your div url. Got it? So for this dev URL maybe you are managing
this dev URL maybe you are managing another
another environment here. So I'll do env
environment here. So I'll do env dotstaging
dotstaging and then at the end I'm going to add one
and then at the end I'm going to add one more and this is your main production.
more and this is your main production. So this is we'll have
So this is we'll have another one and this will be your main
another one and this will be your main website. So now here we we are going to
website. So now here we we are going to have envirrod
have envirrod right and this will have the www
xy z.
So this is this structure is actually followed by very very highly secure not
followed by very very highly secure not highly secure like any kind of
highly secure like any kind of userfacing or product application if you
userfacing or product application if you go to any companies they follow this
go to any companies they follow this kind of structure. I've worked in some
kind of structure. I've worked in some projects they use some very more secure
projects they use some very more secure way like they don't have only stage they
way like they don't have only stage they have multiple uh pre-production
have multiple uh pre-production environment I'm talking about
environment I'm talking about pre-production okay so do the
pre-production okay so do the development you deploy in multiple uh uh
development you deploy in multiple uh uh stage environment and then only you are
stage environment and then only you are going to push the changes to product
going to push the changes to product okay so this is the overall architecture
okay so this is the overall architecture not is architecture but the overall
not is architecture but the overall workflow that how we are going to how
workflow that how we are going to how you can actually manage environment
you can actually manage environment management and environment related
management and environment related variables or management in your
variables or management in your application. So now for our application
application. So now for our application what we are going to do right. So
what we are going to do right. So normally what we will follow the
normally what we will follow the structure. So we're going to follow this
structure. So we're going to follow this structure. So we have dot and then we
structure. So we have dot and then we have e
have e dot e n v. So this is for default right?
dot e n v. So this is for default right? This is for default. This actually use
This is for default. This actually use for local or development. The same
for local or development. The same structure we are going to use. And then
structure we are going to use. And then you can also if you want to experiment
you can also if you want to experiment you can also create one envied
for your development. You can also do that if you want. Then you can also do
that if you want. Then you can also do dot we are going to do one more which
dot we are going to do one more which will be envo.
So this will be my products and configuration. So for now we are going
configuration. So for now we are going to use these two. So we going to use a
to use these two. So we going to use a env by default for development and then
env by default for development and then we going to use a env.rod product which
we going to use a env.rod product which is for production. Then you can also add
is for production. Then you can also add one more which is called dot inv.ample.
one more which is called dot inv.ample. So example is nothing but so example is
So example is nothing but so example is if you want to have some template where
if you want to have some template where you don't want to add any secrets so
you don't want to add any secrets so that your other team members can get
that your other team members can get some example or idea that what kind of
some example or idea that what kind of environment variables we are using but
environment variables we are using but for now we we can ignore this. So you
for now we we can ignore this. So you follow these two structure. So you're
follow these two structure. So you're going to have one for ENV which we are
going to have one for ENV which we are used for local development and one for
used for local development and one for production. Okay. Now very very
production. Okay. Now very very important concept. One more I'll say
important concept. One more I'll say like these things are very important.
like these things are very important. I'm going to write it like this. And
I'm going to write it like this. And here
here I'll do don't ever
I'll do don't ever don't commit
don't commit secrets to GitHub. Right? very very
secrets to GitHub. Right? very very important because you can't just push
important because you can't just push all this configuration into GitHub right
all this configuration into GitHub right because GitHub lets you if your repo is
because GitHub lets you if your repo is public anyone can come and access this
public anyone can come and access this right for example take example this one
right for example take example this one right now all of you can see this and
right now all of you can see this and you can just push data or do some and
you can just push data or do some and not I'm sure you'll not do but there are
not I'm sure you'll not do but there are some people they can push any data or do
some people they can push any data or do some bad things in the curl correct
some bad things in the curl correct right so you should not do this so if
right so you should not do this so if you don't want to do this can you guess
you don't want to do this can you guess what What we need to do means we have
what What we need to do means we have learned in the previous section we need
learned in the previous section we need to add this envir
so we need to add in g ignore remember we have learned the g ignore so we need
we have learned the g ignore so we need to add all this in our g ignore file
to add all this in our g ignore file okay so now let's go here first and then
okay so now let's go here first and then here I'm going to create now always you
here I'm going to create now always you need to create the root root level okay
need to create the root root level okay so I'm going to create a dot
so I'm going to create a dot env V fine
env V fine so you need to add this
so you need to add this here same thing we are going to have in
here same thing we are going to have in our client side so I'm going to add one
our client side so I'm going to add one more and this will be env here now first
more and this will be env here now first let's start with the server side right
let's start with the server side right so here what we need to do we need to
so here what we need to do we need to decide that okay now as a developer your
decide that okay now as a developer your responsibility is that you have that
responsibility is that you have that understanding that okay what kind of
understanding that okay what kind of things I need to add in this env file
things I need to add in this env file right you can't add each and everything
right you can't add each and everything Here you only need to see that if I'm
Here you only need to see that if I'm using any credentials or not that only I
using any credentials or not that only I can add here. For example, if I go to my
can add here. For example, if I go to my server.js, you can see that I'm using
server.js, you can see that I'm using this port here which is 5,000. So now
this port here which is 5,000. So now there can be possibility that okay, I
there can be possibility that okay, I have some different requirement that I
have some different requirement that I need to change this port. But if my port
need to change this port. But if my port is hardcoded in the code, what I need to
is hardcoded in the code, what I need to do? I need to come here and change every
do? I need to come here and change every time, right? I don't want to do that.
time, right? I don't want to do that. That means I can simply remove port from
That means I can simply remove port from here the hardcoded value and I can put
here the hardcoded value and I can put it in my NV file. So I'll paste here
it in my NV file. So I'll paste here port and I'll give 5,000. Second, I have
port and I'll give 5,000. Second, I have my MongoDB model. If you noticed, this
my MongoDB model. If you noticed, this is my MongoDB model. Again, I don't want
is my MongoDB model. Again, I don't want to post this in my GitHub. So I need to
to post this in my GitHub. So I need to keep keep this one in my ENV file,
keep keep this one in my ENV file, right? So I'm going to copy this
right? So I'm going to copy this or cut it from here and I'll do
or cut it from here and I'll do uri and I'll just paste it here. Save
uri and I'll just paste it here. Save this. Now I need to use this in my code.
this. Now I need to use this in my code. Right now different different
Right now different different technologies has different ways of
technologies has different ways of writing. So here what we'll do in node.
writing. So here what we'll do in node. So simply do process dot env dot the
So simply do process dot env dot the name of the env variable. So here I'll
name of the env variable. So here I'll simply just do
uh let's keep it like this. So you do process
process dot env dot port or it will be 5,000
dot env dot port or it will be 5,000 because this is what we are using.
because this is what we are using. Similarly copy this
Similarly copy this and I'm also going to remove this. I'll
and I'm also going to remove this. I'll do process
do process dot env dot url. Okay. So now I'm
dot env dot url. Okay. So now I'm using this enviable here. That means
using this enviable here. That means these uh are not actually
these uh are not actually exposed directly in my GitHub. And if
exposed directly in my GitHub. And if you go to my server side code, you'll
you go to my server side code, you'll see that you it will still will work. So
see that you it will still will work. So it's still working, right? So let's say
it's still working, right? So let's say if I save here
and you can see that it's already running. If I change this one 5,000 to
running. If I change this one 5,000 to something else, it will change
something else, it will change automatically. So now what I need to do,
automatically. So now what I need to do, I need to add this ENV file in my G
I need to add this ENV file in my G ignore. So I'll go here and I'll do env.
ignore. So I'll go here and I'll do env. And now this envy notice. So this is
And now this envy notice. So this is also added to glo. So now I don't I
also added to glo. So now I don't I don't want to push this in my GitHub.
don't want to push this in my GitHub. Right? And it will automatically work.
Right? And it will automatically work. So these changes will not be added. All
So these changes will not be added. All right. So now what we going to do? We
right. So now what we going to do? We going to create the same env file inside
going to create the same env file inside client folder also. Right? So in the
client folder also. Right? So in the root level I'll be creating env. Now
root level I'll be creating env. Now because uh we are using react with vit.
because uh we are using react with vit. So there are some uh like rules that we
So there are some uh like rules that we need to follow and that is whenever we
need to follow and that is whenever we are going to create an env file inside
are going to create an env file inside vit we need to start with prefix vit and
vit we need to start with prefix vit and then I'm going to give this one maybe
then I'm going to give this one maybe let's say v api url something like that
let's say v api url something like that right now if you notice that if I go to
right now if you notice that if I go to the source and then inside app dot jsx
the source and then inside app dot jsx so here you can see that we are using
so here you can see that we are using this service now I can one more thing
this service now I can one more thing because we are using v so we need to
because we are using v so we need to write in this way if you're using
write in this way if you're using something else the way of writing will
something else the way of writing will automatically change. I hope you're
automatically change. I hope you're getting right. So you don't have to
getting right. So you don't have to follow the exact same thing. Now here
follow the exact same thing. Now here what I'm going to do. So let's say if I
what I'm going to do. So let's say if I go to the service file and you can see
go to the service file and you can see that we are using this API based CL
that we are using this API based CL which is this one. So I'm going to now
which is this one. So I'm going to now copy this
copy this and then I just paste it here. These all
and then I just paste it here. These all are very simple uh concepts and I'm
are very simple uh concepts and I'm pretty sure some of you already know all
pretty sure some of you already know all of these. Still it's always better to do
of these. Still it's always better to do one more time like there is nothing
one more time like there is nothing wrong with it. So here to get this
wrong with it. So here to get this usually what we do like process
usually what we do like process envariable
envariable name but here what we need to do we need
name but here what we need to do we need to use import dot meta dot env and then
to use import dot meta dot env and then we need to use the name of the env
we need to use the name of the env variable that you have given and that is
variable that you have given and that is here dot vit API URL and if I save this
here dot vit API URL and if I save this you can see that this will be getting
you can see that this will be getting refreshed and even if I refresh this
refreshed and even if I refresh this you'll be getting the same result. So
you'll be getting the same result. So let's see if I add some
let's see if I add some task here
task here and create this we are getting the
and create this we are getting the result back. Now with this we have
result back. Now with this we have actually uh like covered the basic
actually uh like covered the basic environment management. How we are going
environment management. How we are going to do that? I'll be creating the env
to do that? I'll be creating the env files. You should never use the any
files. You should never use the any credential related changes to your uh
credential related changes to your uh GitHub repo that I have already
GitHub repo that I have already discussed. So now we will be moving to
discussed. So now we will be moving to our next section which is very very
our next section which is very very important and that is docker. So let's
important and that is docker. So let's get started with the next one. All
get started with the next one. All right. So now we will uh we'll be
right. So now we will uh we'll be starting with docker. Now before we will
starting with docker. Now before we will move into any practical uh like
move into any practical uh like implementation we need to understand
implementation we need to understand quite a few concepts right that what is
quite a few concepts right that what is actually docker and why actually we need
actually docker and why actually we need docker. So now from this particular
docker. So now from this particular section we will be doing all the
section we will be doing all the concepts and practical implementation
concepts and practical implementation little slope. Okay. So now let's see
little slope. Okay. So now let's see what is a docker right. So if I try to
what is a docker right. So if I try to explain this one very simply. So docker
explain this one very simply. So docker is a tool. Okay. So what this tool
is a tool. Okay. So what this tool actually does. So it's like a complete
actually does. So it's like a complete package. You think in that way. So it's
package. You think in that way. So it's a tool that lets you package an
a tool that lets you package an application with everything whatever
application with everything whatever that particular application needs. Okay.
that particular application needs. Okay. So here it can be see normally whenever
So here it can be see normally whenever you will be creating an application what
you will be creating an application what your application usually needs? Your
your application usually needs? Your application needs some packages, some
application needs some packages, some libraries. Your application will be
libraries. Your application will be having some code and it will have some
having some code and it will have some runtime or buildtime related features.
runtime or buildtime related features. Right? So, Docker actually give you all
Right? So, Docker actually give you all the things inside one single place.
the things inside one single place. Think like that. Okay? Now, what we
Think like that. Okay? Now, what we actually call that? We actually call
actually call that? We actually call that a lightweight container. That
that a lightweight container. That container can run anywhere. So, now if I
container can run anywhere. So, now if I try to sum up very simply, so let's do
try to sum up very simply, so let's do one thing. Let's take one save here and
one thing. Let's take one save here and here I'm going to explain this one like
here I'm going to explain this one like as I told you right that we need to
as I told you right that we need to cover quite a few concepts also because
cover quite a few concepts also because this complete video is not like that we
this complete video is not like that we have to practically implement but you
have to practically implement but you should also know the concepts so if I
should also know the concepts so if I try to let's increase this one okay
try to let's increase this one okay just increase this here
just increase this here so I'll give this one very simply that
so I'll give this one very simply that docker is a tool Okay. Now I'm just
docker is a tool Okay. Now I'm just giving in short because if I write
giving in short because if I write everything it will take lot of time. You
everything it will take lot of time. You can listen what I'm saying and you can
can listen what I'm saying and you can then go to the official documentation.
then go to the official documentation. Again if you have any doubt then you go
Again if you have any doubt then you go to any chart video or any AI tools if
to any chart video or any AI tools if you want to learn more in depth. Right?
you want to learn more in depth. Right? I always recommend learning from AI
I always recommend learning from AI tools. But the first priority will be
tools. But the first priority will be you should always go to the official
you should always go to the official documentation. It's very very important
documentation. It's very very important to learn from that. So docker is a tool
to learn from that. So docker is a tool that what it actually does it lets you
that what it actually does it lets you package right so it lets you package an
package right so it lets you package an application
application and that application actually whatever
and that application actually whatever this needs so what this application does
this needs so what this application does so this can be your application normally
so this can be your application normally has a code it will uh it will be having
has a code it will uh it will be having all the libraries
all the libraries right and also it can be runtime or some
right and also it can be runtime or some other features right and what it
other features right and what it happened so it's like a container right
happened so it's like a container right and that can run anywhere so this will
and that can run anywhere so this will be the simplest definition of docker
be the simplest definition of docker okay now let's understand some of the
okay now let's understand some of the problems that we usually had before
problems that we usually had before docker right so I'm going to just copy
docker right so I'm going to just copy this
this and we'll write here right so let's do
and we'll write here right so let's do step by step so first one let's say you
step by step so first one let's say you have created application, right? And
have created application, right? And that application works in your machine,
that application works in your machine, right? But this app, whatever you have
right? But this app, whatever you have created, this is working locally, but it
created, this is working locally, but it actually failing on prod. Okay. Now why?
actually failing on prod. Okay. Now why? because there can be lot of reason that
because there can be lot of reason that for example let's say you have different
for example let's say you have different NodeJS versions something like that or
NodeJS versions something like that or maybe let's say you have missed some
maybe let's say you have missed some libraries to install something like that
libraries to install something like that okay or let's say there are some OS
okay or let's say there are some OS mismatch it can be anything
mismatch it can be anything okay so all these problems docker
okay so all these problems docker actually solves how so here what will
actually solves how so here what will happen right you will be having a
happen right you will be having a standardized environments that means so
standardized environments that means so docker Normally what uh have right so it
docker Normally what uh have right so it has images that we are going to discuss
has images that we are going to discuss what is actually docker images step by
what is actually docker images step by step so what happened that standardize
step so what happened that standardize means same image runs the same way and
means same image runs the same way and it will run same everywhere or anywhere
it will run same everywhere or anywhere okay simplifying deployments simplifying
okay simplifying deployments simplifying deployment means you don't have to
deployment means you don't have to configure the system again and again
configure the system again and again okay so these two I will say one of the
okay so these two I will say one of the most important advantage of using docker
most important advantage of using docker that actually solves all these problems.
that actually solves all these problems. Okay. So now let's understand some of
Okay. So now let's understand some of the very very basic architecture of I I
the very very basic architecture of I I will say like overall architecture of
will say like overall architecture of Docker and then what we are going to do
Docker and then what we are going to do we will be installing Docker desktop. Uh
we will be installing Docker desktop. Uh so first let's do one thing. I'm going
so first let's do one thing. I'm going to just take some maybe circle here.
to just take some maybe circle here. So let's consider this one as let's say
So let's consider this one as let's say you have your app here. Okay. So this is
you have your app here. Okay. So this is my app.
So this is my app and here this app can be on anything. Let's say we are
be on anything. Let's say we are creating m so it is on node react and
creating m so it is on node react and and then what is happening? So
and then what is happening? So here I will be having my docker image
here I will be having my docker image layer. Okay
layer. Okay this docker image layer it actually
this docker image layer it actually talks to docker engine.
talks to docker engine. Okay. And this docker engine runs on
Okay. And this docker engine runs on your host
your host OS. Okay. So that means if I try to sum
OS. Okay. So that means if I try to sum up this one very simply. So I'll just
up this one very simply. So I'll just write it here
write it here that
that docker. Okay let's make this one little
docker. Okay let's make this one little big. So I'm going to do this one as
big. So I'm going to do this one as docker engine runs on the host OS. Okay.
docker engine runs on the host OS. Okay. And this actually manages all the
And this actually manages all the containers,
containers, right? What happens? The app that you
right? What happens? The app that you are running inside docker that app so
are running inside docker that app so that means your app lives
that means your app lives in that particular container that you
in that particular container that you created or maybe in a container. Okay,
created or maybe in a container. Okay, this is actually the main advantage is
this is actually the main advantage is this is isolated from the host. very
this is isolated from the host. very very important because here if you
very important because here if you notice that your docker engine this
notice that your docker engine this engine actually running on the host and
engine actually running on the host and your app is running inside the
your app is running inside the container. So that means there is no
container. So that means there is no connection between your app and your
connection between your app and your host. So that app lives inside the
host. So that app lives inside the container which is completely isolated
container which is completely isolated from the host. And another very very big
from the host. And another very very big advantage is that you can run multiple
advantage is that you can run multiple containers side by side. Right? So this
containers side by side. Right? So this is the overall picture of how actually
is the overall picture of how actually docker flow works very very overall or I
docker flow works very very overall or I will say very overview of docker
will say very overview of docker architecture or flow. So now what we are
architecture or flow. So now what we are going to do right we will be now
going to do right we will be now installing docker and we'll understand
installing docker and we'll understand some of the very basic concepts and some
some of the very basic concepts and some of the basic demos. Now you notice that
of the basic demos. Now you notice that I'm actually using windows. Now here I
I'm actually using windows. Now here I want to mention one very important point
want to mention one very important point that I will be using docker desktop. So
that I will be using docker desktop. So I already had this one installed because
I already had this one installed because I definitely had a lot of projects
I definitely had a lot of projects created. But because this video I'm
created. But because this video I'm particularly creating for complete
particularly creating for complete beginners. If you notice and if you have
beginners. If you notice and if you have watched my previous videos also you'll
watched my previous videos also you'll see that I usually go little fast but
see that I usually go little fast but for this particular video I'm doing very
for this particular video I'm doing very very slow. you can understand the way
very slow. you can understand the way I'm actually delivering the uh like
I'm actually delivering the uh like concepts and everything right the reason
concepts and everything right the reason is because I think when we are covering
is because I think when we are covering DevOps DevOps is one of the concepts
DevOps DevOps is one of the concepts that you if you're complete beginner you
that you if you're complete beginner you should definitely need some time to
should definitely need some time to understand all the concepts or else it
understand all the concepts or else it will be very very complicated because
will be very very complicated because it's very fast a very vast right it's
it's very fast a very vast right it's not like you can complete all concepts
not like you can complete all concepts of DevOps within one month right you
of DevOps within one month right you need to understand all these you need to
need to understand all these you need to create practical projects industry level
create practical projects industry level project then only you'll be able to
project then only you'll be able to understand all the concepts and how all
understand all the concepts and how all these docker flows sorry devops flows
these docker flows sorry devops flows working together. So now as I already
working together. So now as I already mentioned because I'm using windows so I
mentioned because I'm using windows so I will be using docker desktop. So now in
will be using docker desktop. So now in the next part let's see how we are going
the next part let's see how we are going to install it and then we'll be seeing
to install it and then we'll be seeing some of the live de. All right. So let's
some of the live de. All right. So let's download docker desktop. So I am using
download docker desktop. So I am using windows. So what I'll do right so here
windows. So what I'll do right so here let's do this one maybe 64. I'm going to
let's do this one maybe 64. I'm going to click here.
click here. So it will take some time. So what I'll
So it will take some time. So what I'll do right I'll wait or pause this video
do right I'll wait or pause this video once this is done then we are going to
once this is done then we are going to install this
all right you know so you can see that I just downloaded and just simply
just downloaded and just simply installed you don't have to do anything
installed you don't have to do anything else and once you open this you are
else and once you open this you are going to see all these options for now
going to see all these options for now for this particular part just focus on
for this particular part just focus on images and container you can see that we
images and container you can see that we don't have any running containers first
don't have any running containers first of all and we don't have any images that
of all and we don't have any images that we have created here the first thing
we have created here the first thing what we going to do right we will be
what we going to do right we will be running our first or creating our first
running our first or creating our first image image and that image we are going
image image and that image we are going to run inside a container and then I'm
to run inside a container and then I'm going to explain some of the terms uh
going to explain some of the terms uh which is actually very very important to
which is actually very very important to understand whenever you are going to
understand whenever you are going to apply those concepts practically in any
apply those concepts practically in any project. So if you go to uh this website
project. So if you go to uh this website which is called docker hub. So here
which is called docker hub. So here you're going to get all the official
you're going to get all the official images. You can see that if I go here
images. You can see that if I go here right uh official images there will be
right uh official images there will be lot of images that are available. Okay.
lot of images that are available. Okay. So here what I'm going to do simply from
So here what I'm going to do simply from I'm going to you can see that I already
I'm going to you can see that I already search hello world. So we're going to
search hello world. So we're going to start with hello world. Now here I'm
start with hello world. Now here I'm going to create this or run this image.
going to create this or run this image. So what we need to do right to create
So what we need to do right to create this image we are going to simply run
this image we are going to simply run docker run and the name of the image
docker run and the name of the image that we want to run which is hello
that we want to run which is hello world. So what we'll do right simply I'm
world. So what we'll do right simply I'm going to open my command prompt and
going to open my command prompt and before running that let's quickly
before running that let's quickly understand the basic flow that what
understand the basic flow that what happen whenever we are going to run
happen whenever we are going to run docker run and the name of the image
docker run and the name of the image okay it can be any image. So for example
okay it can be any image. So for example for now just consider this hello world.
for now just consider this hello world. So here what usually happen right now
So here what usually happen right now see these flows if you're thinking is
see these flows if you're thinking is not important you are very very wrong.
not important you are very very wrong. You need to understand all this flow
You need to understand all this flow very very clearly. So now I'm going to
very very clearly. So now I'm going to just simply create one. Let's create
just simply create one. Let's create this one and let's skip it here. So what
this one and let's skip it here. So what happened right? So let's say we have
happened right? So let's say we have whenever we are going to run this docker
whenever we are going to run this docker run command. So here we need to first we
run command. So here we need to first we have our docker client. So I'm going to
have our docker client. So I'm going to just simply take here docker client.
Okay. And let's increase this font a little
And let's increase this font a little bit. So we have a docker client. I'm
bit. So we have a docker client. I'm going to simply copy and paste this.
going to simply copy and paste this. This docker client. What happened?
This docker client. What happened? Whenever you're going to run uh that
Whenever you're going to run uh that command, it will contact docker demon.
command, it will contact docker demon. what actually this demon does it demon
what actually this demon does it demon is actually manages all the images and
is actually manages all the images and the container that I'm going to again
the container that I'm going to again discuss little later so for now just
discuss little later so for now just considered or remember this term which
considered or remember this term which is called I don't know how to pronounce
is called I don't know how to pronounce this maybe demon okay so these contacts
this maybe demon okay so these contacts not here these contacts here okay
not here these contacts here okay this docker demon this is going to
this docker demon this is going to create a new container. Okay, very very
create a new container. Okay, very very very important. This docker demon is
very important. This docker demon is going to create as already mentioned it.
going to create as already mentioned it. This is the one which manages the images
This is the one which manages the images and the container. So this is going to
and the container. So this is going to create a new container from that
create a new container from that particular image which is in this case
particular image which is in this case hello world that is going to run and
hello world that is going to run and it's actually going to produce a output
it's actually going to produce a output right and that output you're going to
right and that output you're going to see. So that we are going to uh notice
see. So that we are going to uh notice just now. So for now I I will show you
just now. So for now I I will show you that how that is happening. So this
that how that is happening. So this docker demon is going to create a new
docker demon is going to create a new container.
container. Okay. And in this container actually now
Okay. And in this container actually now this container will be created from that
this container will be created from that particular image which is important. So
particular image which is important. So from that image okay and this image is
from that image okay and this image is going to this image is going to run the
going to this image is going to run the executable that produce the output that
executable that produce the output that you're going to see in your terminal or
you're going to see in your terminal or wherever you are just running it. Okay.
wherever you are just running it. Okay. And then what happened right this docker
And then what happened right this docker demon is going to stream the output to
demon is going to stream the output to the docker client which you are going to
the docker client which you are going to see in your terminal. So for example
see in your terminal. So for example here it created the so let's create like
here it created the so let's create like this. So it's created the container
this. So it's created the container right now this is going to create
right now this is going to create output. So I'm going to just trying to
output. So I'm going to just trying to explain this one very simply. So this is
explain this one very simply. So this is going to create output. Then docker
going to create output. Then docker demon is again going to stream that
demon is again going to stream that output and it is going to pass to the
output and it is going to pass to the docker client and then what happen you
docker client and then what happen you are going to see this output in your
are going to see this output in your terminal. I hope now this is clear
terminal. I hope now this is clear right. So first you have docker client
right. So first you have docker client which will contact the docker demon
which will contact the docker demon which is going to create a new container
which is going to create a new container from that image. For example, let's say
from that image. For example, let's say it's a hello world in this case. This is
it's a hello world in this case. This is going to this is uh this image sorry
going to this is uh this image sorry this container that will be created from
this container that will be created from that particular image which runs the
that particular image which runs the executable that produce the output it
executable that produce the output it will pass to docker demon docker demon
will pass to docker demon docker demon is going to stream that output and again
is going to stream that output and again it will going to pass to the docker
it will going to pass to the docker client and then you're going to see that
client and then you're going to see that in your terminal I hope this is clear no
in your terminal I hope this is clear no one is going to explain you like this
one is going to explain you like this even in paid courses you will not see
even in paid courses you will not see this kind of explanation so what I'm
this kind of explanation so what I'm going to do right here first of all I
going to do right here first of all I need to understand whether the docker is
need to understand whether the docker is installed or So I'm going to just run
installed or So I'm going to just run this docker version. Now what I'll do
this docker version. Now what I'll do right I'm going to upload all this in my
right I'm going to upload all this in my website. So you can download all so for
website. So you can download all so for this particular DevOps video right all
this particular DevOps video right all the resources flows commands everything
the resources flows commands everything you're going to uh you will be getting
you're going to uh you will be getting all these in my website for free so you
all these in my website for free so you can just simply download. So I'm just
can just simply download. So I'm just going to enter you can see that it's
going to enter you can see that it's already installed. Now what I'm going to
already installed. Now what I'm going to do simply I'm going to do docker
do simply I'm going to do docker right. So I'll do run and see I'm going
right. So I'll do run and see I'm going to pass the image. So this is the image
to pass the image. So this is the image that I'm using the the same image you
that I'm using the the same image you need to use. So here now what will
need to use. So here now what will happen at first it is going to check and
happen at first it is going to check and you'll notice that it will not going to
you'll notice that it will not going to get any image locally. So it is going to
get any image locally. So it is going to contact. So now hit enter. See it's
contact. So now hit enter. See it's going to unable right unable to find the
going to unable right unable to find the image locally. Now it will pulling that
image locally. Now it will pulling that image from your library and then you'll
image from your library and then you'll simply simply getting this output. So
simply simply getting this output. So this is the output. downloaded newer
this is the output. downloaded newer image from hello world latest and this
image from hello world latest and this is the output that you are seeing right
is the output that you are seeing right I think this is also mentioned here the
I think this is also mentioned here the exact same thing I just explained and if
exact same thing I just explained and if you go here right so you can see that
you go here right so you can see that you have a hello world image that is
you have a hello world image that is created okay even if you go to container
created okay even if you go to container there is a container you notice there is
there is a container you notice there is a random name it's given so we're going
a random name it's given so we're going to explain that how all this working but
to explain that how all this working but this is the container this container is
this is the container this container is actually running this image and both
actually running this image and both this images and and the container which
this images and and the container which is maintained by the docker demon. So
is maintained by the docker demon. So now what I'm going to simply do before
now what I'm going to simply do before discussing or running another uh image
discussing or running another uh image which will be engineix that we are going
which will be engineix that we are going to see let's understand some of the more
to see let's understand some of the more terms that we have learned. So what is
terms that we have learned. So what is actually image right? These all can be
actually image right? These all can be very very important in any interview. So
very very important in any interview. So you can answer like image is like a
you can answer like image is like a blueprint. So where you are getting this
blueprint. So where you are getting this that particular image from the docker
that particular image from the docker hub just now I have showed you right all
hub just now I have showed you right all these images will be present here and
these images will be present here and this is like for example how you can see
this is like for example how you can see like it's kind of a zip file where you
like it's kind of a zip file where you have all the code and setup that is
have all the code and setup that is ready so you are just getting that code
ready so you are just getting that code sorry code and sorry yeah code and setup
sorry code and sorry yeah code and setup everything from that particular image
everything from that particular image and you are just getting the output in
and you are just getting the output in your terminal. So to sum up, image will
your terminal. So to sum up, image will be a blueprint from a docker hub. It's
be a blueprint from a docker hub. It's like a zip file of code and all the
like a zip file of code and all the setups and the configs. Container is the
setups and the configs. Container is the running instance that is created for
running instance that is created for that from that particular image. Just
that from that particular image. Just now I have showed you. And third will be
now I have showed you. And third will be docker engine which is actually the
docker engine which is actually the system or the demon that actually pulled
system or the demon that actually pulled the image. It will unpack the image and
the image. It will unpack the image and then it will ran it. It's going to
then it will ran it. It's going to stream that output and you're going to
stream that output and you're going to see the result in your terminal. So
see the result in your terminal. So three concepts you have understand right
three concepts you have understand right image container docker engine. So now
image container docker engine. So now let's do one thing. Let's create another
let's do one thing. Let's create another or run another image or we're going to
or run another image or we're going to create our first web server demo. So
create our first web server demo. So what I'll do right if you go here I
what I'll do right if you go here I already open this. So this is another
already open this. So this is another official build for engineix.
official build for engineix. So I'll go here and then I'll just going
So I'll go here and then I'll just going to clear this and or not clear here it
to clear this and or not clear here it will not work. So simply run it maybe.
will not work. So simply run it maybe. So let's do I'm going to explain each
So let's do I'm going to explain each and everything that what we are using.
and everything that what we are using. So I'm going to do docker. Notice
So I'm going to do docker. Notice carefully. Then I'm going to use run.
carefully. Then I'm going to use run. But here I'm going to use another
But here I'm going to use another command which is minus d. That I'm going
command which is minus d. That I'm going to explain what it is. Then I'm going to
to explain what it is. Then I'm going to do minus p and here I'm going to do 8080
do minus p and here I'm going to do 8080 col 8 and then I'm going to pass the
col 8 and then I'm going to pass the name of the image which is engineext.
name of the image which is engineext. Now let's understand what actually is.
Now let's understand what actually is. So docker run actually we already seen
So docker run actually we already seen minus d is called detach mode means this
minus d is called detach mode means this will runs in the background. What is
will runs in the background. What is minus p 80
minus p 80 very very important this part this port
very very important this part this port part. So this is actually telling that
part. So this is actually telling that okay I want to map the port 80 of
okay I want to map the port 80 of container. So right side is the
container. So right side is the container port left side is the host
container port left side is the host port. Host means my my uh windows laptop
port. Host means my my uh windows laptop that I'm using. This is my host right?
that I'm using. This is my host right? So I'm just trying to explain this one
So I'm just trying to explain this one very very simply. Okay. So this 8080 is
very very simply. Okay. So this 8080 is my host port. 80 is the container port.
my host port. 80 is the container port. Again I'm going to repeat many uh
Again I'm going to repeat many uh students get confused here. Right side
students get confused here. Right side this is the 80 is the port of the
this is the 80 is the port of the container. This is the port 8080 of
container. This is the port 8080 of host. Okay. And this is the image that
host. Okay. And this is the image that will be getting pulled from the docker.
will be getting pulled from the docker. So now I'm going to hit enter. Now you
So now I'm going to hit enter. Now you see again it will do the same thing and
see again it will do the same thing and we are going to see what is happening
we are going to see what is happening here. Let's wait for some time.
Awesome. So now you can see that it's already downloaded this and now if I go
already downloaded this and now if I go here there is one more image that is
here there is one more image that is added and then we are having the
added and then we are having the container and you can see there will be
container and you can see there will be one more container that will be added
one more container that will be added here. Notice here very very important I
here. Notice here very very important I mentioned right notice local host 80080
mentioned right notice local host 80080 I told right this is the host port and
I told right this is the host port and this is the container port. So I'll just
this is the container port. So I'll just click here and you can see that it's
click here and you can see that it's running here. Okay, awesome. All right.
running here. Okay, awesome. All right. So now let's see some of the common
So now let's see some of the common commands that actually you can use or
commands that actually you can use or you can keep all the commands handy. So
you can keep all the commands handy. So what I'll do right I'm going to copy
what I'll do right I'm going to copy this and let's paste it here. So I'll
this and let's paste it here. So I'll just write it here. Okay.
just write it here. Okay. So first we have docker
So first we have docker ps. So what this will do? This will show
ps. So what this will do? This will show only the running containers.
only the running containers. You can note it down or again I already
You can note it down or again I already mentioned I will be adding all of these
mentioned I will be adding all of these in my website and as like cheat sheet
in my website and as like cheat sheet you can download or probably I'll be
you can download or probably I'll be adding in the project section. So that
adding in the project section. So that will be added in the description. So you
will be added in the description. So you can go there and you can freely
can go there and you can freely download. Next we are going to have uh
download. Next we are going to have uh docker ps - a.
docker ps - a. So these hyphen a will list all
So these hyphen a will list all containers.
containers. Next we are going to have docker stop
Next we are going to have docker stop and here this will be dynamic. So this
and here this will be dynamic. So this is nothing but the container ID. So this
is nothing but the container ID. So this is just to stop a running container.
is just to stop a running container. Okay.
Next, you can also stop multiple containers at once. Let's say you're
containers at once. Let's say you're having five containers are running and
having five containers are running and you want to stop all of these. So, you
you want to stop all of these. So, you can docker stop.
can docker stop. You need the ID. So, we can do like
You need the ID. So, we can do like container 1, container 2,
container 1, container 2, container
3, so on. All right. And if you want to remove a container, you need to use
remove a container, you need to use docker rm, which is the command. And
docker rm, which is the command. And then again you need to pass the
then again you need to pass the container id. So this will be container
container id. So this will be container id. Okay. Now here this remove what it
id. Okay. Now here this remove what it actually do right. So this will deletes
actually do right. So this will deletes the container from docker permanently.
the container from docker permanently. Okay. But there is a prerequisite and
Okay. But there is a prerequisite and that is you need to first stop the
that is you need to first stop the container to delete it. So first you
container to delete it. So first you need to stop it. So first
need to stop it. So first stop the container and then only you can
stop the container and then only you can delete it or you need to use or use
delete it or you need to use or use hyphen if or you want to forcefully
hyphen if or you want to forcefully remove it. Okay. So you have docker ps
remove it. Okay. So you have docker ps which will running uh which will solve
which will running uh which will solve the running containers. Docker ps - a
the running containers. Docker ps - a list all containers docker stop
list all containers docker stop container uh ID uh which will stop a
container uh ID uh which will stop a running container. Uh you can stop
running container. Uh you can stop multiple containers with container one
multiple containers with container one ID 2 ID 3 ID. this so and to remove it
ID 2 ID 3 ID. this so and to remove it you need to use docker rm with the
you need to use docker rm with the container ID but again first you need to
container ID but again first you need to stop it or you need to use hyphen f okay
stop it or you need to use hyphen f okay now if you want to remove all the
now if you want to remove all the containers at once and if I'm not wrong
containers at once and if I'm not wrong you need to use something like docker
you need to use something like docker container
clone let me just quickly check it I'm not sure
uh see so this is used to to remove all the containers from your system. Okay,
the containers from your system. Okay, that's it. Uh what else? Okay. Uh I
that's it. Uh what else? Okay. Uh I think also you can remove a image. So
think also you can remove a image. So let's say you want to remove an image,
let's say you want to remove an image, right? So you need to use docker rmi and
right? So you need to use docker rmi and then you need to give the name of the
then you need to give the name of the image. So for example, let's say I want
image. So for example, let's say I want to give I want to remove engineix image.
to give I want to remove engineix image. So this will remove an image. All right,
So this will remove an image. All right, that's it. Now also another thing you
that's it. Now also another thing you can remove multiple images also. So what
can remove multiple images also. So what you going to do docker rmi and you need
you going to do docker rmi and you need to pass all the images name for example
to pass all the images name for example let's say engineix or let's say I want
let's say engineix or let's say I want to remove hello world and so on.
to remove hello world and so on. See these all are theoretical I know but
See these all are theoretical I know but these things you'll understand that
these things you'll understand that these are very very important to
these are very very important to understand right. So instead of doing
understand right. So instead of doing everything practically, we need to
everything practically, we need to actually balance it, learn conceptual
actually balance it, learn conceptual and try to apply some of these in your
and try to apply some of these in your project.
project. I think that's it. You can also
I think that's it. You can also forcefully remove uh some images also.
forcefully remove uh some images also. So to forcefully remove uh remove you
So to forcefully remove uh remove you can use docker rmi - f and then the name
can use docker rmi - f and then the name of the image which is for example engine
of the image which is for example engine right. So now let's say I'll just use
right. So now let's say I'll just use some of this right for example let's
some of this right for example let's I'll use docker ps
I'll use docker ps and you can see that you are getting
and you can see that you are getting this right engineix this is the command
this right engineix this is the command create a status and everything here you
create a status and everything here you will be getting the container ID which
will be getting the container ID which is this one so let's say I want to stop
is this one so let's say I want to stop it right so you can use what we need to
it right so you can use what we need to do we'll do docker stop and this let's
do we'll do docker stop and this let's see what is happening so I think it it
see what is happening so I think it it is already stopped see right awesome so
is already stopped see right awesome so Now what I will suggest you instead of I
Now what I will suggest you instead of I will apply all of this try to experiment
will apply all of this try to experiment try to use all this command and see what
try to use all this command and see what you are able to understand if you're
you are able to understand if you're getting any issues go to the official
getting any issues go to the official doc or go to chat GPT and try to explore
doc or go to chat GPT and try to explore more. So now with this what we have
more. So now with this what we have learned we have learned how to install
learned we have learned how to install docker what actually docker is which is
docker what actually docker is which is very important some of the uh core
very important some of the uh core concept of docker which is what what is
concept of docker which is what what is docker demon how uh docker images will
docker demon how uh docker images will be created how the flow works what is
be created how the flow works what is container what is images right all this
container what is images right all this and also some of the commands so now
and also some of the commands so now what we're going to do right now it's
what we're going to do right now it's time to apply all this in our man
time to apply all this in our man application so what we're going to do
application so what we're going to do right we will be creating a docker file
right we will be creating a docker file which will handle our MAN app both our
which will handle our MAN app both our server side code and the client side
server side code and the client side code and practically we are going to see
code and practically we are going to see that how we are going to do that in a
that how we are going to do that in a project again I am going to repeat one
project again I am going to repeat one more thing this is part one of this
more thing this is part one of this DevOps series there will be more
DevOps series there will be more complicated parts coming like part two
complicated parts coming like part two and part three but I'm not sure when
and part three but I'm not sure when that will come but definitely part two
that will come but definitely part two will come that 100% I'm sure so for this
will come that 100% I'm sure so for this one we'll try to keep everything very
one we'll try to keep everything very very simple so that you can practice and
very simple so that you can practice and you'll be prepared for the part two so
you'll be prepared for the part two so let's get started with the docker file
let's get started with the docker file creation. All right everyone. So now
creation. All right everyone. So now first time we going to create our first
first time we going to create our first docker file. Okay. So we'll go to our
docker file. Okay. So we'll go to our code and let's start with the server
code and let's start with the server side. So first I'll go to the server
side. So first I'll go to the server side folder and I'm going to create a
side folder and I'm going to create a file which will inside server folder and
file which will inside server folder and then I'm going to give this a name as
then I'm going to give this a name as docker and this will be file. That's it.
docker and this will be file. That's it. Okay. So now let's see I'm going to
Okay. So now let's see I'm going to close everything else and I'm going to
close everything else and I'm going to explain each and everything that what
explain each and everything that what actually we are writing here if you're
actually we are writing here if you're doing it for the very first time. Okay.
doing it for the very first time. Okay. So first I'm first thing I'm going to
So first I'm first thing I'm going to just write it and then I'm going to
just write it and then I'm going to explain it will be easy. So I'll just do
explain it will be easy. So I'll just do from and here we need to give a base
from and here we need to give a base image. Okay. So I'm going to use node
image. Okay. So I'm going to use node and then let's give use the version 20.
and then let's give use the version 20. Okay.
Next I'm going to use work directory and here I'm going to give / app. Don't
here I'm going to give / app. Don't worry I'm going to explain each and
worry I'm going to explain each and everything. Then I'm going to do copy
everything. Then I'm going to do copy and here I'm going to copy all the
and here I'm going to copy all the things that my package do.json has. Now
things that my package do.json has. Now what actually package do.json
what actually package do.json package.json will actually keep a track
package.json will actually keep a track of all your scripts all the dependencies
of all your scripts all the dependencies subd dependencies everything correct. So
subd dependencies everything correct. So here I'm just going to do package.
here I'm just going to do package. I need to check the spelling. I always
I need to check the spelling. I always make these spelling mistakes. So do
make these spelling mistakes. So do package uh dot JSON
package uh dot JSON and then I'm going to just do run and
and then I'm going to just do run and I'm just going to do npm install.
I'm just going to do npm install. Next I'm going to do copy
Next I'm going to do copy and I want to copy everything. So I give
and I want to copy everything. So I give like this and then I want to expose
like this and then I want to expose something and I want to expose 5,000
something and I want to expose 5,000 code that I'm going to explain what
code that I'm going to explain what actually we are doing. And then we need
actually we are doing. And then we need to run the app run the app which is
to run the app run the app which is executable right come here cmd installed
executable right come here cmd installed and here I just wanted to give node and
and here I just wanted to give node and I'll give this one as server js. Why?
I'll give this one as server js. Why? Because this is the entry file here. All
Because this is the entry file here. All right. So now I'm going to save this and
right. So now I'm going to save this and now let's explain let's discuss each and
now let's explain let's discuss each and everything very very details way. So
everything very very details way. So first one which is this from node colon
first one which is this from node colon 20 - alpine. So this is actually nothing
20 - alpine. So this is actually nothing but this is going to starts with a Linux
but this is going to starts with a Linux OS or operating system where NodeJS will
OS or operating system where NodeJS will be pre-installed. Okay very very
be pre-installed. Okay very very important because NodeJS is the
important because NodeJS is the prerequisite we are working with the MAN
prerequisite we are working with the MAN app. Second work directory. work
app. Second work directory. work directory is we are actually telling
directory is we are actually telling that okay because my docker file that
that okay because my docker file that I'm creating this is going to run inside
I'm creating this is going to run inside a container correct because this will
a container correct because this will run inside docker right and docker means
run inside docker right and docker means we are going to create a container so
we are going to create a container so inside container where I need to store
inside container where I need to store the code that what I'm telling that okay
the code that what I'm telling that okay whenever you're going to create the
whenever you're going to create the container inside container create app
container inside container create app folder and my code I want to keep inside
folder and my code I want to keep inside app folder now remember this is inside
app folder now remember this is inside container not outside very very
container not outside very very important okay this is not in your local
important okay this is not in your local machine this is inside container third
machine this is inside container third we have copy package dojson so what we
we have copy package dojson so what we are simply telling that here we need to
are simply telling that here we need to copy each and everything of package
copy each and everything of package dojson right because this actually I
dojson right because this actually I already told you this will keep a track
already told you this will keep a track of each and every dependencies subd
of each and every dependencies subd dependencies and everything this
dependencies and everything this particular project needs fourth we have
particular project needs fourth we have run npm install that means once the node
run npm install that means once the node dependencies sorry once Once node is
dependencies sorry once Once node is installed, I need to install all the
installed, I need to install all the dependencies inside the docker image. So
dependencies inside the docker image. So that is the reason I need to get this
that is the reason I need to get this run npm install command and then I this
run npm install command and then I this is also important copy dot dot means I
is also important copy dot dot means I need to copy each and everything or the
need to copy each and everything or the rest of my f file inside the container.
rest of my f file inside the container. So this will copy each and everything
So this will copy each and everything and then I'm just going to export expose
and then I'm just going to export expose this port 5000 which my app is going to
this port 5000 which my app is going to use. And the last one is we are actually
use. And the last one is we are actually telling docker that okay how you are
telling docker that okay how you are going to run your server when my
going to run your server when my container will start. Very very simple.
container will start. Very very simple. So I'm going to tell that when my
So I'm going to tell that when my container will start I need to run this
container will start I need to run this server js file because this is my entry
server js file because this is my entry point inside my server folder. I hope
point inside my server folder. I hope this is clear. Let's give this one as
this is clear. Let's give this one as node. Okay. So this will be my simple
node. Okay. So this will be my simple docker file that I need for this server
docker file that I need for this server folder. Okay. inside server directory.
folder. Okay. inside server directory. All right. So now we have created our
All right. So now we have created our first docker file. So what will be our
first docker file. So what will be our next step? So next what we need to do
next step? So next what we need to do right, we need to first build the
right, we need to first build the container and also then we are going to
container and also then we are going to run the container. So first let's go to
run the container. So first let's go to our
our uh this documentation here and here I'm
uh this documentation here and here I'm going to add some more commands. Let's
going to add some more commands. Let's add all of these here only. So first to
add all of these here only. So first to build it what we are going to use. So
build it what we are going to use. So we'll be using docker there we are going
we'll be using docker there we are going to use build then we need to use this
to use build then we need to use this hyphen d and this actually uh this
hyphen d and this actually uh this command is basically tells or this
command is basically tells or this actually tags the image that we can
actually tags the image that we can reference later and here we're going to
reference later and here we're going to give the name of that docker image. So
give the name of that docker image. So let's say I want to give something like
let's say I want to give something like man backend right because we're working
man backend right because we're working on man project. So this will be the
on man project. So this will be the build command. Next we are going to also
build command. Next we are going to also run it. So to run it there are uh so
run it. So to run it there are uh so let's uh discuss uh step by step. So we
let's uh discuss uh step by step. So we are going to use docker first. Then we
are going to use docker first. Then we are going to do run. Then we're going to
are going to do run. Then we're going to use hyphen b. Remember this will
use hyphen b. Remember this will actually to map the port. Then let's I
actually to map the port. Then let's I want to use the local host. This is the
want to use the local host. This is the host port which will be mapped to the
host port which will be mapped to the container port. All right. And then here
container port. All right. And then here what we are going to simply do we are
what we are going to simply do we are going to actually tell that which image
going to actually tell that which image we need to run that is man back end
we need to run that is man back end because this is the image that we have
because this is the image that we have created. So I'm going to do man back end
created. So I'm going to do man back end but here if you notice whenever we'll go
but here if you notice whenever we'll go to docker right you see uh let's go to
to docker right you see uh let's go to not here let's go to container you see
not here let's go to container you see that it's always giving some random name
that it's always giving some random name now but what I need to do right I need
now but what I need to do right I need to give some custom name. So in that
to give some custom name. So in that case what I will do I'll use this name
case what I will do I'll use this name command and then I will give some custom
command and then I will give some custom name. For example let's say I want to
name. For example let's say I want to give back end. So this will be my custom
give back end. So this will be my custom name. All right. Now there are some
name. All right. Now there are some cases where you can also add some other
cases where you can also add some other tags. For example let's say uh in this
tags. For example let's say uh in this server case server side docker only. You
server case server side docker only. You see that we are using this env. But this
see that we are using this env. But this environ
right. So what we need to tell we need to tell docker that okay whenever you
to tell docker that okay whenever you will going to build it you need to take
will going to build it you need to take the contents of the env from this path
the contents of the env from this path from this file and to do that what we
from this file and to do that what we can do simply we'll do something like
can do simply we'll do something like this so we'll do docker okay run- p this
this so we'll do docker okay run- p this will stay same and then I'm going to
will stay same and then I'm going to simply let's give a name which will be
simply let's give a name which will be back end and then I'm going to tell that
back end and then I'm going to tell that okay take the env file from env and it
okay take the env file from env and it will read the file content and then give
will read the file content and then give the tag which is man. I hope this is
the tag which is man. I hope this is clear. Now there are multiple other ways
clear. Now there are multiple other ways like we can create also network then we
like we can create also network then we have volumes but I actually
have volumes but I actually intentionally keep all of these concepts
intentionally keep all of these concepts for part two because we're going to
for part two because we're going to discuss in depth. Okay. So now for this
discuss in depth. Okay. So now for this one let's simply learn how you can build
one let's simply learn how you can build it and run it. So now what we can do
it and run it. So now what we can do right we'll go here and then one more
right we'll go here and then one more thing I always forget like I I always
thing I always forget like I I always make m mistake and that is this build
make m mistake and that is this build command we also need to give a context
command we also need to give a context okay so this dot we need to give so here
okay so this dot we need to give so here what I'll do I'll simply go to cd and
what I'll do I'll simply go to cd and then I'll go to server folder and then
then I'll go to server folder and then I'll simply tell that okay now I need to
I'll simply tell that okay now I need to build it so I'll do docker
build it so I'll do docker build okay t and I'll give this one as
build okay t and I'll give this one as back end and Then I'm going to give dot
back end and Then I'm going to give dot context. So what I do? So we are in this
context. So what I do? So we are in this directory. So it's going to read from
directory. So it's going to read from here and then it's going to build it.
here and then it's going to build it. Okay. Now I'm going to hit enter and
Okay. Now I'm going to hit enter and let's see what is happening. And you can
let's see what is happening. And you can see that immediately started building.
see that immediately started building. So it will take some time. Once this is
So it will take some time. Once this is done, you can see that one image will be
done, you can see that one image will be created. Docker image will be created.
created. Docker image will be created. And if I just go to here and let's go to
And if I just go to here and let's go to my images, you'll see there is a man
my images, you'll see there is a man backend image that is created with the
backend image that is created with the image ID. Awesome. So now what we going
image ID. Awesome. So now what we going to do right we need to run it. So what
to do right we need to run it. So what I'll do simply is I'll do docker run- p
I'll do simply is I'll do docker run- p then I'm going to use 5,000 localhost uh
then I'm going to use 5,000 localhost uh or not local host host code which will
or not local host host code which will be mapped to 5,000 of the container
be mapped to 5,000 of the container port. Okay, this is the container. I
port. Okay, this is the container. I always mention this point because this
always mention this point because this is actually very important here. I'm
is actually very important here. I'm going to give a name. I'll give back end
going to give a name. I'll give back end and then what I'm going to do I'm going
and then what I'm going to do I'm going to tell that okay for env file you pick
to tell that okay for env file you pick from this env file content. Okay. And
from this env file content. Okay. And then I'm going to give the tag. Now this
then I'm going to give the tag. Now this tag is actually the tag that we are
tag is actually the tag that we are having here. Okay. So here I'm just
having here. Okay. So here I'm just going to give man back end. And now hit
going to give man back end. And now hit enter. And let's see what is happening.
That's it. Now you can see that it's connected to MongoDB. That means what
connected to MongoDB. That means what happened? If you go to server.js, you
happened? If you go to server.js, you can see that we are using this, right? I
can see that we are using this, right? I think this also this uh configs I think
think this also this uh configs I think we can remove which is fine for now.
we can remove which is fine for now. Let's skip it. But it's actually reading
Let's skip it. But it's actually reading from env file if you notice. So that
from env file if you notice. So that means because of this tag here it's
means because of this tag here it's actually picking all the environment
actually picking all the environment is working fine. Awesome. So now what
is working fine. Awesome. So now what will be our next step? So the next step
will be our next step? So the next step is see just like we have created for the
is see just like we have created for the server right. The similarly we need to
server right. The similarly we need to create for client also. Right? So it
create for client also. Right? So it will be almost similar. So let's do one
will be almost similar. So let's do one thing. Let's go to our
thing. Let's go to our uh client folder. And here I'm going to
uh client folder. And here I'm going to create one more. Let's give this one as
create one more. Let's give this one as docker docker file. Okay. All right. The
docker docker file. Okay. All right. The first thing it will be almost same. So
first thing it will be almost same. So let's remove this. So I'm going to just
let's remove this. So I'm going to just copy this. Paste it here. Work
copy this. Paste it here. Work directory. I'm going to keep the same.
directory. I'm going to keep the same. Then I'm going to copy all the
Then I'm going to copy all the package.json content. All right. Then
package.json content. All right. Then what I'm going to do? I'm going to do uh
what I'm going to do? I'm going to do uh let's do this one as
run npm install
install then I'm just going to do same copy
then I'm just going to do same copy all the content then what I'm going to
all the content then what I'm going to do we need to build it so to build it
do we need to build it so to build it we're going to use the npm run build all
we're going to use the npm run build all right and then I'm going to expose now
right and then I'm going to expose now here we need to make one change because
here we need to make one change because we are specifically telling that we want
we are specifically telling that we want to use this 5173 port then I'm going to
to use this 5173 port then I'm going to use the command which will be in this
use the command which will be in this case npm
run and this will be preview right now let's save this now what
right now let's save this now what changes we need to do right so we'll go
changes we need to do right so we'll go to our package dojson
to our package dojson and here in this preview I'm just going
and here in this preview I'm just going to add here that okay for this one I'm
to add here that okay for this one I'm going to add a host which will actually
going to add a host which will actually add this port with this 517 73 this
add this port with this 517 73 this configuration. The same thing you can
configuration. The same thing you can also do here in this docker file but
also do here in this docker file but let's skip it here only. That's it. So I
let's skip it here only. That's it. So I think this is done and ENV file I think
think this is done and ENV file I think we are already using this. So now what
we are already using this. So now what I'm going to do I'll do the exact same
I'm going to do I'll do the exact same thing. So I'm going to open one more
thing. So I'm going to open one more terminal. Let's go to the client folder
terminal. Let's go to the client folder and let's do docker build d. Right. Then
and let's do docker build d. Right. Then I'm going to do man front end. This is
I'm going to do man front end. This is the name of the image. Don't get
the name of the image. Don't get confused. And then I have to give the
confused. And then I have to give the context and let's give enter.
I think it's already exporting. I think this now this will be done. Awesome.
So now let's go to Okay, this is created. So now what are we going to do?
created. So now what are we going to do? I'm going to clear this. So I'm going to
I'm going to clear this. So I'm going to do docker run, right? So I'll do 5173
do docker run, right? So I'll do 5173 will be mapped to 5173.
will be mapped to 5173. Let's give a name as front end.
Let's give a name as front end. Okay. And here I'm going to give the env
Okay. And here I'm going to give the env file which will pick from env. And then
file which will pick from env. And then what else? So we need to give the name
what else? So we need to give the name of the image which will be man front
of the image which will be man front end. So now what I'm going to do hit
end. So now what I'm going to do hit enter.
That's it. So now let's see what is happening here. So I'll just click here
happening here. So I'll just click here and see. So now this E is actually
and see. So now this E is actually running through your Docker container.
running through your Docker container. Right? Awesome.
Right? Awesome. Also if you just go here, right? Let's
Also if you just go here, right? Let's go to the container. You see the mapping
go to the container. You see the mapping here. See this 5,000 is mapped to the
here. See this 5,000 is mapped to the container 5,000. This is for the back
container 5,000. This is for the back end and this is the mapping for the
end and this is the mapping for the front end. So if I just click here right
front end. So if I just click here right now what I'm going to do because we have
now what I'm going to do because we have this specific route. If I go to the
this specific route. If I go to the server side let's go to the routes and
server side let's go to the routes and you see we have this API/ tasks. So now
you see we have this API/ tasks. So now let's go and let's paste it.
let's go and let's paste it. And you can see that we are getting all
And you can see that we are getting all the data right. So getting the updated
the data right. So getting the updated data here. And even if you let's say if
data here. And even if you let's say if I go here and let's add a new one.
Okay. And let's refresh this here. And you can see you're getting the
And you can see you're getting the updated data. Awesome. So now this uh
updated data. Awesome. So now this uh man app is now actually running through
man app is now actually running through your docker container. All right. So
your docker container. All right. So with this I think the basic things we
with this I think the basic things we have covered that what is docker images
have covered that what is docker images container how you can build it how you
container how you can build it how you can run it some of the commands you can
can run it some of the commands you can go through all of these now we are going
go through all of these now we are going to move to another very very important
to move to another very very important I'm not saying again that we have
I'm not saying again that we have covered everything this is a beginner
covered everything this is a beginner level course there are lot of other
level course there are lot of other concepts in docker like we can go many
concepts in docker like we can go many many advanced level I can't cover each
many advanced level I can't cover each and everything and then complete all the
and everything and then complete all the deops beginner concept in a single video
deops beginner concept in a single video right it will be very long so all this
right it will be very long so all this network volume related concept concept
network volume related concept concept we'll be moving to part two. In the next
we'll be moving to part two. In the next part what we going to learn? We are
part what we going to learn? We are going to learn another very very
going to learn another very very important concept that is docker
important concept that is docker compose. Now before doing that we also
compose. Now before doing that we also need to understand that what is the
need to understand that what is the problem with this approach that we have
problem with this approach that we have learned so far. Why actually we need
learned so far. Why actually we need compose. All of this we need to
compose. All of this we need to understand then we are going to create
understand then we are going to create our docker compose file. So let's get
our docker compose file. So let's get started with the next one. All right. So
started with the next one. All right. So now we are going to start uh docker
now we are going to start uh docker compose. But before that let's
compose. But before that let's understand that whatever we have learned
understand that whatever we have learned so far. Right. Then only you are going
so far. Right. Then only you are going to understand that what is the problem
to understand that what is the problem and why actually we need compose. See
and why actually we need compose. See till now what we actually have done that
till now what we actually have done that we have built our back end image we run
we have built our back end image we run our back end container we build our
our back end container we build our front end image we run our front end
front end image we run our front end container right we also definitely
container right we also definitely haven't covered the network and those
haven't covered the network and those things but whenever we will be
things but whenever we will be introducing those concepts so we need to
introducing those concepts so we need to also manually create custom networks we
also manually create custom networks we also need to mount volume for our DB
also need to mount volume for our DB persistence lot of other things now what
persistence lot of other things now what happened right using this what we need
happened right using this what we need to do we need to repeat all those
to do we need to repeat all those commands Right? You are you are building
commands Right? You are you are building your serverside code separate serverside
your serverside code separate serverside container separately running it doing
container separately running it doing the same thing for front end you'll be
the same thing for front end you'll be doing the same thing for DBs I hope
doing the same thing for DBs I hope you're getting right now this is not
you're getting right now this is not only time consuming also there is a lot
only time consuming also there is a lot of chance that you'll be getting lot of
of chance that you'll be getting lot of errors right so error prone so now here
errors right so error prone so now here the one of the best solution that we are
the one of the best solution that we are going to introduce now that is called
going to introduce now that is called compose so what actually mean so If you
compose so what actually mean so If you think like this right I'm going to give
think like this right I'm going to give like a really good example that docker
like a really good example that docker cli that we have done so far you
cli that we have done so far you consider this one as a like a single
consider this one as a like a single person m musician right for example
person m musician right for example let's say someone is playing just guitar
let's say someone is playing just guitar and docker compose is like complete
and docker compose is like complete orchestra like lot of people are doing
orchestra like lot of people are doing together I hope you're getting right so
together I hope you're getting right so how this is work so so you can consider
how this is work so so you can consider that docker compose I'm going to give
that docker compose I'm going to give docker compose so I will give something
docker compose so I will give something like it's It's a tool
like it's It's a tool which is helps help us to define
which is helps help us to define uh something like multicontainer.
uh something like multicontainer. Multicontainer mean just like we have
Multicontainer mean just like we have now two container right so it's a
now two container right so it's a multicontainer apps
in a single yml file as simple as that okay so we just give this one as let's
okay so we just give this one as let's say docker compos yiml okay what it
say docker compos yiml okay what it actually helps it will help is building
actually helps it will help is building services starting containers networking
services starting containers networking volumes and also we can logs and lot of
volumes and also we can logs and lot of other things right all what how you're
other things right all what how you're going to do it So just we need to do
going to do it So just we need to do docker compose
docker compose and then we'll do up and then just do
and then we'll do up and then just do build that's it right. So how this will
build that's it right. So how this will work now here you need to understand the
work now here you need to understand the structure. So we have our yman file. So
structure. So we have our yman file. So let's create this one then it will be
let's create this one then it will be easy to understand.
So let's consider this one as I'm going to increase this. So let's consider this
to increase this. So let's consider this is your docker compos file. So I do
is your docker compos file. So I do docker compose
docker compose vl file. Okay
vl file. Okay this what it will do right? So it will
this what it will do right? So it will talk to docker compose
engine web and here now what will happen? So we'll be having
multiple uh containers right. So let's say I have one for DB, I have one for my
say I have one for DB, I have one for my back end. I hope you're getting and I
back end. I hope you're getting and I have one for my UI or front end, right?
have one for my UI or front end, right? And how this will work? This all is
And how this will work? This all is connected automatically in a shared
connected automatically in a shared private network. So this is the overall
private network. So this is the overall structure and why actually we need
structure and why actually we need docker compost, right? Because it's very
docker compost, right? Because it's very very important to understand. So now
very important to understand. So now what we going to do simply we'll uh
what we going to do simply we'll uh we'll do this one with practical
we'll do this one with practical example. It will be very easy to
example. It will be very easy to understand. So in our project root right
understand. So in our project root right root means outside of it in the root
root means outside of it in the root what we will do we'll simply create a
what we will do we'll simply create a docker compose file right so we going to
docker compose file right so we going to simply create let's add here docker
simply create let's add here docker compose
compose do yiml all right
do yiml all right now let's close this
now let's close this first I'm going to write and then I'm
first I'm going to write and then I'm going to explain each and everything
going to explain each and everything okay that what we are doing here first
okay that what we are doing here first here I'm going to write a services so
here I'm going to write a services so here I'm I'm going to just add my first
here I'm I'm going to just add my first service which I'm going to give this one
service which I'm going to give this one as back end. So this is my back end
as back end. So this is my back end service. I'm going to explain each and
service. I'm going to explain each and everything. Okay, for now just beware
everything. Okay, for now just beware there are some formatting issue will
there are some formatting issue will come that we need to fix. First let's
come that we need to fix. First let's understand all the terms and everything
understand all the terms and everything if you're doing this for the first time.
if you're doing this for the first time. So for this service the first thing what
So for this service the first thing what we need to do we need to build it right
we need to do we need to build it right from where we are going to build it. Now
from where we are going to build it. Now first we need to go to our server
first we need to go to our server directory correct. So here what I'm
directory correct. So here what I'm going to do simply so I'll simply tell
going to do simply so I'll simply tell that go to my server folder. So this is
that go to my server folder. So this is where my back end code has uh backend
where my back end code has uh backend code exist. Okay. So this will be my
code exist. Okay. So this will be my build command. Then okay let me first
build command. Then okay let me first write it then we're going to understand.
write it then we're going to understand. So I'll do container name. I'm going to
So I'll do container name. I'm going to give this one as back end. Then I'm
give this one as back end. Then I'm going to do a another restart command
going to do a another restart command which will I'm going to give this one as
which will I'm going to give this one as always. Then I'm going to give file. I'm
always. Then I'm going to give file. I'm pretty sure some of you are able to
pretty sure some of you are able to understand and here I'm going to give
understand and here I'm going to give something that go to my server folder
something that go to my server folder and then inside that you'll be getting
and then inside that you'll be getting my env file like that. Okay. Then I'm
my env file like that. Okay. Then I'm also going to do a quote. So here I'm
also going to do a quote. So here I'm going to just do 5,000 map to sorry to
going to just do 5,000 map to sorry to give 5,000 map to 5,000.
give 5,000 map to 5,000. Right? That's it. So now what actually
Right? That's it. So now what actually is happening here? Now this is not
is happening here? Now this is not correct. I think there is some
correct. I think there is some formatting issues that we need to fix.
formatting issues that we need to fix. But before that first at least we need
But before that first at least we need to understand that what is happening
to understand that what is happening here. Right? The first thing is that if
here. Right? The first thing is that if you notice that we are actually telling
you notice that we are actually telling that you build the docker file from this
that you build the docker file from this directory. So this is the directory from
directory. So this is the directory from where the build will happen. So it will
where the build will happen. So it will go to the server directory and it is
go to the server directory and it is going to build it. Right? Next we are
going to build it. Right? Next we are having the container name. I don't have
having the container name. I don't have to explain you. It's very easy to
to explain you. It's very easy to understand. Right?
understand. Right? And then next we are having the restart
And then next we are having the restart that means every time we are going to
that means every time we are going to run the build command we're going to
run the build command we're going to restart this service env file again we
restart this service env file again we are going to go to this path we're going
are going to go to this path we're going to get the env and port is nothing but
to get the env and port is nothing but the mapping that we have discussed right
the mapping that we have discussed right so this is what actually we are going to
so this is what actually we are going to create our services now we can have
create our services now we can have multiple services for now we having only
multiple services for now we having only two so I'm pretty sure you are getting
two so I'm pretty sure you are getting that what actually we need to do next so
that what actually we need to do next so we need to create one more service that
we need to create one more service that will be for front end so what I will
will be for front end so what I will suggest pause the video and try to write
suggest pause the video and try to write by your own forget about uh formatting
by your own forget about uh formatting and everything that we going to fix it
and everything that we going to fix it but let's see if we uh if you are able
but let's see if we uh if you are able to do it or not so what I'm trying to
to do it or not so what I'm trying to say for front end again what you need to
say for front end again what you need to do you need to give a build command you
do you need to give a build command you need to give a container you need to
need to give a container you need to give a restart command you need to give
give a restart command you need to give a nv file ports and then one more thing
a nv file ports and then one more thing that is important here you need to also
that is important here you need to also give a depends on so that you need to
give a depends on so that you need to give that is called depends on that
give that is called depends on that means this service the front end service
means this service the front end service is depend on the back end service. Okay.
is depend on the back end service. Okay. Next, we are also going to add a volume
Next, we are also going to add a volume that is MongoD data. So, for now,
that is MongoD data. So, for now, because we're using Atlas,
because we're using Atlas, Atlas actually handles all this, but we
Atlas actually handles all this, but we need to keep all the volumes in our
need to keep all the volumes in our container. So, that is the reason
container. So, that is the reason volumes is another property that we are
volumes is another property that we are going to use. Okay.
going to use. Okay. So, I think that's it. Now, what I'm
So, I think that's it. Now, what I'm going to do right, I'm going to just
going to do right, I'm going to just paste the content here because I don't
paste the content here because I don't want to fix this manually. It will take
want to fix this manually. It will take time. And then we're going to explain
time. And then we're going to explain that how this will look and what are the
that how this will look and what are the things that we have added. If you're
things that we have added. If you're able to do it, it's good for you. So let
able to do it, it's good for you. So let me pause it and then I'm going to paste
me pause it and then I'm going to paste the content here. All right. So you can
the content here. All right. So you can see that I just added the two uh two
see that I just added the two uh two services I added with the proper syntax
services I added with the proper syntax formatting. So build container name
formatting. So build container name restart ports. Same for front end build
restart ports. Same for front end build container name restart ports and depends
container name restart ports and depends on. So it depends on the back end
on. So it depends on the back end service. All right. So this is done. So
service. All right. So this is done. So now what I going to do? I'm just going
now what I going to do? I'm just going to go to the previous where we are
to go to the previous where we are writing all this right. So I'm going to
writing all this right. So I'm going to add one more and this will be to run all
add one more and this will be to run all services. So what we going to do right
services. So what we going to do right we going to simply use docker compose
we going to simply use docker compose and I'm going to do up web and then I'm
and I'm going to do up web and then I'm going to do build. That's it. You can
going to do build. That's it. You can also do this one with detach mode. And
also do this one with detach mode. And to do that you're going to use do uh
to do that you're going to use do uh docker compose up - build.
docker compose up - build. And here you need to use minus d. Okay.
And here you need to use minus d. Okay. If you want to stop everything you need
If you want to stop everything you need to use docker
to use docker compose done. All right. If you want to
compose done. All right. If you want to see logs. So I'm giving only the
see logs. So I'm giving only the important ones. Okay. Those are actually
important ones. Okay. Those are actually important to understand. So we have the
important to understand. So we have the docker
docker compose
compose logs.
logs. These will give you all the logs. If you
These will give you all the logs. If you want to just want to see the logs for
want to just want to see the logs for back end or front end. So what you need
back end or front end. So what you need to do? You need to give docker compose
to do? You need to give docker compose logs and the name of the container. So
logs and the name of the container. So let's I'll give you back end or front
let's I'll give you back end or front end. Okay, that's it. So just know all
end. Okay, that's it. So just know all this as a beginner it's more than
this as a beginner it's more than enough. So this is the build command.
enough. So this is the build command. This is the same build command with
This is the same build command with detach mode. This is the down. So you
detach mode. This is the down. So you want to stop it. This is for logs and
want to stop it. This is for logs and this is for specific logs for a
this is for specific logs for a particular service container. So what
particular service container. So what I'll do right I'll go here and now let's
I'll do right I'll go here and now let's see what is happening.
see what is happening. So I'm just going to docker
So I'm just going to docker compose I'm going to do up and I'll do
compose I'm going to do up and I'll do build. Hit enter.
That's it. And you can see that it's working fine. Awesome. So now you can
working fine. Awesome. So now you can also go here and you can check it. So
also go here and you can check it. So it's actually added here with the name
it's actually added here with the name and then you have the container here.
and then you have the container here. Okay. Back end, front end with the
Okay. Back end, front end with the mapping. So now let's see if I go here
mapping. So now let's see if I go here and you are getting the same result.
and you are getting the same result. Exact same result. Awesome. can also
Exact same result. Awesome. can also delete it. Let's say I want to delete
delete it. Let's say I want to delete this and it's working fine. So this is
this and it's working fine. So this is all about docker compost. Now one more
all about docker compost. Now one more important interview questions I want to
important interview questions I want to actually give uh all of you here that is
actually give uh all of you here that is sometime your interviewer can ask you
sometime your interviewer can ask you that why docker files are still required
that why docker files are still required if you're doing it with docker compose.
if you're doing it with docker compose. Can't we do everything with docker
Can't we do everything with docker compose? The answer is no. So actually
compose? The answer is no. So actually you actually need the docker files. Why?
you actually need the docker files. Why? Because docker file is the file that
Because docker file is the file that actually help you to build the image.
actually help you to build the image. Right? So that will tells docker that
Right? So that will tells docker that how you build your app container. You
how you build your app container. You got it? Means if you go to the docker
got it? Means if you go to the docker file these concepts are very very
file these concepts are very very important. Right? If you see I'm just
important. Right? If you see I'm just focusing all this. So this is actually
focusing all this. So this is actually train that okay you copy all these you
train that okay you copy all these you do npm install you get all the code
do npm install you get all the code right. So that is the reason you need
right. So that is the reason you need the docker file. Compose what it is
the docker file. Compose what it is doing it's just simply doing nothing.
doing it's just simply doing nothing. It's just not nothing. It's just running
It's just not nothing. It's just running all the container together, right? It's
all the container together, right? It's working as a orchestrator. Okay,
working as a orchestrator. Okay, multiple services container.
multiple services container. Then we have our compost build, right?
Then we have our compost build, right? Compose build also uses the docker file.
Compose build also uses the docker file. That means when you write build means we
That means when you write build means we are writing this. If you notice, right,
are writing this. If you notice, right, we doing this, we are going to the
we doing this, we are going to the server directory. So what it actually
server directory. So what it actually doing, it actually look for a docker
doing, it actually look for a docker file inside that particular directory. I
file inside that particular directory. I hope you're getting all this point
hope you're getting all this point right. So that is the reason the answer
right. So that is the reason the answer is even we are write doing with docker
is even we are write doing with docker compose we still need the docker
compose we still need the docker individual docker file for every
individual docker file for every container level or the service level. So
container level or the service level. So that is all about the docker compose and
that is all about the docker compose and I think with this we have complete we
I think with this we have complete we have covered all the basic level of uh
have covered all the basic level of uh concepts and the practical example that
concepts and the practical example that you need to know for docker. So now what
you need to know for docker. So now what we're going to do we'll be moving to
we're going to do we'll be moving to another important section that will be
another important section that will be our CI. So what we're going to do here
our CI. So what we're going to do here we'll be learning what is continuous
we'll be learning what is continuous integration what is GitHub accense and
integration what is GitHub accense and then I'm going to show you that how we
then I'm going to show you that how we are going to set up eslint and ptier
are going to set up eslint and ptier with uh CI and then we are going to also
with uh CI and then we are going to also gives I'm going to show you that also
gives I'm going to show you that also give some checks on PR request that when
give some checks on PR request that when you are going to raise PR from one
you are going to raise PR from one branch to another branch if the CI is
branch to another branch if the CI is failed you not be able to merge it. So
failed you not be able to merge it. So those kind of things we're going to do
those kind of things we're going to do from the next section it will be very
from the next section it will be very very interesting. Again I said I want to
very interesting. Again I said I want to uh repeat that this is not the entire
uh repeat that this is not the entire docker thing. I hope I know that you
docker thing. I hope I know that you some of you already know that okay this
some of you already know that okay this is not even covered all the things
is not even covered all the things definitely I not covered but there will
definitely I not covered but there will be part two and maybe part three there
be part two and maybe part three there you're going to see lot of advanced
you're going to see lot of advanced level of concepts but from a beginner
level of concepts but from a beginner point of view I think this is more than
point of view I think this is more than enough now let's move on to the next
enough now let's move on to the next one. All right. So now we are going to
one. All right. So now we are going to start with continuous integration or in
start with continuous integration or in short that we call as CI. Now this is
short that we call as CI. Now this is one of the very very important step when
one of the very very important step when you are talking about the life cycle of
you are talking about the life cycle of devops. So what we are going to do right
devops. So what we are going to do right so normally here we have multiple uh
so normally here we have multiple uh steps that actually involve whenever
steps that actually involve whenever you'll be working on any real world
you'll be working on any real world project for example let's say you you
project for example let's say you you going to write test cases you'll be
going to write test cases you'll be having yes prettier and lot of other
having yes prettier and lot of other things because this is only beginner
things because this is only beginner level so what I've decided for the part
level so what I've decided for the part one right I'm only going to show you
one right I'm only going to show you that how the flow works how we are going
that how the flow works how we are going to integrate with GitHub actions and the
to integrate with GitHub actions and the third we are also going to configure
third we are also going to configure both eslint and pretier for both client
both eslint and pretier for both client and server directory and we are going to
and server directory and we are going to see how all this process works right so
see how all this process works right so that in the next part when you'll be
that in the next part when you'll be going in depth it will be easier for you
going in depth it will be easier for you to understand so first thing we need to
to understand so first thing we need to understand that what is actually
understand that what is actually continuous integration now when I'm
continuous integration now when I'm talking about the definition so it's
talking about the definition so it's like a devops practice in short right so
like a devops practice in short right so what actually the practice is so it's
what actually the practice is so it's like a practice of automatically
like a practice of automatically integrating your code changes from
integrating your code changes from multiple contributors right so for
multiple contributors right so for example let's say you are working on a
example let's say you are working on a team within a team and you have multiple
team within a team and you have multiple team members there they are contributing
team members there they are contributing written to the same repository. So
written to the same repository. So everyone has their own changes, right?
everyone has their own changes, right? So that means whenever you will all will
So that means whenever you will all will push your changes, you need to merge all
push your changes, you need to merge all these changes without any error to a
these changes without any error to a master branch or to a main branch. Okay?
master branch or to a main branch. Okay? So it's a practice of automatically
So it's a practice of automatically integrating code changes from multiple
integrating code changes from multiple contributors into a shared codebase.
contributors into a shared codebase. Shared means where all your team members
Shared means where all your team members code base will stay. Okay. Now this can
code base will stay. Okay. Now this can happen multiple times in a day, right?
happen multiple times in a day, right? So you need some kind of automated
So you need some kind of automated process to handle all of this. You can't
process to handle all of this. You can't manage everything in uh like manually.
manage everything in uh like manually. And I'm also going to discuss that what
And I'm also going to discuss that what all the errors that we usually face when
all the errors that we usually face when we are going to do all this manually.
we are going to do all this manually. And also what we going to do right every
And also what we going to do right every time anyone will push any changes we're
time anyone will push any changes we're going to verify each and every
going to verify each and every integration. How we are going to do
integration. How we are going to do that? So we'll be having automated
that? So we'll be having automated builds test and linting pretty lot of
builds test and linting pretty lot of other things. Right? So now let's see
other things. Right? So now let's see what are the problems that it will
what are the problems that it will resolve. So I'm just going to write it
resolve. So I'm just going to write it here and let's uh let's keep it little
here and let's uh let's keep it little less.
less. Okay. So the first thing if you notice
Okay. So the first thing if you notice that first of all when you're going to
that first of all when you're going to do manually right so normally what will
do manually right so normally what will happen you don't so I'm going to write
happen you don't so I'm going to write it here you don't
it here you don't find bugs until
find bugs until days or sometimes weeks right suddenly
days or sometimes weeks right suddenly you got to know that okay there is a bug
you got to know that okay there is a bug because let's say it's a manual
because let's say it's a manual deployment there is a possibility that
deployment there is a possibility that after 5 days you'll face one issue in
after 5 days you'll face one issue in produ uh prod environment.
produ uh prod environment. Second thing is very important like
Second thing is very important like march conflicts right march conflicts
march conflicts right march conflicts march conflicts can pile up
march conflicts can pile up okay
okay third will be like uh let's say very
third will be like uh let's say very very important and I think I've noticed
very important and I think I've noticed this one practically multiple multiple
this one practically multiple multiple multiple times even if you are working
multiple times even if you are working in a company you'll also love that this
in a company you'll also love that this is very very important that one person
is very very important that one person change can break
change can break multiple other changes extremely
multiple other changes extremely extremely important. Okay, this is very
extremely important. Okay, this is very very important I think and this is also
very important I think and this is also real life like if you work on any team
real life like if you work on any team right you'll see that there is a high
right you'll see that there is a high possibility that some let's say uh
possibility that some let's say uh someone made some changes and he uh that
someone made some changes and he uh that person didn't test all the other flows
person didn't test all the other flows or didn't do any regression testing or
or didn't do any regression testing or anything and push the changes and it
anything and push the changes and it break something else extremely important
break something else extremely important okay
okay and then definitely manual
and then definitely manual testing
testing and building is also
also time taking because we also need to see all this right whenever you are
see all this right whenever you are working on any some for example let's
working on any some for example let's say you're working on a P 0 team right
say you're working on a P 0 team right you know right P 0 P1 so P 0 is the when
you know right P 0 P1 so P 0 is the when you're talking about very top level
you're talking about very top level companies right they have their teams
companies right they have their teams divided into multiple tire so tire I'm
divided into multiple tire so tire I'm talking about so let's say you have a
talking about so let's say you have a tire and then you'll be having P 0 team
tire and then you'll be having P 0 team then you'll be having the P1 team okay
then you'll be having the P1 team okay then you are going to have the P2 then
then you are going to have the P2 then P3
P3 okay and then you are also sometimes
okay and then you are also sometimes have P4 and P5 also so these all are the
have P4 and P5 also so these all are the priority so when you are working on any
priority so when you are working on any P 0 team there is no way you can
P 0 team there is no way you can maintain all this using manual testing
maintain all this using manual testing or building because P 0 teams are
or building because P 0 teams are normally user facing user facing means
normally user facing user facing means let's say we're working on uh an XY Z
let's say we're working on uh an XY Z company where there are lot of end users
company where there are lot of end users are using that particular product Right?
are using that particular product Right? Someone push some changes and it breaks
Someone push some changes and it breaks something and you got to know after one
something and you got to know after one day and immediately let's say millions
day and immediately let's say millions of users are facing the same issue. What
of users are facing the same issue. What will happen? It's like a huge problem
will happen? It's like a huge problem for company right on the company level.
for company right on the company level. So that is the reason the CI/CD all
So that is the reason the CI/CD all these steps in DevOps when we are
these steps in DevOps when we are talking about from a project point of
talking about from a project point of view it's extremely important.
view it's extremely important. Okay. Now what are the benefits that we
Okay. Now what are the benefits that we will actually get from CI right that
will actually get from CI right that also we need to discuss. So I'm going to
also we need to discuss. So I'm going to remove all of these. See first of all is
remove all of these. See first of all is like early testing. Now as I already
like early testing. Now as I already mentioned that we are not going to cover
mentioned that we are not going to cover the testing part for now because we I
the testing part for now because we I haven't write any test cases for this
haven't write any test cases for this particular project. I'll try to keep
particular project. I'll try to keep this one very very simple that is the
this one very very simple that is the reason but at the end when I'm going to
reason but at the end when I'm going to complete this section you'll be able to
complete this section you'll be able to understand it's nothing but it's just
understand it's nothing but it's just adding one new step in your CI. So
adding one new step in your CI. So testing is one of the part okay or one
testing is one of the part okay or one of the steps. So here you're going to
of the steps. So here you're going to run your tests right and then you're
run your tests right and then you're going to run your lint you're going to
going to run your lint you're going to do build all this right on every push
do build all this right on every push automatically
right second will be like team collaboration right
collaboration right this is also important what will happen
this is also important what will happen every developer is going to merge your
every developer is going to merge your changes it's going to build what will
changes it's going to build what will happen you're going to get feedback very
happen you're going to get feedback very early right you're going automatically
early right you're going automatically get feedback if there is any issues or
get feedback if there is any issues or anything right and if there is any break
anything right and if there is any break so breakage you can part
so breakage you can part uh easily
then fourth one will be your code will be always deployment ready code right
be always deployment ready code right because you're already building without
because you're already building without an error means you can deploy it in your
an error means you can deploy it in your lower environment and from lower
lower environment and from lower environment you can move this one to
environment you can move this one to stage then you're let's say you're
stage then you're let's say you're having prod so from stage you can move
having prod so from stage you can move it to product extremely important point
it to product extremely important point another one your main branch or master
another one your main branch or master branch is always safe to deploy because
branch is always safe to deploy because what will happen this part also we are
what will happen this part also we are going to discuss that for example let's
going to discuss that for example let's say uh we have like okay let's explain
say uh we have like okay let's explain this one I think it's important so what
this one I think it's important so what I'll do right so let's talk let's take a
I'll do right so let's talk let's take a little time let's do it slowly so first
little time let's do it slowly so first let's say I have a branch here okay and
let's say I have a branch here okay and this is my master branch. Normally we
this is my master branch. Normally we usually have main. Main is standard but
usually have main. Main is standard but for now I'm just using master or main
for now I'm just using master or main whatever doesn't matter. We need to
whatever doesn't matter. We need to understand the concept. That's it. So
understand the concept. That's it. So you have a master or main branch. And
you have a master or main branch. And now let's say
now let's say uh let's copy this one. I have multiple
uh let's copy this one. I have multiple people who are contributing to to this
people who are contributing to to this code. Right?
Okay. Now let's say this is uh developer day one.
day one. This is dev 2 and this is dev 3. Dev in
This is dev 2 and this is dev 3. Dev in the sense I'm talking about developer.
the sense I'm talking about developer. Okay, not dev branch.
Okay, not dev branch. What will happen? You directly push
What will happen? You directly push these changes to master. Now you can do
these changes to master. Now you can do that but it's definitely not
that but it's definitely not recommended. 100% no. The answer is no.
recommended. 100% no. The answer is no. So how you going to do that? So how the
So how you going to do that? So how the actual process will work? What will
actual process will work? What will happen? Your main branch or master
happen? Your main branch or master branch will be always safe, right? Even
branch will be always safe, right? Even if you're working on freelancing, right?
if you're working on freelancing, right? I highly recommend you always follow
I highly recommend you always follow this process. We also follow the same
this process. We also follow the same process strict very very strict you
process strict very very strict you can't merge everything in master right
can't merge everything in master right what will happen what is the best
what will happen what is the best practice I will say like normally what
practice I will say like normally what we should do right we should for every
we should do right we should for every developer should take a fork from this
developer should take a fork from this master branch okay that is the first
master branch okay that is the first step now let's forget about fork for now
step now let's forget about fork for now let's keep this one very simple next
let's keep this one very simple next part I'm going to discuss all this
part I'm going to discuss all this forking and everything so what will
forking and everything so what will happen this developer will going to take
happen this developer will going to take latest pull from this master branch in
latest pull from this master branch in your local okay so definitely they need
your local okay so definitely they need to set upstream and everything right
to set upstream and everything right origin upstream they need to set but I'm
origin upstream they need to set but I'm just talking about the pool and push
just talking about the pool and push mechanism so they will first take a pool
mechanism so they will first take a pool in their local from this master branch
in their local from this master branch and what they will do right they're
and what they will do right they're going to create a feature branch so this
going to create a feature branch so this will be a fe feature branch for example
will be a fe feature branch for example let's say feature branch one then you're
let's say feature branch one then you're going to have a feature branch two
and then you have a feature branch three let's say okay
let's say okay now what will happen right so here what
now what will happen right so here what we're going to do simply so dev one is
we're going to do simply so dev one is going to push the changer or or push the
going to push the changer or or push the branch to the GitHub repository
branch to the GitHub repository similarly dev two will do the same and
similarly dev two will do the same and dev three will do the same what will
dev three will do the same what will happen in our CI right in a CI flow now
happen in our CI right in a CI flow now there is another uh steps you can do
there is another uh steps you can do Right? For example, let's say instead of
Right? For example, let's say instead of directly pushing to the master, you we
directly pushing to the master, you we can have another branch which is
can have another branch which is intermittent branch or de branch. Right?
intermittent branch or de branch. Right? Normally what will happen in very big
Normally what will happen in very big companies they also don't allow you to
companies they also don't allow you to push in the master branch. You can check
push in the master branch. You can check with others if you're working you'll
with others if you're working you'll know that it's 100% true. So you'll have
know that it's 100% true. So you'll have a de branch then what I'll do they will
a de branch then what I'll do they will take the pool their local and they're
take the pool their local and they're going to cut feature branch from the de
going to cut feature branch from the de branch. Okay let me explain this. I
branch. Okay let me explain this. I think it will be easy. I'll just remove
think it will be easy. I'll just remove the move this one here. Right? So what
the move this one here. Right? So what will happen? Let's say they have a
will happen? Let's say they have a master branch and they have a dev branch
master branch and they have a dev branch here. So this is the de current current
here. So this is the de current current develop development branch. So normally
develop development branch. So normally this branch will be cut from the master
this branch will be cut from the master and then this developers is going to
and then this developers is going to pull take pull from this de branch in
pull take pull from this de branch in the local. They're going to cut feature
the local. They're going to cut feature branch to their individual feature
branch to their individual feature branch. What will happen now? They're
branch. What will happen now? They're going to raise a pull request
going to raise a pull request to this dev branch. Similarly, they will
to this dev branch. Similarly, they will do the same and this developer will also
do the same and this developer will also do the same. So now they're going to
do the same. So now they're going to push this to the feature branch to dev
push this to the feature branch to dev branch. In our C ci what will happen
branch. In our C ci what will happen right? We are going to add a step that
right? We are going to add a step that whenever there is a push to the de
whenever there is a push to the de branch we are going to trigger a
branch we are going to trigger a workflow that I'm going to discuss. So
workflow that I'm going to discuss. So once the workflow will be triggered what
once the workflow will be triggered what will happen? It's going to check every
will happen? It's going to check every steps that you mention in that yml file.
steps that you mention in that yml file. So for example, let's say you have test
So for example, let's say you have test cases, you have linting, you have ptr
cases, you have linting, you have ptr and everything. If everything passes
and everything. If everything passes then only this feature branch code will
then only this feature branch code will be merged to the de branch. I hope this
be merged to the de branch. I hope this is clear. If it is failed, so definitely
is clear. If it is failed, so definitely your team member or whoever is your
your team member or whoever is your approver or reviewer, they're not going
approver or reviewer, they're not going to merge this. Right? If there is not
to merge this. Right? If there is not getting merge means until unless that
getting merge means until unless that issue is getting resolved this developer
issue is getting resolved this developer needs to fix these changes to this
needs to fix these changes to this feature branch and once every lint and
feature branch and once every lint and preier and test cases will be
preier and test cases will be automatically resolved. What will happen
automatically resolved. What will happen that PR will be will be showing as like
that PR will be will be showing as like merging is not blocked something like
merging is not blocked something like that means you can now safely merge it.
that means you can now safely merge it. Once it will be merged to dev branch now
Once it will be merged to dev branch now this dev branch will have a latest code.
this dev branch will have a latest code. Then what will happen right? during
Then what will happen right? during deployment cycle. So we have a
deployment cycle. So we have a deployment cycle, right? So you can't
deployment cycle, right? So you can't deploy every every one after another
deploy every every one after another day. You can't do that. So every
day. You can't do that. So every deployment cycle, this de branch will
deployment cycle, this de branch will always have the latest code from all the
always have the latest code from all the feature branches and then they're going
feature branches and then they're going to raise one more pair to the merge
to raise one more pair to the merge master branch. Once they will raise one
master branch. Once they will raise one more pair, there will be one more auto
more pair, there will be one more auto uh GitHub actions flow will be triggered
uh GitHub actions flow will be triggered because master branch will definitely
because master branch will definitely need that uh steps in the CI YML file
need that uh steps in the CI YML file that we are going to see and then if it
that we are going to see and then if it is merged then only this master branch
is merged then only this master branch will be getting deployed. So there is
will be getting deployed. So there is very less possibility that you'll be
very less possibility that you'll be getting any kind of error and
getting any kind of error and everything. I hope this flow it's clear
everything. I hope this flow it's clear right. All right. So now I think I have
right. All right. So now I think I have almost discussed most of the overall
almost discussed most of the overall thing that how it will work. So that
thing that how it will work. So that means if I try to explain this on more
means if I try to explain this on more simpler way. So what I'll say right? So
simpler way. So what I'll say right? So let's say you have this flow something
let's say you have this flow something something like that. So you do p code
something like that. So you do p code right you wait
right you wait you do manual test I'm talking about
you do manual test I'm talking about manual test flow you do maybe deploy and
manual test flow you do maybe deploy and you're going to get a bug. Correct here.
you're going to get a bug. Correct here. What is happening? You're going to push
What is happening? You're going to push your code. You're going to do a auto
your code. You're going to do a auto build. You're going to do a auto test.
build. You're going to do a auto test. You're going to do auto check. Auto
You're going to do auto check. Auto check. I'm talking about ESLint and
check. I'm talking about ESLint and everything. You're going to get feedback
everything. You're going to get feedback right if error. So I'm not writing here.
right if error. So I'm not writing here. If error again do the same process again
If error again do the same process again you post code do auto build auto test
you post code do auto build auto test auto check feedback again error do again
auto check feedback again error do again again post code auto build auto test.
again post code auto build auto test. Once it is feedback is green now you can
Once it is feedback is green now you can raise a pull request and you can merge
raise a pull request and you can merge that to your dev branch or master
that to your dev branch or master branch. Okay. So this will be the
branch. Okay. So this will be the overall flow. So now I think we have
overall flow. So now I think we have covered most of the things. Now let's
covered most of the things. Now let's see how the GitHub actions works right.
see how the GitHub actions works right. So we need to write some configuration.
So we need to write some configuration. Right? So you can see that it's simply
Right? So you can see that it's simply whatever I just mentioned now. So
whatever I just mentioned now. So nothing more new or nothing more new
nothing more new or nothing more new concepts to explain here that it's
concepts to explain here that it's simply automate your workflow. The only
simply automate your workflow. The only thing what we need to now understand
thing what we need to now understand enough concepts we have already
enough concepts we have already discussed. So now let's go to our code
discussed. So now let's go to our code and let's see how this will actually
and let's see how this will actually work right then I'm going to explain
work right then I'm going to explain each and every term that what actually
each and every term that what actually we are doing here. So what I'm going to
we are doing here. So what I'm going to do simply
do simply we'll go to the root of the project.
we'll go to the root of the project. Okay it's very important. So you have
Okay it's very important. So you have your project. This is my project at the
your project. This is my project at the top level. I'm going to add one folder
top level. I'm going to add one folder which will be dot github. Okay. This is
which will be dot github. Okay. This is the first step. So this means that this
the first step. So this means that this GitHub folder will consist all the
GitHub folder will consist all the GitHub related configuration. Here I'm
GitHub related configuration. Here I'm going to add one more folder that will
going to add one more folder that will be my workflows. Very very important you
be my workflows. Very very important you need to follow this structure here. So
need to follow this structure here. So you have workflows. Inside this we are
you have workflows. Inside this we are going to have our CIML
going to have our CIML file. Okay. So this is where we are
file. Okay. So this is where we are going to write all the configuration. So
going to write all the configuration. So now what actually workflow is? So
now what actually workflow is? So workflow is nothing but it's a yml file
workflow is nothing but it's a yml file that describes your uh CI job. Okay,
that describes your uh CI job. Okay, it's like a okay how to explain it's
it's like a okay how to explain it's like a script or like a recipe, right?
like a script or like a recipe, right? It's like a recipe that whatever things
It's like a recipe that whatever things you're going to mention here, it
you're going to mention here, it actually following the same order and
actually following the same order and it's going to execute that workflow. All
it's going to execute that workflow. All right, so this is how it will work. Now
right, so this is how it will work. Now before doing this, I'm just going to
before doing this, I'm just going to leave it like this. Now what we'll do
leave it like this. Now what we'll do right first let's do for now let's close
right first let's do for now let's close this
this first we are going to configure eslint
first we are going to configure eslint and ptier in our code and then we're
and ptier in our code and then we're going to write the workflow and there is
going to write the workflow and there is a reason because then it will be easy to
a reason because then it will be easy to understand or else it will be reverse
understand or else it will be reverse order if I write the workflow and then
order if I write the workflow and then implement the eslint and pier it will be
implement the eslint and pier it will be difficult for you to understand so first
difficult for you to understand so first what I'm going to do right so let's do
what I'm going to do right so let's do one thing I'm just I think open
one thing I'm just I think open something here okay so you can see I
something here okay so you can see I already copied all of these it will save
already copied all of these it will save some time. So first I'm going to install
some time. So first I'm going to install some of the packages on the client side.
some of the packages on the client side. Similarly I'm going to do on the server
Similarly I'm going to do on the server side. Okay. So here you can see that we
side. Okay. So here you can see that we have eslint we have prettier we have
have eslint we have prettier we have eslint/js
eslint/js globals eslint plug-in react hooks and
globals eslint plug-in react hooks and eslint plug-in react refresh. All these
eslint plug-in react refresh. All these we are going to install. So I'm just
we are going to install. So I'm just going to copy this
and I'll add each and everything in the website. You can download it all this
website. You can download it all this see uh if you notice right I have all
see uh if you notice right I have all this just like randomly added this is
this just like randomly added this is for my uh context because I can't we
for my uh context because I can't we can't memorize all this right and
can't memorize all this right and memorizing is also not good so I just
memorizing is also not good so I just copied all of this kept in one place for
copied all of this kept in one place for you what I'll do right I'll add all
you what I'll do right I'll add all these resources in proper order so that
these resources in proper order so that you can download it and you can uh use
you can download it and you can uh use the same okay same I'll do for
the same okay same I'll do for deployment commands all this yml file
deployment commands all this yml file and everything so let's go to our uh
and everything so let's go to our uh client
client folder and I'm going to just install all
folder and I'm going to just install all this. So this will be our first step.
Okay. Now what we need to do right you also need to create a uh yes in config
also need to create a uh yes in config file. I think it's already created here.
file. I think it's already created here. So you can see it's already created all
So you can see it's already created all these. You don't have to do any changes
these. You don't have to do any changes or anything.
or anything. Now what I'm going to do right so here
Now what I'm going to do right so here I'm also going to explain you that what
I'm also going to explain you that what actually each and everything is doing
actually each and everything is doing but before that let's also install the
but before that let's also install the server side dependencies. So for now we
server side dependencies. So for now we only need this eslint and ptr that's it.
Let's go to server and then install.
Okay, I think this is done. So now in the server let's create our eslint. So
the server let's create our eslint. So at the top uh sorry at the root we need
at the top uh sorry at the root we need to create. So eslint dot config.js.
to create. So eslint dot config.js. Okay, the first thing what we're going
Okay, the first thing what we're going to do we'll simply do we'll keep this
to do we'll simply do we'll keep this one very very simple do export default
one very very simple do export default and here I'm just going to add a files
and here I'm just going to add a files config
config right so these file configs will simply
right so these file configs will simply tell us that what are the files that we
tell us that what are the files that we want to check whenever we are going to
want to check whenever we are going to run a yes eslint check okay so here I'm
run a yes eslint check okay so here I'm just going to tell that okay check all
just going to tell that okay check all the JS related files okay so here what I
the JS related files okay so here what I can do simply dot JS that's it so here
can do simply dot JS that's it so here if I add oh sorry here I'll add a
if I add oh sorry here I'll add a command that only
command that only check
check dot js files in server directory or
dot js files in server directory or whatever you can add here that's it next
whatever you can add here that's it next we also need to give comma after this
we also need to give comma after this I'm going to add a rules
I'm going to add a rules so in the rules for now I'll keep this
so in the rules for now I'll keep this one simple that we also need to give a
one simple that we also need to give a semicolon or else we are going to get
semicolon or else we are going to get some error
Okay. And then I'm also going to do if there is a unused variables
there is a unused variables I'm going to want. You can also add
I'm going to want. You can also add errors. You can do lot of configuration
errors. You can do lot of configuration here, right? You can explore. But for
here, right? You can explore. But for now, I think this will be fine. So that
now, I think this will be fine. So that means we are going to add a one if
means we are going to add a one if variables
variables are unused. That's it. Okay. And for
are unused. That's it. Okay. And for this one, we're going to do force
this one, we're going to do force semicolons.
semicolons. Save this. And I think this will be more
Save this. And I think this will be more than enough. The same thing we also need
than enough. The same thing we also need to do for pretier. So for pretier also
to do for pretier. So for pretier also we need to add a dot pretier config
we need to add a dot pretier config file. So I'm just going to add here dot
file. So I'm just going to add here dot pretier. I'm check I need to check the
pretier. I'm check I need to check the spelling here.
Okay. So here simply I'm just going to add semi
add semi and I'm going to give this one as true
and I'm going to give this one as true means always add semicolons. Then I'm
means always add semicolons. Then I'm also going to add a single quote. I'm
also going to add a single quote. I'm going to add this one as two means use
going to add this one as two means use single single quotes instead of double.
single single quotes instead of double. And here you can add one more thing. For
And here you can add one more thing. For example, let's add a print width which
example, let's add a print width which will be 100. So that means we can wrap
will be 100. So that means we can wrap it will automatically wrap the lines at
it will automatically wrap the lines at the 100 characters and that's it. So now
the 100 characters and that's it. So now let's save this. Now what will be our
let's save this. Now what will be our next step right? So in the next step we
next step right? So in the next step we need to go to package.json and we need
need to go to package.json and we need to add a script and that I already
to add a script and that I already written here. So you can see that I
written here. So you can see that I added a lint script a lint fix and this
added a lint script a lint fix and this will be to format it. So just copy these
will be to format it. So just copy these three from here. Don't worry I'll add
three from here. Don't worry I'll add all of this. You'll check just paste it
all of this. You'll check just paste it here.
here. Save this. And this is done. So now to
Save this. And this is done. So now to test it, what we can do, right? Simply
test it, what we can do, right? Simply we'll do let's clear this.
we'll do let's clear this. I'm going to close all the files.
I'm going to close all the files. Now let's go to our server.js
and we'll see what is happening here. Okay, let's do one thing here. I'm just
Okay, let's do one thing here. I'm just going to do npm run lint and let's see
going to do npm run lint and let's see what is happening. Awesome.
So you can see that we are getting this server.js line number 27. This next is
server.js line number 27. This next is defined but never used. You can also do
defined but never used. You can also do controlclick. It will come here. You can
controlclick. It will come here. You can remove this for now. Okay. Or let's I'll
remove this for now. Okay. Or let's I'll just log this here just to show you that
just log this here just to show you that what is happening. Okay. Save this. And
what is happening. Okay. Save this. And now I'll clear this and do the same
now I'll clear this and do the same thing again.
Okay. There is no error. You can see there is no error is found. So this is
there is no error is found. So this is working fine. Now if you want to check
working fine. Now if you want to check the pre here right what I'll do simply
the pre here right what I'll do simply go to settings
go to settings I will just remove this format on save.
I will just remove this format on save. So what is happening currently actually
So what is happening currently actually I have configured that whenever I'm
I have configured that whenever I'm going to save a file it will
going to save a file it will automatically apply pred. So I'm going
automatically apply pred. So I'm going to just uncheck it to show you. Then
to just uncheck it to show you. Then I'm just going to save this. And now
I'm just going to save this. And now I'll do notice here. I'll just do npm
I'll do notice here. I'll just do npm run format.
Awesome. You can see that it's also changed some other no I think this is
changed some other no I think this is this is telling that which file are not
this is telling that which file are not unchanged right. So you can see both are
unchanged right. So you can see both are working right. So that means both
working right. So that means both pretier and both eslint config uh the
pretier and both eslint config uh the configuration both are working on the
configuration both are working on the server side. Similarly we need to do on
server side. Similarly we need to do on the client side. Before that I'll just
the client side. Before that I'll just again save uh check this one. Okay
again save uh check this one. Okay remove this. So now what we need to do
remove this. So now what we need to do we need to understand that what actually
we need to understand that what actually is happening in this eslink config.js
is happening in this eslink config.js file. So first of all let's go one by
file. So first of all let's go one by one. So we'll go to first one. So this
one. So we'll go to first one. So this is just uh some built-in
is just uh some built-in uh rules here that we are importing.
uh rules here that we are importing. This is the browser globals. For
This is the browser globals. For example, we have window document and
example, we have window document and those things, right? This is related to
those things, right? This is related to react hooks rules and this is for our
react hooks rules and this is for our vit first refresh rule. Okay, here we
vit first refresh rule. Okay, here we are just simply ignoring the build
are just simply ignoring the build output because this is where we are
output because this is where we are going to build it in the dish folder. So
going to build it in the dish folder. So here we are telling that which file it
here we are telling that which file it should check and some language options.
should check and some language options. Then we are telling that these all the
Then we are telling that these all the plugins that we want to use. It's simple
plugins that we want to use. It's simple to understand, right? You can add more
to understand, right? You can add more plugins also here. And then we have some
plugins also here. And then we have some rules that first one is that you can see
rules that first one is that you can see like we are actually using some
like we are actually using some recommended rules for the eslint right
recommended rules for the eslint right so that means this is nothing but this
so that means this is nothing but this is eslint recommended
is eslint recommended right then we have some react rule best
right then we have some react rule best practices that we are using no unused
practices that we are using no unused words here that's it so now if you want
words here that's it so now if you want to test this also right uh one more
to test this also right uh one more thing we need to do we need to add the
thing we need to do we need to add the same prettier config in our client
same prettier config in our client folder also just paste it here. That's
folder also just paste it here. That's it. So now what I'm going to do simply
it. So now what I'm going to do simply I'll go to my source. Let's go to app.t
I'll go to my source. Let's go to app.t jsx and I'll just close others and what
jsx and I'll just close others and what I'll do right maybe.
I'll do right maybe. Okay. So I'll just give here let sum is
Okay. So I'll just give here let sum is unused
unused variables
variables here. Okay.
uh we'll go to the client folder and ah also we need to add the
and ah also we need to add the package.json JSON rules, right? Correct.
package.json JSON rules, right? Correct. So, we'll just copy this
So, we'll just copy this and I'll just add it here.
and I'll just add it here. I l It's already added, but we'll just
I l It's already added, but we'll just add it.
clear this. And I'll do npm run lint. Let's see.
That's it. So I got I think two errors here. Then we have in the o dialogue
here. Then we have in the o dialogue also some error we are using. I think
also some error we are using. I think that we are not using
that we are not using see. So I'm just going to log it here.
see. So I'm just going to log it here. Okay. And I'll just run it again.
So one error we are still getting which is here. So I'm just going to
which is here. So I'm just going to comment it and there are it again
and you can see that we are not getting any error. Awesome. So that means this
any error. Awesome. So that means this is working fine. So now what we have
is working fine. So now what we have done we have actually configured both
done we have actually configured both eslint and pretier. So now we need to
eslint and pretier. So now we need to create our CI file. Okay. Now it will be
create our CI file. Okay. Now it will be easy that is the reason I didn't create.
easy that is the reason I didn't create. Now again here we need to add with
Now again here we need to add with proper configuration. I think I have
proper configuration. I think I have already added here. You can see I've
already added here. You can see I've already added all this. But before doing
already added all this. But before doing that let's discuss each and everything
that let's discuss each and everything so that we'll not get any uh uh this
so that we'll not get any uh uh this format error. But I'm going to explain
format error. But I'm going to explain what is happening here everything. Okay.
what is happening here everything. Okay. First one let's copy this. Okay. So I'm
First one let's copy this. Okay. So I'm going to copy this
going to copy this and I'm going to paste it here. Now what
and I'm going to paste it here. Now what is name is here the name is actually the
is name is here the name is actually the workflow name and this is nothing but
workflow name and this is nothing but this is just a label that we are going
this is just a label that we are going to show or it will be shown in the
to show or it will be shown in the GitHub action cy okay
GitHub action cy okay after this let's go here and we have on
after this let's go here and we have on push branches pull request so all this
push branches pull request so all this I'm going to copy
I'm going to copy okay and then I paste it
I think still we are getting some uh we it is missing some property. Okay. What
it is missing some property. Okay. What is on here? So on is nothing but this
is on here? So on is nothing but this will this is going to triggers very very
will this is going to triggers very very important triggers or define I'll say
important triggers or define I'll say define
define when this workflow should run very very
when this workflow should run very very important. So do should run. So that
important. So do should run. So that means we are going to tell sorry we are
means we are going to tell sorry we are simply telling here that uh trigger
simply telling here that uh trigger on push to these branches
on push to these branches means whenever I'm going to push any
means whenever I'm going to push any changes to the master branch or the de
changes to the master branch or the de branch I'm going to run this workflow.
branch I'm going to run this workflow. Okay for now if you're getting confused
Okay for now if you're getting confused you can also remove this uh div only. I
you can also remove this uh div only. I think we are using main here right?
think we are using main here right? Let's do main. I think main is standard.
Let's do main. I think main is standard. So let's use main here. So whenever I'm
So let's use main here. So whenever I'm going to push any changes to this main
going to push any changes to this main branch or the de branch, I'm going to
branch or the de branch, I'm going to run this. Okay, same for the pull
run this. Okay, same for the pull request, right? So that means whenever
request, right? So that means whenever I'm going to so it's saying that run
I'm going to so it's saying that run this on the pull request targeting these
this on the pull request targeting these two branches. I hope this is clear. Now
two branches. I hope this is clear. Now we need to define a job. So let's go
we need to define a job. So let's go here and you can see that we have lot of
here and you can see that we have lot of things we have added here. So I'm just
things we have added here. So I'm just going to copy this
going to copy this complete thing.
Okay. So next we are having jobs. Now here we need to define a job. Now you
here we need to define a job. Now you can define multiple jobs also, right?
can define multiple jobs also, right? You can have multiple jobs also, right?
You can have multiple jobs also, right? Here we are having only one which is
Here we are having only one which is like we have a built and linked. And
like we have a built and linked. And this is important. This is going to run.
this is important. This is going to run. You can see that this is runs on it's
You can see that this is runs on it's important that it's going to run on this
important that it's going to run on this latest Ubuntu based runner that will be
latest Ubuntu based runner that will be provided by GitHub. You don't have to do
provided by GitHub. You don't have to do anything right. It is automatically
anything right. It is automatically going to run and it is going to follow
going to run and it is going to follow all these steps that is mentioned here.
all these steps that is mentioned here. So how this going to work? So first of
So how this going to work? So first of all we have the step one which is going
all we have the step one which is going to telling the check out repo right. So
to telling the check out repo right. So what actually this is doing? So this is
what actually this is doing? So this is nothing but this is check check out your
nothing but this is check check out your repository code right and this is
repository code right and this is required so that GitHub runner has
required so that GitHub runner has access to your project files simple next
access to your project files simple next I think I don't have to explain it's
I think I don't have to explain it's just simply setting up node environment
just simply setting up node environment right so set up nodejs environment same
right so set up nodejs environment same version as your local div now what will
version as your local div now what will happen this also allow the future npm
happen this also allow the future npm commands to work very very important
commands to work very very important right here we have the nodejs version 20
right here we have the nodejs version 20 make sure means here you You need to
make sure means here you You need to make sure that this matches your project
make sure that this matches your project node version. All right, important.
node version. All right, important. Next, we have install backend
Next, we have install backend dependencies. Now, all these are steps,
dependencies. Now, all these are steps, right? It's you see whenever this
right? It's you see whenever this workflow will run, right, it's going to
workflow will run, right, it's going to run all these steps in the same order.
run all these steps in the same order. So, it's simply telling that install
So, it's simply telling that install backend dependencies using uh whatever
backend dependencies using uh whatever uh packages that we we actually
uh packages that we we actually mentioned there, right? This is the
mentioned there, right? This is the working directory that will go to this
working directory that will go to this directory and this is the command that
directory and this is the command that we are going to use. Now next important
we are going to use. Now next important very very important here we are simply
very very important here we are simply thinking that this is our next step
thinking that this is our next step where we are going to run the linting or
where we are going to run the linting or lint for our back end directory same so
lint for our back end directory same so this is the name of the step where to
this is the name of the step where to run so we have the server directory and
run so we have the server directory and this is run this is the command test
this is run this is the command test whenever I'm going to run this mpm run
whenever I'm going to run this mpm run lint remember we have added the step in
lint remember we have added the step in the package dojson right and here what
the package dojson right and here what we are simply telling that we can also
we are simply telling that we can also for now We have some max warnings. You
for now We have some max warnings. You can also fail it like lot of
can also fail it like lot of configuration you can add here in this
configuration you can add here in this run step right whatever you want to do.
run step right whatever you want to do. Same next we have again installing
Same next we have again installing dependencies front end dependencies.
dependencies front end dependencies. Same installing uh this
Same installing uh this lint uh front end which will run the
lint uh front end which will run the linting in your client directory. And
linting in your client directory. And then we are having what this is nothing
then we are having what this is nothing but our docker image that we need
but our docker image that we need whenever we are going to implement CD
whenever we are going to implement CD right. we have as uh as uh AWS EC2
right. we have as uh as uh AWS EC2 deployment and everything. So that time
deployment and everything. So that time we actually need all of this. So we're
we actually need all of this. So we're going to build our back end image and
going to build our back end image and then we are going to build our front end
then we are going to build our front end image. Right? So this will be the
image. Right? So this will be the complete overall workflow. You can have
complete overall workflow. You can have multiple jobs. This is important that
multiple jobs. This is important that for now we are having only one job which
for now we are having only one job which is going to build it and it's going to
is going to build it and it's going to lint do a lint check. Okay. So I think
lint do a lint check. Okay. So I think this will be more than enough. So now we
this will be more than enough. So now we are going to do all of this. So for now
are going to do all of this. So for now what I'll do right. So for now let's
what I'll do right. So for now let's save all of this and what we can do I
save all of this and what we can do I think let's check everything docker
think let's check everything docker compose I think this is fine now I'm
compose I think this is fine now I'm going to test it in GitHub so for now
going to test it in GitHub so for now let's push all these changes okay so all
let's push all these changes okay so all the changes that whatever we have added
the changes that whatever we have added let's add all es
pretier and CI changes right so I'm going to add
and CI changes right so I'm going to add all of this commit
all of this commit and let's post the changes. So let's see
and let's post the changes. So let's see which repository is this. So you can see
which repository is this. So you can see that it's already running the actions
that it's already running the actions but here this is not the final step. We
but here this is not the final step. We need to check lot of other things. So
need to check lot of other things. So for now let's go here and let's see what
for now let's go here and let's see what is happening.
We'll go to actions. Okay, I think it's running now. Let's
Okay, I think it's running now. Let's click here.
And you can see see all the steps. So check out the repo, set up the node,
check out the repo, set up the node, install backend dependencies, you link
install backend dependencies, you link check the lint for your back end,
check the lint for your back end, install front end dependencies, lint
install front end dependencies, lint front end, build backend image, front
front end, build backend image, front end image and post check out repo. This
end image and post check out repo. This is the complete job and this is
is the complete job and this is successful. So this is done. Now let's
successful. So this is done. Now let's see how a real world environment will
see how a real world environment will work. Right? So what I'm going to do,
work. Right? So what I'm going to do, right, let's do step by step. This part
right, let's do step by step. This part will be actually very important.
will be actually very important. So I'm going to clear this.
So I'm going to clear this. Go to the root. Clear again. And I
Go to the root. Clear again. And I believe we have a de branch. I'm going
believe we have a de branch. I'm going to do get checkout
hyphen b. And I'll give feature one.
one. Okay.
Okay. So I'm in a new branch. Now what I'm
So I'm in a new branch. Now what I'm going to do right, let's go to the
going to do right, let's go to the app.jsx
and I'm going to just comment it here. Remove the comment. Save this. Now
Remove the comment. Save this. Now remember I'm on a different branch.
remember I'm on a different branch. Going to push
Going to push new changes.
new changes. I'm going to commit this and I'm going
I'm going to commit this and I'm going to publish this branch.
Now if you go here right let's go to code
code see there is that here it's telling that
see there is that here it's telling that you compare and uh raise a pull request
you compare and uh raise a pull request but before doing that I'm going to go to
but before doing that I'm going to go to my settings
my settings and what I'll do right I'll go to
and what I'll do right I'll go to branches
branches and I'm going to add a classic branch
and I'm going to add a classic branch protection rule
protection rule and here I'll just give some testing
and here I'll just give some testing something like that and I'm going to do
something like that and I'm going to do require a pull request before marging
require a pull request before marging require Approvals I'm going to just
require Approvals I'm going to just remove for now. So require pull request
remove for now. So require pull request and require status checks to pass before
and require status checks to pass before merging. This we actually need. So I'm
merging. This we actually need. So I'm going to select this and here search for
going to select this and here search for build and lint. See okay.
build and lint. See okay. So this means these steps we need to
So this means these steps we need to pass whenever we are going to merge this
pass whenever we are going to merge this feature branch changes to the m main
feature branch changes to the m main branch. I hope you're getting right what
branch. I hope you're getting right what I'm trying to say here. So these two is
I'm trying to say here. So these two is needed and then I'm going to do create.
needed and then I'm going to do create. So I need to give my pass key.
Okay. So I think this is done and now let's go to one more. I think there is
let's go to one more. I think there is some
some Let's go to
No, I think this is fine. Let's see what is happening, right? Accents general.
is happening, right? Accents general. I don't think we have to do any more.
I don't think we have to do any more. Ah, this is what I wanted to check. So,
Ah, this is what I wanted to check. So, default branch is the main branch which
default branch is the main branch which is fine. Nice. Now I'll go to code
is fine. Nice. Now I'll go to code and then I'm going to raise a pull
and then I'm going to raise a pull request. Okay.
request. Okay. So I'll do feature once to main. I'll do
So I'll do feature once to main. I'll do add a new variable
testing. Okay. And now let's
And now let's create a pull request. See what will
create a pull request. See what will happen. Create
And you can see so CI is already running. So GitHub action is running.
running. So GitHub action is running. Now I'm going to go here
Now I'm going to go here and see what is happening in the lint
and see what is happening in the lint part. And you can see there is error.
part. And you can see there is error. Awesome. So that means this is failed.
Awesome. So that means this is failed. So there is unused variables that you've
So there is unused variables that you've added. So now I'll go to back to pull
added. So now I'll go to back to pull request.
So here we are getting still merge request this should not come actually.
request this should not come actually. So that means I have made some mistake
So that means I have made some mistake here in the settings. So normally what
here in the settings. So normally what will happen? We need to
will happen? We need to block this.
block this. Let's go to edit
Let's go to edit something. Oh
something. Oh this I need to give main here. This will
this I need to give main here. This will be the branch name pattern. This is what
be the branch name pattern. This is what I made mistake. So this will be main. So
I made mistake. So this will be main. So now let's save the changes.
now let's save the changes. So now it's applied to one branch.
So now it's applied to one branch. Sorry. So now let's go to the pull
Sorry. So now let's go to the pull request
and you can see it's actually blocked. So margin is blocked due to failing
So margin is blocked due to failing merge requirements. Now what I'll do
merge requirements. Now what I'll do I'll go here. I'll just uncomment this
I'll go here. I'll just uncomment this and then let's say as a developer I'm
and then let's say as a developer I'm just added that okay fixing lint issues.
just added that okay fixing lint issues. I hope you're getting. So now let's p
I hope you're getting. So now let's p the changes and you see this will
the changes and you see this will trigger the action again. So let's wait.
Okay. So now it's actually started.
started. Now let's go and let's see. I think this
Now let's go and let's see. I think this time this will pass.
So now let's go back to pull request and you can see it it's actually
and you can see it it's actually enabled. Now let's merge this. Right? So
enabled. Now let's merge this. Right? So you can merge this.
you can merge this. So now changes are merged to your main
So now changes are merged to your main branch. Awesome. Right. So that's it. I
branch. Awesome. Right. So that's it. I think this is all about the very basic
think this is all about the very basic overview. So this is the same overall
overview. So this is the same overall flow that you should also follow
flow that you should also follow whenever you are working on any like
whenever you are working on any like project like normally like individual
project like normally like individual project also freelancing even if you're
project also freelancing even if you're working in a company I think they will
working in a company I think they will definitely going to follow this similar
definitely going to follow this similar process. Now there are lot of steps that
process. Now there are lot of steps that we haven't covered like we have testing
we haven't covered like we have testing and lot of other things but for now this
and lot of other things but for now this will be more than enough. So that's all
will be more than enough. So that's all about this CI section. Now let's move on
about this CI section. Now let's move on to the next one. So next on what we
to the next one. So next on what we going to do? So we'll be using EC2 for
going to do? So we'll be using EC2 for our deployment and then after that we
our deployment and then after that we are going to implement the CD. So CI we
are going to implement the CD. So CI we have completed then once the deployment
have completed then once the deployment is done we'll be uh do auto CI/CD. So
is done we'll be uh do auto CI/CD. So means auto deployment will happen
means auto deployment will happen whenever you are going to push any
whenever you are going to push any changes. So it's going to do all these
changes. So it's going to do all these CI checks in the yes lint and ptr check
CI checks in the yes lint and ptr check then it's going to deploy the changes to
then it's going to deploy the changes to your EC2. So let's see how we are going
your EC2. So let's see how we are going to do that. All right. So now we will
to do that. All right. So now we will start uh our AWS deployment. So this
start uh our AWS deployment. So this will be another very very important
will be another very very important section but this one will be mostly
section but this one will be mostly practical but still what I'll do right
practical but still what I'll do right I'll give you some basic overview that
I'll give you some basic overview that what actually is AWC2 what is the in
what actually is AWC2 what is the in instance what is the overall flow and
instance what is the overall flow and how we are going to implement this one
how we are going to implement this one practically using our application okay
practically using our application okay so now let's do one thing I'm just going
so now let's do one thing I'm just going to copy this from here and then I'm
to copy this from here and then I'm going to just paste it so here I'm just
going to just paste it so here I'm just going to do AWS
going to do AWS deployment Okay. Now see for this one uh
deployment Okay. Now see for this one uh we are going to use EC2. So what is the
we are going to use EC2. So what is the full form? Full form is elastic compute
full form? Full form is elastic compute cloud. Okay. So here it is like one of
cloud. Okay. So here it is like one of the many core services of AWS. I think
the many core services of AWS. I think you already know that AWS has a lot of
you already know that AWS has a lot of services. So this is one of the one of
services. So this is one of the one of the core services.
the core services. What actually it provides? So it
What actually it provides? So it provides virtual servers, right? So
provides virtual servers, right? So these virtual servers we usually calls
these virtual servers we usually calls as instances. So these all are the very
as instances. So these all are the very very important terms right. What this
very important terms right. What this can do this can actually rent to run
can do this can actually rent to run your applications means these instances
your applications means these instances or virtual servers that you can rent to
or virtual servers that you can rent to run your application on cloud as simple
run your application on cloud as simple as that. So what uh what I mean by that
as that. So what uh what I mean by that so if I try to explain this one very
so if I try to explain this one very simply so let's say two times I just I
simply so let's say two times I just I just keep it here. So let's say you are
just keep it here. So let's say you are I'll do some something you are renting.
I'll do some something you are renting. I'll do you are renting a computer.
I'll do you are renting a computer. Okay.
Okay. So you're renting a computer but you're
So you're renting a computer but you're renting it in the cloud. So you I'll do
renting it in the cloud. So you I'll do like this.
like this. So it's simply renting this computer in
So it's simply renting this computer in the cloud. Right? So here what we can do
the cloud. Right? So here what we can do we can uh we will simply get our CPU
we can uh we will simply get our CPU power RAM storage operating system and
power RAM storage operating system and everything. Right? Why elastic? So what
everything. Right? Why elastic? So what actually mean by elastic? So elastic
actually mean by elastic? So elastic means scalable, right? Scalable means
means scalable, right? Scalable means you can scale up or scale down. You can
you can scale up or scale down. You can change your instance size based on your
change your instance size based on your traffic or whatever other circumstances
traffic or whatever other circumstances that you'll be having, right? And you
that you'll be having, right? And you can also scale out or in means you can
can also scale out or in means you can add or remove uh instances or you can
add or remove uh instances or you can also remove uh sorry you can add new
also remove uh sorry you can add new instances or you can remove existing
instances or you can remove existing instances right how it will actually
instances right how it will actually work. So I'll give you very overall
work. So I'll give you very overall overview. Okay. So let's do here. So
overview. Okay. So let's do here. So I'll just copy this and I'm going to
I'll just copy this and I'm going to paste it here. So first what we'll do as
paste it here. So first what we'll do as I already mentioned so we'll be having
I already mentioned so we'll be having virtual servers that's actually we call
virtual servers that's actually we call instance. So we're going to first launch
instance. So we're going to first launch an instance. Okay. So first we are going
an instance. Okay. So first we are going to do that. What this will do this is
to do that. What this will do this is going to pick a image. Right. So for
going to pick a image. Right. So for this one we are going to use Amazon
this one we are going to use Amazon massing image. We are going to have lot
massing image. We are going to have lot of other images that I'm just going to
of other images that I'm just going to show you. So just remember that it's
show you. So just remember that it's going to pick a machine image. Then what
going to pick a machine image. Then what we going to do? We're going to choose
we going to do? We're going to choose our instance type. That will be our
our instance type. That will be our configuration. Right? We're going to
configuration. Right? We're going to configure the network. We're going to
configure the network. We're going to add storage. And then we'll be having
add storage. And then we'll be having another very very important term that is
another very very important term that is called the key pair. Right? So this key
called the key pair. Right? So this key pair we actually need to launch this
pair we actually need to launch this particular instance. So this will be the
particular instance. So this will be the overall uh flow for this launching an
overall uh flow for this launching an instance. So I'll just repeat again.
instance. So I'll just repeat again. We're going to pick a machine image.
We're going to pick a machine image. We're going to choose the type of that
We're going to choose the type of that instance. We're going to configure the
instance. We're going to configure the network. We're going to add storage if
network. We're going to add storage if any. And we're going to launch this one
any. And we're going to launch this one with a key pair. Okay. Once we'll do
with a key pair. Okay. Once we'll do that, so means once launching of that
that, so means once launching of that instance is done, then what we need to
instance is done, then what we need to do? So, we need to get into that
do? So, we need to get into that instance, right? That means we need to
instance, right? That means we need to get inside of that particular instance.
get inside of that particular instance. Means what we're going to do? We're
Means what we're going to do? We're going to access
going to access that instance or we'll do access that
that instance or we'll do access that instance right how we going to do that
instance right how we going to do that so here we are going to use SSH right
so here we are going to use SSH right so for this one for accessing this we
so for this one for accessing this we actually need our SSH and also here we
actually need our SSH and also here we need that key pair that we will be
need that key pair that we will be getting while launching the instance
getting while launching the instance right once we'll do that we're going to
right once we'll do that we're going to simply just do what we're going to
simply just do what we're going to deploy our application as simple as that
deploy our application as simple as that to deploy the app now here What you
to deploy the app now here What you going to do based on whatever we are
going to do based on whatever we are using? Let's say for now we are using
using? Let's say for now we are using man app which is NodeJS we'll be
man app which is NodeJS we'll be installing NodeJS MongoDB client
installing NodeJS MongoDB client engineix engineix we're not going to
engineix engineix we're not going to cover in this part that will be in the
cover in this part that will be in the next part docker and lot of other things
next part docker and lot of other things right so you just think like this you
right so you just think like this you are deploying your man application you
are deploying your man application you know local machine instead of local
know local machine instead of local machine you are doing this one in a
machine you are doing this one in a inside a cloud that is the difference
inside a cloud that is the difference that's it mean instead of doing locally
that's it mean instead of doing locally you are doing this one inside a cloud
you are doing this one inside a cloud and that cloud has a uh virtual server
and that cloud has a uh virtual server or that cloud has a computer. So just
or that cloud has a computer. So just like your normal physical computer will
like your normal physical computer will have right all the CPU and everything
have right all the CPU and everything and there you you have the virtual
and there you you have the virtual servers that servers called as instance
servers that servers called as instance you're going to launch the instance you
you're going to launch the instance you will access the instance you're going to
will access the instance you're going to deploy the app right and then once this
deploy the app right and then once this is done networking so networking means
is done networking so networking means so what will happen right so you're
so what will happen right so you're going to get a public IP so EC2 will
going to get a public IP so EC2 will give you a public IP that IP you can
give you a public IP that IP you can access and you'll see that your
access and you'll see that your application will be live now we can
application will be live now we can actually do A lot of things we can
actually do A lot of things we can change the IP we can use engineix that
change the IP we can use engineix that we will not cover in this one because
we will not cover in this one because this will be completely basic for now
this will be completely basic for now just know this overall process right I
just know this overall process right I hope this is clear okay so now there are
hope this is clear okay so now there are some key components so first one is the
some key components so first one is the image that I already mentioned so that
image that I already mentioned so that image will have the preconfigured OS and
image will have the preconfigured OS and the template okay then we are going to
the template okay then we are going to have the different type of instance type
have the different type of instance type we're going to have the security groups
we're going to have the security groups IP key pairs so these will be the
IP key pairs so these will be the overall uh key components or key terms
overall uh key components or key terms that you need to know, you must know.
that you need to know, you must know. Okay, how EC2 or this step will fit in
Okay, how EC2 or this step will fit in our uh DevOps pipeline. So what happens?
our uh DevOps pipeline. So what happens? If you're just going to write it once
If you're just going to write it once again, right? So first we're going to do
again, right? So first we're going to do what? We're going to do coding, right?
what? We're going to do coding, right? Then we will be building then we going
Then we will be building then we going to do what? We going to do this on
to do what? We going to do this on deploy. And then we're going to run this
deploy. And then we're going to run this application inside EC2. Run on EC2,
application inside EC2. Run on EC2, right? So do run on EC2. So this is the
right? So do run on EC2. So this is the overall process. All right, that's it.
overall process. All right, that's it. How we are going to do that? So now
How we are going to do that? So now we'll be uh seeing this step by steps.
we'll be uh seeing this step by steps. First you need to open a AWS account
First you need to open a AWS account here. That is mandatory. Okay. So this I
here. That is mandatory. Okay. So this I already created. So just going to sign
already created. So just going to sign in in our console. So once you'll be in
in in our console. So once you'll be in the as a AWS EC2, you can just write it
the as a AWS EC2, you can just write it on Google. Just click on the first link.
on Google. Just click on the first link. You'll be on in this landing page. And
You'll be on in this landing page. And then what you need to do, you need to
then what you need to do, you need to click on this sign into console. Okay.
click on this sign into console. Okay. So I'm just going to just loging and
So I'm just going to just loging and here what I'll do right I'm going to do
here what I'll do right I'm going to do using my root user email. So I'm going
using my root user email. So I'm going to click here. If in case you okay what
to click here. If in case you okay what I'll do let's forget if you're
I'll do let's forget if you're completely new in the in my in my
completely new in the in my in my website where you are going to download
website where you are going to download these resources and everything right I'm
these resources and everything right I'm going to add one more uh file where
going to add one more uh file where you'll be seeing all the uh steps how
you'll be seeing all the uh steps how you can open AWS account. So that I will
you can open AWS account. So that I will do for sure. So here what I'm going to
do for sure. So here what I'm going to do is just to log in with my account.
I need to give my code. Okay. So I just give the code
give the code 073.
All right. So you can see that I have some instances already created. But
some instances already created. But first of all if you're doing seeing this
first of all if you're doing seeing this on first time it it'll be like okay what
on first time it it'll be like okay what the hell is this you'll be seeing lot of
the hell is this you'll be seeing lot of things not here once I'll go to the EC2
things not here once I'll go to the EC2 console. So for now here you just go to
console. So for now here you just go to EC2 if you've recently visited or else
EC2 if you've recently visited or else you can also search from here right you
you can also search from here right you can search simply EC2 you'll get okay so
can search simply EC2 you'll get okay so just I'm going to click here and once
just I'm going to click here and once you'll go to the homepage of that is it
you'll go to the homepage of that is it will be seen lot of things are happening
will be seen lot of things are happening okay now if I want to create a video on
okay now if I want to create a video on this this video this explaining all of
this this video this explaining all of this will take 2 hours so for now see
this will take 2 hours so for now see you know right how I usually teach on
you know right how I usually teach on all my videos if you're a beginner a
all my videos if you're a beginner a complete beginner I would highly suggest
complete beginner I would highly suggest for now you ignore everything just focus
for now you ignore everything just focus on instances once I launch the part two
on instances once I launch the part two and part three of this devops series
and part three of this devops series right so okay one more thing there will
right so okay one more thing there will be part three also you'll understand how
be part three also you'll understand how much depth we'll be going into okay for
much depth we'll be going into okay for now just whatever I'm saying just follow
now just whatever I'm saying just follow what I'll do simply we'll go to
what I'll do simply we'll go to instances here okay and you'll be seeing
instances here okay and you'll be seeing your running instances you see that I
your running instances you see that I just added a test uh instances here for
just added a test uh instances here for you what we need to do we need to
you what we need to do we need to actually go to this launch instances.
actually go to this launch instances. Okay, right side. So just click here.
Okay, so here you'll be seeing all of these things. So first you're seeing the
these things. So first you're seeing the name. So what I'll do right here, I'll
name. So what I'll do right here, I'll simply just do man
simply just do man DevOps. Okay, course
next you can see this is the image Amazon machine image AMI. You'll see
Amazon machine image AMI. You'll see you'll be getting lot of options. Ubuntu
you'll be getting lot of options. Ubuntu is very very popular. But what I've
is very very popular. But what I've decided for this particular video,
decided for this particular video, right? I'm going to use Amazon Linux
right? I'm going to use Amazon Linux because every you'll see you search on
because every you'll see you search on YouTube everyone is using Ubuntu. So I'm
YouTube everyone is using Ubuntu. So I'm I decided to use Amazon Linux. So just
I decided to use Amazon Linux. So just keep it like this. It's already auto
keep it like this. It's already auto selected. Okay, you don't have to do
selected. Okay, you don't have to do anything else. Just come here and you'll
anything else. Just come here and you'll see that you'll be getting all this
see that you'll be getting all this instance type. And this is actually the
instance type. And this is actually the free tire. After sometime I think they
free tire. After sometime I think they will charge money but for now you just
will charge money but for now you just leave it like this. So use this T3
leave it like this. So use this T3 micro. This is the instance type. This
micro. This is the instance type. This you need to select and then you'll be
you need to select and then you'll be having the key pair. Key pair is nothing
having the key pair. Key pair is nothing but this is the key that we need
but this is the key that we need whenever we are going to access this
whenever we are going to access this instance locally in our terminal. As
instance locally in our terminal. As simple as that. And now here you can see
simple as that. And now here you can see that I already have some key pair
that I already have some key pair already created. So what I'll do right I
already created. So what I'll do right I can either select uh maybe one of these
can either select uh maybe one of these or let's create one more. Okay. So I'm
or let's create one more. Okay. So I'm going to do create new. So I'll just
going to do create new. So I'll just keep PM file and I'll do key pair
keep PM file and I'll do key pair 3. Okay. And let's do create
3. Okay. And let's do create and you can see that this will be
and you can see that this will be downloaded. So now what I'll do I'll go
downloaded. So now what I'll do I'll go to this location
and then I'll just cut it from here. What I need to do I need to go to C
What I need to do I need to go to C drive then I need to go to users. Okay.
drive then I need to go to users. Okay. So this uh can change based on the
So this uh can change based on the system or machine that you're using and
system or machine that you're using and then what I'll do I'll go to my account
then what I'll do I'll go to my account and here you can see that you'll be
and here you can see that you'll be getting this SSH. So I just wanted to
getting this SSH. So I just wanted to keep it here. So I'll just go in this
keep it here. So I'll just go in this folder and you can see that I just going
folder and you can see that I just going to paste it. Okay, that's it. So now
to paste it. Okay, that's it. So now what we need to do we'll go back and
what we need to do we'll go back and then we need to first I'll select all
then we need to first I'll select all this allow https and http and then I
this allow https and http and then I need to edit some network settings. So
need to edit some network settings. So what I'll do I'll just click edit and
what I'll do I'll just click edit and here you can see that you'll be getting
here you can see that you'll be getting first of all this is actually to connect
first of all this is actually to connect your SSH instance. So this is needed
your SSH instance. So this is needed which will connect with port 22. So you
which will connect with port 22. So you don't have to make any change here. Just
don't have to make any change here. Just keep it like this.
keep it like this. Here if you notice we have a port range
Here if you notice we have a port range of 443 and 80. Now because currently we
of 443 and 80. Now because currently we are not we are actually for back end we
are not we are actually for back end we using 5,000 and for uh front end we are
using 5,000 and for uh front end we are using 5173. So I'm just going to change
using 5173. So I'm just going to change this one like that in the next part when
this one like that in the next part when I'm going to show you that engineix and
I'm going to show you that engineix and reverse proxy and then we are going to
reverse proxy and then we are going to see that how we can make this one more
see that how we can make this one more configurable and what will be the
configurable and what will be the process. We are going to see that in the
process. We are going to see that in the next part. So for now what I'm going to
next part. So for now what I'm going to do right I just click here and then go
do right I just click here and then go to the top and then select custom TCP.
to the top and then select custom TCP. Okay. And here I'm just going to give
Okay. And here I'm just going to give this one as 5,000.
this one as 5,000. Awesome. Now what I'll do I'll just keep
Awesome. Now what I'll do I'll just keep it like this. Uh for now I'll just going
it like this. Uh for now I'll just going to like connect it from anywhere. If you
to like connect it from anywhere. If you want you can also give your custom IP or
want you can also give your custom IP or you can give your current IP or IP of
you can give your current IP or IP of your machine. I hope you're getting. So
your machine. I hope you're getting. So for now I'm just going to do it like
for now I'm just going to do it like this. Go to the second one. I think I've
this. Go to the second one. I think I've already done right. Go to the third one.
already done right. Go to the third one. And then again I'll do the same process.
And then again I'll do the same process. I'll go to custom TCP and then I'm going
I'll go to custom TCP and then I'm going to change this one to 5173.
to change this one to 5173. Okay. And I think this is done. And for
Okay. And I think this is done. And for now you don't have to make any changes.
now you don't have to make any changes. Now remember you have to be very careful
Now remember you have to be very careful if you're giving any configuration
if you're giving any configuration because AWS actually needs money. I'm
because AWS actually needs money. I'm not exactly sure what is their tire. You
not exactly sure what is their tire. You guys if you guys know you guys can
guys if you guys know you guys can comment out. I think uh comment it down.
comment out. I think uh comment it down. I think after some uses they will charge
I think after some uses they will charge some money and uh like their charges are
some money and uh like their charges are very high. Okay. So for now what I'll
very high. Okay. So for now what I'll just go one more time. So given one name
just go one more time. So given one name man DevOps course. I selected Amazon
man DevOps course. I selected Amazon Linux as the image. I selected and
Linux as the image. I selected and created one keeper. I downloaded the
created one keeper. I downloaded the file and inside keep inside our in my
file and inside keep inside our in my local C drive and then I added some
local C drive and then I added some custom settings. Okay. So we have the
custom settings. Okay. So we have the SSH this is mandatory this you need to
SSH this is mandatory this you need to have then we have a 5,000 TCP custom TCP
have then we have a 5,000 TCP custom TCP and 5173 okay and that's uh this is
and 5173 okay and that's uh this is done. So now what I need to do right
done. So now what I need to do right just click on launch instance. So I'm
just click on launch instance. So I'm going to do a click.
going to do a click. Now this will take some time then what
Now this will take some time then what we need to do what will be our next
we need to do what will be our next step. So next step will be we need to I
step. So next step will be we need to I think this is done. So now let's go here
think this is done. So now let's go here and you'll see that there are two things
and you'll see that there are two things I want you to focus here. Okay, let's
I want you to focus here. Okay, let's wait for some time.
wait for some time. Awesome. So now you can see that we have
Awesome. So now you can see that we have the ID and everything. First we have a
the ID and everything. First we have a public uh IP address, right? So this we
public uh IP address, right? So this we need. Second, if you scroll down, you'll
need. Second, if you scroll down, you'll see that one more important thing that
see that one more important thing that is keep your assigned at launch. This is
is keep your assigned at launch. This is very very important, right? because this
very very important, right? because this actually need to connect with SSH
actually need to connect with SSH whenever you're going to connect or
whenever you're going to connect or access this instance locally. So now
access this instance locally. So now what I'm going to do right so let's just
what I'm going to do right so let's just open our command line.
Now the first thing to launch this one what we are going to do now I'm going to
what we are going to do now I'm going to add each and everything in the doc that
add each and everything in the doc that you can download but still I wanted to
you can download but still I wanted to explain this one clearly. So first I'm
explain this one clearly. So first I'm going to do sshen
going to do sshen I and now you need to give your path.
I and now you need to give your path. Now from where you'll be getting the
Now from where you'll be getting the path. So just go here just copy this
path. So just go here just copy this path where you have past it. So copy
path where you have past it. So copy this
this just paste it. And now what you need to
just paste it. And now what you need to do here you need to give slash again and
do here you need to give slash again and you need to give the name of the file.
you need to give the name of the file. So in my case key pair 3 dot PM. Okay.
And then just paste it here. Awesome. Now what you need to do here it is very
Now what you need to do here it is very very important because we're using
very important because we're using Amazon Linux. Remember we have selected
Amazon Linux. Remember we have selected that image. So we need to we will give
that image. So we need to we will give EC2-
EC2- user at the rate and then I'll go here
user at the rate and then I'll go here and then copy this IP address. So I'm
and then copy this IP address. So I'm going to copy this and then you'll see
going to copy this and then you'll see that if I go here and paste it and then
that if I go here and paste it and then I'm just going to do enter.
I'm just going to do enter. Okay. So first time you'll get that it
Okay. So first time you'll get that it can't be established. You want to like
can't be established. You want to like uh continue connecting. I'll do yes
uh continue connecting. I'll do yes enter.
enter. Awesome. So you're inside your now uh I
Awesome. So you're inside your now uh I will not say VPS inside your EC2
will not say VPS inside your EC2 instance. Okay. And you can see the
instance. Okay. And you can see the image it's already coming Amazon Linux.
image it's already coming Amazon Linux. Awesome. So this is done. That means you
Awesome. So this is done. That means you don't get any permissions issues or
don't get any permissions issues or anything. If you're getting any
anything. If you're getting any permission related issues, you need to
permission related issues, you need to specifically tell me in the comments.
specifically tell me in the comments. I'll give you the solution for that. So
I'll give you the solution for that. So now what we need to do there are a
now what we need to do there are a couple of things. So if I go here right,
couple of things. So if I go here right, I think I need to I'll just open the
I think I need to I'll just open the command file quickly. Okay. So you can
command file quickly. Okay. So you can see that I clearly noted down everything
see that I clearly noted down everything here. The first one we have already
here. The first one we have already done. We need to connect. Second, I'm
done. We need to connect. Second, I'm going to create a file and this file I
going to create a file and this file I have already added here. So we will add
have already added here. So we will add a script file. So first let me explain
a script file. So first let me explain what we have. So first we need to update
what we have. So first we need to update all the system packages that we need. We
all the system packages that we need. We need to install Docker. We need to add
need to install Docker. We need to add our EC2 user to our Docker group. Right?
our EC2 user to our Docker group. Right? Then we are going to enable the Docker
Then we are going to enable the Docker service. We're going to start it and
service. We're going to start it and then we are going to verify. Once this
then we are going to verify. Once this is done, then we're going to exit and
is done, then we're going to exit and then login again. And you'll see the
then login again. And you'll see the Docker is installed. one that is once
Docker is installed. one that is once the docker is installed next what we are
the docker is installed next what we are going to do we're going to make this one
going to do we're going to make this one executable okay that file
executable okay that file no sorry my bad so this is the script
no sorry my bad so this is the script that we have created first we're going
that we have created first we're going to execute that file or make it
to execute that file or make it executable then we're going to run it
executable then we're going to run it once this is done then we are going to
once this is done then we are going to exit and again verify that docker is
exit and again verify that docker is installed or not once docker installed
installed or not once docker installed then we are going to install docker
then we are going to install docker compose right these two things we're
compose right these two things we're going to again make this one executable
going to again make this one executable and Check docker compose version. Once
and Check docker compose version. Once this is done, I'm just giving you the
this is done, I'm just giving you the overview. We're going to do a step by
overview. We're going to do a step by step. Once the docker compose is
step. Once the docker compose is installed because we definitely need
installed because we definitely need docker compose, we are going to install
docker compose, we are going to install g. Okay. Once this is g is installed,
g. Okay. Once this is g is installed, then we are going to pull our
then we are going to pull our repository. There are quite a few
repository. There are quite a few process that we need to follow. Once
process that we need to follow. Once we'll do that, then we're going to
we'll do that, then we're going to create two env files inside EC2. One
create two env files inside EC2. One will be for server, one will be for
will be for server, one will be for client. Okay. Next, once we'll do that,
client. Okay. Next, once we'll do that, then we'll go to our local code. We are
then we'll go to our local code. We are going to add two more file. One will be
going to add two more file. One will be docker ignore file. Means whenever we're
docker ignore file. Means whenever we're going to push the changes or deploy it,
going to push the changes or deploy it, what are the files that docker should
what are the files that docker should ignore just like get ignore. So we'll be
ignore just like get ignore. So we'll be adding one docker ignore inside server
adding one docker ignore inside server folder. One will be inside client folder
folder. One will be inside client folder and then we're going to make slight
and then we're going to make slight changes in our docker file of the server
changes in our docker file of the server side. Okay. Once we'll do that, we'll
side. Okay. Once we'll do that, we'll again come back to our ss uh ssh
again come back to our ss uh ssh instance or e2 instance. We're going to
instance or e2 instance. We're going to pull that latest changes and then we're
pull that latest changes and then we're going to run docker compos build. Once
going to run docker compos build. Once we'll do that you'll see that your
we'll do that you'll see that your application will be live inside uh EC2.
application will be live inside uh EC2. Now this is like quite a few process but
Now this is like quite a few process but if you do this on multiple tension for
if you do this on multiple tension for example for me it's like I've done lot
example for me it's like I've done lot of things I can do very quickly but I'm
of things I can do very quickly but I'm not going to do that. I'll do very very
not going to do that. I'll do very very simple way. So first what I'm going to
simple way. So first what I'm going to do right here. Let's do see now I'm
do right here. Let's do see now I'm actually inside this. Okay. So I'm going
actually inside this. Okay. So I'm going to do nano. Okay. Let's do slowly. I'll
to do nano. Okay. Let's do slowly. I'll do install
do install and then I'm going to give sorry let's
and then I'm going to give sorry let's give nano install docker and I'm going
give nano install docker and I'm going to give this one as Amazon.sh.
I'll hit enter. So you'll be getting our uh here we need to paste it. So what
uh here we need to paste it. So what I'll do right I'll go here and then I'm
I'll do right I'll go here and then I'm just going to copy all of this. So I
just going to copy all of this. So I already mentioned right what we are
already mentioned right what we are doing here. So let's go back.
doing here. So let's go back. So I'll just paste it. And then to save
So I'll just paste it. And then to save this, what you're going to do, right,
this, what you're going to do, right, we're going to do Ctrl O first. Ctrl O
we're going to do Ctrl O first. Ctrl O enter. And then we need to exit. So Ctrl
enter. And then we need to exit. So Ctrl X. So Ctrl O entertainable.
So what I'll do right I'll go here and then here we have the file name. So what
then here we have the file name. So what file name we have given we given the
file name we have given we given the file name as remember install
file name as remember install right docker
right docker amazon.
amazon. So I'm going to just copy this
So I'm going to just copy this and then I'll go inside
and then I'll go inside and enter. So this is done and now what
and enter. So this is done and now what we need to do we need to run it. So I'll
we need to do we need to run it. So I'll do because it will be in this part I'll
do because it will be in this part I'll do just install
amazon.sh right and let's hit enter and you see
right and let's hit enter and you see it's already updating the system
it's already updating the system packages. It will take some time once
packages. It will take some time once this is done then we're going to see
this is done then we're going to see that if docker is installed or not. So
that if docker is installed or not. So let's wait for some time.
That's it. So you can see that it took quite a few time. I intentionally didn't
quite a few time. I intentionally didn't pause it so that you guys can check. So
pause it so that you guys can check. So now what I'm going to do right. So the
now what I'm going to do right. So the installation is actually completed. So
installation is actually completed. So I'm going to first exit. Now it is
I'm going to first exit. Now it is closed. So I'll just connect again.
closed. So I'll just connect again. Okay. So you can see that I follow the
Okay. So you can see that I follow the same one that we have used and hit
same one that we have used and hit enter.
enter. Okay. Now what I going to do? Simply
Okay. Now what I going to do? Simply docker
docker - version, right? To check the version.
- version, right? To check the version. Enter. And you can see it's already
Enter. And you can see it's already installed. Awesome. So now what next?
installed. Awesome. So now what next? Next step will be we need to actually
Next step will be we need to actually install Docker Compose. But before that
install Docker Compose. But before that we need to create a CLI directory,
we need to create a CLI directory, plug-in directory. So for that I'm going
plug-in directory. So for that I'm going to just use this pseudo MKDR command.
to just use this pseudo MKDR command. I'll just copy it in this
I'll just copy it in this and then I'll just paste it. Enter. And
and then I'll just paste it. Enter. And then I'm going to install the Docker.
then I'm going to install the Docker. So I'm going to copy this sorry Docker
So I'm going to copy this sorry Docker compose. And then I'm going to paste it.
compose. And then I'm going to paste it. Enter.
Okay. Then I'm going to make the file executable.
Awesome. And now this is done. So I'll do docker compose
do docker compose version. Enter. And this is installed.
version. Enter. And this is installed. That's it. So now docker we have
That's it. So now docker we have installed. Docker compose we have
installed. Docker compose we have installed. Right? So what will be next
installed. Right? So what will be next step? Next step will be we need to
step? Next step will be we need to install g. And to do that, we are going
install g. And to do that, we are going to use this pseudo DNF install by Git.
to use this pseudo DNF install by Git. So I'm going to copy this.
So I'm going to copy this. And then I'm going to paste it.
And then I'm going to paste it. Enter.
That's it. This is done. So now what I'm going to do, right, we're going to clone
going to do, right, we're going to clone our repo. So I just quickly pause this.
our repo. So I just quickly pause this. I'll open the repository on GitHub. All
I'll open the repository on GitHub. All right. So now first we need to clone
right. So now first we need to clone this. So we'll go here copy this and
this. So we'll go here copy this and then see here first of all you need to
then see here first of all you need to do as usual get clone paste it. Now here
do as usual get clone paste it. Now here you need to give a name and this name
you need to give a name and this name will be the name inside your instance.
will be the name inside your instance. Okay. So the name of the app inside
Okay. So the name of the app inside instance. So for example I'm giving the
instance. So for example I'm giving the name as app. So this will be the name.
name as app. So this will be the name. If you can give man devop course man
If you can give man devop course man task app whatever you want to give it's
task app whatever you want to give it's up to you. I'll just do enter.
up to you. I'll just do enter. Awesome. So this is done. So now I'll go
Awesome. So this is done. So now I'll go inside this.
inside this. All right. The first thing what we need
All right. The first thing what we need to do right. So first of all we need to
to do right. So first of all we need to create a env file for the server. So I'm
create a env file for the server. So I'm going to do nano and I'll do server/env
enter. Now I'll go here and let's copy this.
this. Paste it. I'll do control O enter.
Paste it. I'll do control O enter. Controll X. Okay. So this is done. Now
Controll X. Okay. So this is done. Now next thing for client side what we're
next thing for client side what we're going to do right
going to do right uh because we will be adding docker
uh because we will be adding docker ignore files. So docker ignore is
ignore files. So docker ignore is nothing but it's similar to g ignore. So
nothing but it's similar to g ignore. So there in that particular file we are
there in that particular file we are going to mention that what are the files
going to mention that what are the files or folders we are not we are not going
or folders we are not we are not going to include in docker. So that will be
to include in docker. So that will be our docker ignore file. So first let's
our docker ignore file. So first let's create the docker ignore in both
create the docker ignore in both directory for both client and server. So
directory for both client and server. So first I'm going to do here. I'll go here
first I'm going to do here. I'll go here and I'll do docker ignore.
and I'll do docker ignore. Okay, copy this.
Okay, copy this. And then I'll do the same in the client
And then I'll do the same in the client directory also.
directory also. So now first of all let's go here. I can
So now first of all let's go here. I can have just copied all the things.
have just copied all the things. So copy server one and then I'll just
So copy server one and then I'll just paste it here. Same I'll do for client.
Okay. Now next what we need to do right we need to go to client side
we need to go to client side package.json
package.json and here we're going to add our host. So
and here we're going to add our host. So in our EC2 we have added our host as
in our EC2 we have added our host as 0000 this host right. So this we are
0000 this host right. So this we are going to use. So I'm just copy this that
going to use. So I'm just copy this that there are multiple ways we can do that.
there are multiple ways we can do that. So this is one of the simplest way in
So this is one of the simplest way in the next part when you'll be using
the next part when you'll be using engineext and everything you'll be
engineext and everything you'll be learning everything in depth. I'm
learning everything in depth. I'm mentioning all this multiple times in
mentioning all this multiple times in case you are thinking that why we are
case you are thinking that why we are doing so I'm showing you different
doing so I'm showing you different different aspect. So this is one of the
different aspect. So this is one of the way you can do this because we're using
way you can do this because we're using specifically 5173 port. So what will
specifically 5173 port. So what will happen right and also if you see that
happen right and also if you see that the mapping in the EC2 instance the
the mapping in the EC2 instance the custom TCP that we have created we have
custom TCP that we have created we have the mapping of this with this particular
the mapping of this with this particular port. Similarly for back end we are
port. Similarly for back end we are using 5,000. So whenever we are going to
using 5,000. So whenever we are going to access our application we need to give
access our application we need to give the public IP colon the name of the port
the public IP colon the name of the port sorry the port uh number which is 5173
sorry the port uh number which is 5173 then only we can access that
then only we can access that application. So this is another step.
application. So this is another step. Next what we need to do right uh we need
Next what we need to do right uh we need to go to our docker file in the client
to go to our docker file in the client side and here I'm going to just already
side and here I'm going to just already added all this here. So you can see that
added all this here. So you can see that first I'm going to add arg which will be
first I'm going to add arg which will be our backend API URL that we need and
our backend API URL that we need and here what I'm going to do simply I'm
here what I'm going to do simply I'm going to add env. So this env will
going to add env. So this env will automatically pick from our docker
automatically pick from our docker compose file which will be this arg. So
compose file which will be this arg. So I'm just going to copy these two. We
I'm just going to copy these two. We have the build command. So after this
have the build command. So after this I'm going to just paste it. Save this.
I'm going to just paste it. Save this. And next thing what we need to do we
And next thing what we need to do we need to go to docker compose. And here I
need to go to docker compose. And here I already added this. So go here. You can
already added this. So go here. You can see that I just added that args. So this
see that I just added that args. So this is the args and here I have added this
is the args and here I have added this vit API URL which we have our IP public
vit API URL which we have our IP public IP col 5,000/ API. So this is where we
IP col 5,000/ API. So this is where we are going to access our back end API. So
are going to access our back end API. So I'm going to copy this
I'm going to copy this and then I'll simply just paste it here.
and then I'll simply just paste it here. Okay. So now let's save this and I think
Okay. So now let's save this and I think all of this is done. So these all the
all of this is done. So these all the changes that we need to do. I'm doing
changes that we need to do. I'm doing directly in the main uh branch. So I
directly in the main uh branch. So I just changed the branch. The reason is
just changed the branch. The reason is again we need to raise appear. So for
again we need to raise appear. So for now I'm just going to directly push it.
now I'm just going to directly push it. So create a docker compose modification
So create a docker compose modification for this. Added two docker ignore files.
for this. Added two docker ignore files. In the package dojson we added our uh in
In the package dojson we added our uh in the preview command. We added our port
the preview command. We added our port and then the docker file changes for
and then the docker file changes for this arc that we need to do access. So
this arc that we need to do access. So I'll do add
I'll do add docker ignore changes. So let's pose
docker ignore changes. So let's pose these changes.
So I think this is done. So now let's go to our EC2 instance and I'm going to do
to our EC2 instance and I'm going to do get pull
get pull enter.
enter. Awesome. And I'm going to do docker
Awesome. And I'm going to do docker compose build.
compose build. Enter. Something is wrong here. Okay.
Enter. Something is wrong here. Okay. Additional property front is not
Additional property front is not allowed.
Oh, I think there is some indentation error, right? I think.
error, right? I think. Okay.
So, let's Who's this indentation fix? Let's see.
Okay, let's wait and see if it is fixing.
Okay. So I think this is done. So now let's go here again. Lit pool.
let's go here again. Lit pool. Okay. Now let's try again.
Okay. Now let's try again. Okay. See I told you right it's ended
Okay. See I told you right it's ended the syntax. Awesome. So now I do docker
the syntax. Awesome. So now I do docker compose up if nd
compose up if nd and then I'll do docker compose
and then I'll do docker compose ps.
ps. Okay. So you can see this is the entry
Okay. So you can see this is the entry point with this custom tcps. We'll do
point with this custom tcps. We'll do docker compose logs.
docker compose logs. So this is working. So now what we'll do
So this is working. So now what we'll do right we'll just copy this. I've already
right we'll just copy this. I've already tested this and then we'll just paste it
tested this and then we'll just paste it here with this colon. Remember we need
here with this colon. Remember we need to give this colon. Hit enter
to give this colon. Hit enter and you can see that this is now working
and you can see that this is now working and this is inside the this is working
and this is inside the this is working uh like running inside your EC2
uh like running inside your EC2 instance. Now I'll go to network and if
instance. Now I'll go to network and if you see right it's actually taking from
you see right it's actually taking from your 5,000/ AP/ task. Let's add a new
your 5,000/ AP/ task. Let's add a new task
task testing.
Awesome. So refresh this. Okay. Now let's delete
Okay. Now let's delete and this is working fine. Now this is
and this is working fine. Now this is the overall flow of uh like deploying
the overall flow of uh like deploying your man app or any app like I'm not
your man app or any app like I'm not talking about the man app. So there
talking about the man app. So there might be some changes but overall the
might be some changes but overall the concept will be same right. So you're
concept will be same right. So you're going to create a docker file docker
going to create a docker file docker compose you're going to manage your env
compose you're going to manage your env you'll be uh creating your uh EC2
you'll be uh creating your uh EC2 instance you're going to launch it.
instance you're going to launch it. You're going to access it from your
You're going to access it from your local terminal. You're going to push
local terminal. You're going to push your code in uh in that instance and
your code in uh in that instance and then you're going to build it. Now you
then you're going to build it. Now you remember I already told you I just
remember I already told you I just wanted to confirm once again. Remember
wanted to confirm once again. Remember these all these uh mapping of these
these all these uh mapping of these ports we are doing because we have added
ports we are doing because we have added a custom port in our EC2 instance. In
a custom port in our EC2 instance. In the next part I'm going to show you very
the next part I'm going to show you very very advanced way of managing all of
very advanced way of managing all of these and lot of other things we are
these and lot of other things we are going to learn practically and also
going to learn practically and also conceptually right. So there will be
conceptually right. So there will be more concept in the next part also. So
more concept in the next part also. So in this one I just wanted to give you a
in this one I just wanted to give you a very practical beginner way of
very practical beginner way of implementing all of this so that you'll
implementing all of this so that you'll get very basic idea just like I've
get very basic idea just like I've created my node J series if you have
created my node J series if you have already watch you'll understand that
already watch you'll understand that what I'm talking about here. So this is
what I'm talking about here. So this is one of the way now definitely there are
one of the way now definitely there are a lot of process involved I highly
a lot of process involved I highly suggest please practice all of these
suggest please practice all of these multiple times then only what happened
multiple times then only what happened whenever I'll do this recording and
whenever I'll do this recording and everything right sometimes I'll get
everything right sometimes I'll get multiple issues I'm going to pause it
multiple issues I'm going to pause it I'm going to learn it and then I'm going
I'm going to learn it and then I'm going to uh do it again and then I'm going to
to uh do it again and then I'm going to teach all of you so what I'm trying to
teach all of you so what I'm trying to say it's not like I'll just copy paste
say it's not like I'll just copy paste and get the answer I invest lot of times
and get the answer I invest lot of times not only learning but creating these
not only learning but creating these videos so that is the reason you'll see
videos so that is the reason you'll see that I usually take like I usually
that I usually take like I usually upload very less videos that I'm trying
upload very less videos that I'm trying my best to upload more videos but I'm
my best to upload more videos but I'm just giving you the advice that how
just giving you the advice that how you're going to learn all of these
you're going to learn all of these you'll be facing lot of issues you need
you'll be facing lot of issues you need to learn multiple ways of implementing
to learn multiple ways of implementing so this is one of the way that I've just
so this is one of the way that I've just showed you right all this now there are
showed you right all this now there are different way right when you're going to
different way right when you're going to implement engineix and reverse box right
implement engineix and reverse box right it will make our life much easier but
it will make our life much easier but for now I highly suggest please keep it
for now I highly suggest please keep it like till this much if you're beginner
like till this much if you're beginner and then we're going to move on to the
and then we're going to move on to the next one which will be CD so CI we have
next one which will be CD so CI we have already implemented CD will be
already implemented CD will be continuous uh deployment. See what is
continuous uh deployment. See what is happening right now. Every time you're
happening right now. Every time you're going to push the changes, what you're
going to push the changes, what you're doing? You're going here. You're going
doing? You're going here. You're going to docker compose down. You're going to
to docker compose down. You're going to pull the code. You're going to again
pull the code. You're going to again build it again. You're going to up the
build it again. You're going to up the containers. So, this is the overall
containers. So, this is the overall process. Now, every time you don't want
process. Now, every time you don't want to do that, right? Even if it's your
to do that, right? Even if it's your personal project or it's your
personal project or it's your freelancing project, what you are going
freelancing project, what you are going to do, we are going to configure all of
to do, we are going to configure all of this in our GitHub. And then every time
this in our GitHub. And then every time I'm going to push the changes, it will
I'm going to push the changes, it will automatically pull the latest code in
automatically pull the latest code in our SSA uh in our EC2 instance, it is
our SSA uh in our EC2 instance, it is going to build it and then you're going
going to build it and then you're going to get the updated result whenever
to get the updated result whenever you're going to access your uh EC2 IP
you're going to access your uh EC2 IP right here. Whenever you'll go here,
right here. Whenever you'll go here, we're going to get the updated result.
we're going to get the updated result. So let's see how we are going to do that
So let's see how we are going to do that in the next part. All right, every so
in the next part. All right, every so now let's start with uh continuous
now let's start with uh continuous deployment section. Now this will be a
deployment section. Now this will be a short section but here what we are going
short section but here what we are going to learn right that so what is actually
to learn right that so what is actually CD so CD stands for continuous
CD so CD stands for continuous deployment so you can see that it's just
deployment so you can see that it's just a devops another practice where code
a devops another practice where code changes are automatically released to
changes are automatically released to production without any manual
production without any manual intervention following a series of
intervention following a series of automated test and quality checks so
automated test and quality checks so these quality checks is nothing but the
these quality checks is nothing but the CI sections that we have done in I think
CI sections that we have done in I think previous sections right so both CI and
previous sections right so both CI and CD works together okay So you have done
CD works together okay So you have done the CI checks and then you are going to
the CI checks and then you are going to deploy the changes automatically. If you
deploy the changes automatically. If you notice currently what is happening? So
notice currently what is happening? So every time we are making any changes. So
every time we are making any changes. So we are going to push the changes. We'll
we are going to push the changes. We'll raise a pair. Once the PR is approved,
raise a pair. Once the PR is approved, we are going to merge that PR to main
we are going to merge that PR to main main branch. Then we'll go to our SSS
main branch. Then we'll go to our SSS instance. We're going to log in. We are
instance. We're going to log in. We are going to pull the latest branch, right?
going to pull the latest branch, right? And then we're going to again do uh
And then we're going to again do uh docker compost build. So we're going to
docker compost build. So we're going to build it, right? Then we're going to up
build it, right? Then we're going to up the containers with the latest scope
the containers with the latest scope changes. Now think when you are working
changes. Now think when you are working in a very big team it's very very
in a very big team it's very very difficult to manage all of this right uh
difficult to manage all of this right uh like doing all this manual work. So that
like doing all this manual work. So that is the reason we need to have some
is the reason we need to have some mechanism that that thing will do all of
mechanism that that thing will do all of this manual work automatically for you.
this manual work automatically for you. So here manual work in the sense means
So here manual work in the sense means all these process right. So you push the
all these process right. So you push the changes it's going to log into your SSS
changes it's going to log into your SSS instance. SSS means I'm talking about
instance. SSS means I'm talking about the EC2 here because we're using EC2
the EC2 here because we're using EC2 instance. It's going to login. It's
instance. It's going to login. It's going to pull the latest code. It's
going to pull the latest code. It's going to build it. It's going to run it,
going to build it. It's going to run it, right? And then you're going to see that
right? And then you're going to see that changes automatically whenever you're
changes automatically whenever you're going to go to your public uh this IP or
going to go to your public uh this IP or let's say we uh when we going to have
let's say we uh when we going to have some custom domain so which sync the
some custom domain so which sync the changes automatically there. So for this
changes automatically there. So for this one what I going to do right now here if
one what I going to do right now here if I just go you see that I already write
I just go you see that I already write all the steps but this is not like I'll
all the steps but this is not like I'll just copy paste I'm just going to copy
just copy paste I'm just going to copy because of like it will give you lot of
because of like it will give you lot of syntax error and everything linking
syntax error and everything linking errors so that is the reason I'm just
errors so that is the reason I'm just going to copy paste but I will explain
going to copy paste but I will explain each and everything what is happening
each and everything what is happening but before that we need to do another
but before that we need to do another extremely important step that is because
extremely important step that is because we're using GitHub actions so we need to
we're using GitHub actions so we need to go to our GitHub accense the repository
go to our GitHub accense the repository that we are using and here we need to go
that we are using and here we need to go to the settings now remember when We
to the settings now remember when We need the continuous we are implementing
need the continuous we are implementing the CD continuous deployment. We need to
the CD continuous deployment. We need to write we need to manage some
write we need to manage some configuration through our GitHub right
configuration through our GitHub right because GitHub action is actually the
because GitHub action is actually the runner that we are using for our CI and
runner that we are using for our CI and the same thing we are going to use for
the same thing we are going to use for our CD. So what you need to do right so
our CD. So what you need to do right so here you need to go to the secrets and
here you need to go to the secrets and variables. You can see that go to the
variables. You can see that go to the settings go to the secrets and variables
settings go to the secrets and variables and then you'll see that you'll be
and then you'll see that you'll be getting this accents. All right. So this
getting this accents. All right. So this actions will be this will allow you to
actions will be this will allow you to all the so you can see that it's allow
all the so you can see that it's allow you to manage reusable configuration
you to manage reusable configuration data these are encrypted are used for
data these are encrypted are used for sensitive data right so now what I'm
sensitive data right so now what I'm going to do simply so I'm going to add
going to do simply so I'm going to add couple of secrets here now what are the
couple of secrets here now what are the secrets that we need the first secrets
secrets that we need the first secrets we need is the host that we we will be
we need is the host that we we will be using so this is our host right so this
using so this is our host right so this is our EC2 host or the public IP of EC2
is our EC2 host or the public IP of EC2 so this is the first thing second will
so this is the first thing second will be EC2 user This is very important
be EC2 user This is very important because we are using Amazon EC2 or
because we are using Amazon EC2 or Amazon Linux. We are going to use EC2-
Amazon Linux. We are going to use EC2- user as our EC2 user. If you're using
user as our EC2 user. If you're using Ubuntu or some other image, you need to
Ubuntu or some other image, you need to change this one. So I'm explaining this
change this one. So I'm explaining this part multiple times because this might
part multiple times because this might create confusion. Third thing, we need
create confusion. Third thing, we need the key. Now what actually key is we
the key. Now what actually key is we need this key pair that we have
need this key pair that we have downloaded. Remember? So this key
downloaded. Remember? So this key content we need. Now remember when you
content we need. Now remember when you are launching your EC2 instance from
are launching your EC2 instance from local power cell what actually you are
local power cell what actually you are doing? So you are actually using this
doing? So you are actually using this key pair and then you will be navigating
key pair and then you will be navigating to that particular path and you are
to that particular path and you are going to write EC2 user at the rate and
going to write EC2 user at the rate and then the IP address. Remember we
then the IP address. Remember we actually have done that part. So the
actually have done that part. So the same thing we are going to write as a
same thing we are going to write as a configuration in our code. So EC2 key we
configuration in our code. So EC2 key we need and what is the next thing we need?
need and what is the next thing we need? We need the EC2 app directory. Now
We need the EC2 app directory. Now remember in the app directory we are
remember in the app directory we are using the EC2 user/ app. Now while
using the EC2 user/ app. Now while creating the uh repository inside our
creating the uh repository inside our EC2 instance I have told you that you
EC2 instance I have told you that you need to give a certain name. So in this
need to give a certain name. So in this case I have given name as app. Now if
case I have given name as app. Now if you have given something else for
you have given something else for example let's say man devops or blah
example let's say man devops or blah blah whatever abc xyz you need to give
blah whatever abc xyz you need to give that particular path only. Right? So
that particular path only. Right? So this is not specific this is general.
this is not specific this is general. Whatever you will give you need to have
Whatever you will give you need to have that much like I will I will select that
that much like I will I will select that much very basic knowledge to change all
much very basic knowledge to change all of these. For example, why I will I'm
of these. For example, why I will I'm noticing like telling all these multiple
noticing like telling all these multiple times because what happens sometimes in
times because what happens sometimes in my video I'll show that I've given the
my video I'll show that I've given the name as app and some other people have
name as app and some other people have given the name as let's say XY Z and
given the name as let's say XY Z and they they'll be commenting that I'm
they they'll be commenting that I'm getting that issues and they'll be
getting that issues and they'll be stuck. So I don't want you to stuck for
stuck. So I don't want you to stuck for long time. So you have to think like for
long time. So you have to think like for example let's say you're giving app so
example let's say you're giving app so you need to remember that one as app.
you need to remember that one as app. You are giving something else some
You are giving something else some different name you you have to remember
different name you you have to remember all of these. So now we are going to
all of these. So now we are going to write four secrets. So one EC2 host. So
write four secrets. So one EC2 host. So I'll go here
I'll go here and you need to give the name. So let's
and you need to give the name. So let's give this one as EC2. Remember hyphen
give this one as EC2. Remember hyphen host,
host, right? And here you need to give the
right? And here you need to give the public IP. What is public IP? So this
public IP. What is public IP? So this one. So I'm going to copy this. Where is
one. So I'm going to copy this. Where is it? So here. And then I'm going to add
it? So here. And then I'm going to add it.
So this is the first one. Next I need EC2 - user. Now here it is extremely
EC2 - user. Now here it is extremely important we are using EC2 user or
important we are using EC2 user or Amazon Linux. So we're going to give EC2
Amazon Linux. So we're going to give EC2 user. Okay. EC2 user and add it.
user. Okay. EC2 user and add it. Next we need the key. So I'll go here
Next we need the key. So I'll go here and I'll do EC2 key. And this key I'll
and I'll do EC2 key. And this key I'll be getting where? So I will be going to
be getting where? So I will be going to my C drive remember. So I'll go to my
my C drive remember. So I'll go to my users. I will go to my user and then
users. I will go to my user and then I'll go to SSH. And remember I have this
I'll go to SSH. And remember I have this key pair.
key pair. So maybe let's open this one with VS
So maybe let's open this one with VS code.
So I'm going to copy this and I'm going to paste it here. Okay,
and I'm going to paste it here. Okay, paste it completely and add it.
paste it completely and add it. And then I'm going to add one more
And then I'm going to add one more secret that will be my EC2
secret that will be my EC2 app directory. Now this will be your
app directory. Now this will be your this will be same. So home/ EC2 user and
this will be same. So home/ EC2 user and then here you need to give the name of
then here you need to give the name of the app that you have given. In my case
the app that you have given. In my case I've given app. So I'll be giving this
I've given app. So I'll be giving this one as app. That's it. Right? So now we
one as app. That's it. Right? So now we are going to add this secret. And this
are going to add this secret. And this is done. So four secrets we have added.
is done. So four secrets we have added. So now what I'm going to do right? I'll
So now what I'm going to do right? I'll go here and then I'm going to so we have
go here and then I'm going to so we have these steps remember build and lint is
these steps remember build and lint is one of the step and then here I'm going
one of the step and then here I'm going to add one more which will be my deploy
to add one more which will be my deploy here I have to be careful with this
here I have to be careful with this spacing and everything I was mistake
spacing and everything I was mistake here
here so copy this I'll add all of this
so copy this I'll add all of this so go here and then what we're going to
so go here and then what we're going to do go to our CI
do go to our CI And
And so after this
so you'll be getting some issue here. Let me check. Ah okay. So now let's save
Let me check. Ah okay. So now let's save this. Now let's go through each and
this. Now let's go through each and everything step by step. Right. All
everything step by step. Right. All right. The first one. Now you see we
right. The first one. Now you see we have this extremely important the uh
have this extremely important the uh parameter here or config you can say
parameter here or config you can say which is needs. Now what is actually
which is needs. Now what is actually this needs. Now these needs to identify
this needs. Now these needs to identify any jobs that must complete successfully
any jobs that must complete successfully before we are going to run the next job.
before we are going to run the next job. Right? So that means for example let's
Right? So that means for example let's say if I go here and uh try to explain
say if I go here and uh try to explain this one simple way. So you have let's
this one simple way. So you have let's say three step okay let's remove these
say three step okay let's remove these I'm going to just copy from here and
I'm going to just copy from here and then I will do like this right so you
then I will do like this right so you have this steps
have this steps so let's say you're going to make a code
so let's say you're going to make a code push
push right and this step is the first step
right and this step is the first step that is your CI step so what this is
that is your CI step so what this is telling that this and this is your let's
telling that this and this is your let's say release or deploy whatever step now
say release or deploy whatever step now this release tape is actually telling
this release tape is actually telling that this needs
Uh so this needs the CI needs sorry this release needs this CI step to complete
release needs this CI step to complete until unless this will be complete this
until unless this will be complete this will not run. So that means this release
will not run. So that means this release needs the CI step. Sales step is nothing
needs the CI step. Sales step is nothing but here the build and lint which is the
but here the build and lint which is the name that we have given here. So in this
name that we have given here. So in this case this is the job right. So that we
case this is the job right. So that we are simply telling that until unless the
are simply telling that until unless the build and lint will run and successful
build and lint will run and successful we are not going to do this. So this is
we are not going to do this. So this is the first thing right. Next what is
the first thing right. Next what is this? So next is github.event name is
this? So next is github.event name is push. So this is simply we are telling
push. So this is simply we are telling the deployment will run when we're going
the deployment will run when we're going to push to the repo right not on the
to push to the repo right not on the pull request. That's it. Third one, I
pull request. That's it. Third one, I think this we have already discussed
think this we have already discussed that GitHub actions actually runs on the
that GitHub actions actually runs on the Ubuntu. So it's simply telling that this
Ubuntu. So it's simply telling that this will be run running uh inside a Linux
will be run running uh inside a Linux VM, right? And this will run inside your
VM, right? And this will run inside your GitHub GitHub's cloud. Okay, GitHub will
GitHub GitHub's cloud. Okay, GitHub will manage all of this. All right. So now we
manage all of this. All right. So now we have the all the important steps, right?
have the all the important steps, right? So the first one will be adding EC2 to
So the first one will be adding EC2 to the known host. Now why actually this
the known host. Now why actually this step is needed? Now if you remember when
step is needed? Now if you remember when we have logged into the SSH from local
we have logged into the SSH from local for the first time, right? So you will
for the first time, right? So you will see some prompt, right? Are you sure you
see some prompt, right? Are you sure you want to continue connecting? Yes or no?
want to continue connecting? Yes or no? And then we have selected yes and then
And then we have selected yes and then it will connect remember. So this is
it will connect remember. So this is actually for that. So what this SSH key
actually for that. So what this SSH key scan will do, right? So this going to
scan will do, right? So this going to fetch the server's SSH fingerprint and
fetch the server's SSH fingerprint and add it to the known host. So this is
add it to the known host. So this is where it will add. Okay. Next, we're
where it will add. Okay. Next, we're going to have the write our SSH key,
going to have the write our SSH key, right? So we need to write it. So and
right? So we need to write it. So and that is the reason we are simply using
that is the reason we are simply using this eco EC2 key is nothing but the key
this eco EC2 key is nothing but the key that we have used here. Remember this is
that we have used here. Remember this is the EC2 key the PM file. All right. So
the EC2 key the PM file. All right. So this is simply we'll add that then we
this is simply we'll add that then we are going to have the deploy. So what
are going to have the deploy. So what this will do see if you notice that this
this will do see if you notice that this is all the process that we have done
is all the process that we have done manually and instead of doing manually
manually and instead of doing manually we are simply writing all the steps in
we are simply writing all the steps in our actions and this will going to take
our actions and this will going to take care all of these. This will pick each
care all of these. This will pick each and everything from the secrets and it's
and everything from the secrets and it's going to uh do the job. We don't have to
going to uh do the job. We don't have to do anything manual right. So it simply
do anything manual right. So it simply do a gpool. So gpool and docker compose
do a gpool. So gpool and docker compose up and build right. So we need the EC2
up and build right. So we need the EC2 host for this. We need the EC2 user and
host for this. We need the EC2 user and the app directory. That's it. And you
the app directory. That's it. And you can see that what all the steps it will
can see that what all the steps it will do. It's going to fetch all of these.
do. It's going to fetch all of these. It's going to reset all uh the main
It's going to reset all uh the main branch. It's going to use docker compos
branch. It's going to use docker compos - build right and all the other things.
- build right and all the other things. And that's it. So this is all the steps
And that's it. So this is all the steps that we are simply doing here. Now what
that we are simply doing here. Now what we are going to do right now with this
we are going to do right now with this so we need to now test it that if this
so we need to now test it that if this is working or not. So let's do one thing
is working or not. So let's do one thing maybe if I go here right. So if you see
maybe if I go here right. So if you see this is my local. So for example
this is my local. So for example okay this one. So maybe so I'll change
okay this one. So maybe so I'll change this text to something else and also
this text to something else and also color of this button. So let's go with t
color of this button. So let's go with t uh task manager edited
uh task manager edited and I'm going to remove this and I'm
and I'm going to remove this and I'm going to make this one as bg black.
going to make this one as bg black. That's it. Now let's save this
That's it. Now let's save this and then we're going to p the changes
and then we're going to p the changes right. So p these changes p
right. So p these changes p ci and some style changes.
ci and some style changes. So post these changes, commit
and okay. Once this is done, we need to go to our
Once this is done, we need to go to our actions, right? So we'll go to our
actions, right? So we'll go to our actions.
actions. So it's going to start immediately. So
So it's going to start immediately. So let's wait.
So now you can see that we have two steps. So once this is done then only
steps. So once this is done then only it's going to restart. There might be
it's going to restart. There might be some errors we need to fix it. If in
some errors we need to fix it. If in case we're getting any error
Awesome. And I think this is done. So you can see that there is no definitely
you can see that there is no definitely there might not be any error all the
there might not be any error all the time if you're doing correctly. So
time if you're doing correctly. So you're doing all the steps step by step.
you're doing all the steps step by step. Now let's see. It will take some time
Now let's see. It will take some time and immediately we got the result.
and immediately we got the result. Awesome. Immediately you got the result.
Awesome. Immediately you got the result. So task manager edited and color is
So task manager edited and color is changed. Right? Now see I have tried my
changed. Right? Now see I have tried my best to keep each and everything very
best to keep each and everything very very clear. It will not be too much.
very clear. It will not be too much. Right? If you're a beginner I'm giving
Right? If you're a beginner I'm giving too much I'm feeding you too much
too much I'm feeding you too much information. It will be like you'll be
information. It will be like you'll be like okay I'm not able to understand. So
like okay I'm not able to understand. So try to keep each and every section as
try to keep each and every section as minimal as possible. Now you see you go
minimal as possible. Now you see you go back to 10 15 minutes back and try to
back to 10 15 minutes back and try to see this this particular CD section one
see this this particular CD section one more time and do this three four times
more time and do this three four times and now let's see if you need any help
and now let's see if you need any help in future or not you'll be able to do
in future or not you'll be able to do this one by yourself I can guarantee
this one by yourself I can guarantee right so these all the things are not
right so these all the things are not that much complex from where you are
that much complex from where you are learning and the the way I'm actually
learning and the the way I'm actually teaching this not I am like maybe some
teaching this not I am like maybe some other uh teachers also teach see
other uh teachers also teach see teaching actually is very very important
teaching actually is very very important and the way you are actually learning
and the way you are actually learning both the things it's not like I go to
both the things it's not like I go to some charge bit or something. I always
some charge bit or something. I always mention this point and then I just ask
mention this point and then I just ask and then you'll be getting the result.
and then you'll be getting the result. But it will not be that much beneficial
But it will not be that much beneficial for you in the long term. Right? You
for you in the long term. Right? You should only be seeing all of these once
should only be seeing all of these once you have tried let's say 10 12 15 times
you have tried let's say 10 12 15 times and then you are not able to do it. That
and then you are not able to do it. That time you should go there and then check
time you should go there and then check all the issues and everything. What is
all the issues and everything. What is the issue that you're facing and try to
the issue that you're facing and try to fix but try to do by yourself right? So
fix but try to do by yourself right? So this is all the steps that we need. This
this is all the steps that we need. This will be more than enough. So now we have
will be more than enough. So now we have completed CI CD both the things with
completed CI CD both the things with this we have completed all the basic
this we have completed all the basic concepts I will say that one should know
concepts I will say that one should know for DevOps right so so if I go here
for DevOps right so so if I go here right so let's go to the top I think I
right so let's go to the top I think I have covered the basic part right
have covered the basic part right see we have plan develop build test
see we have plan develop build test release deploy monitor monitor we
release deploy monitor monitor we haven't covered definitely the reason is
haven't covered definitely the reason is this will be in the second part
this will be in the second part intention intentionally I kept uh this
intention intentionally I kept uh this one for the second part this will be in
one for the second part this will be in depth so I want to cover Prometheus and
depth so I want to cover Prometheus and graphana in depth because if you have
graphana in depth because if you have watched my NodeJS part two and part
watched my NodeJS part two and part three series there I've already covered
three series there I've already covered all of these some basics right so that
all of these some basics right so that is the reason I just don't want to do
is the reason I just don't want to do the same thing again I'll think
the same thing again I'll think something else and try to apply some
something else and try to apply some more complex logic so that is the reason
more complex logic so that is the reason I kept both the complete monitoring
I kept both the complete monitoring section for next part now what will be
section for next part now what will be our next okay so next we are going to
our next okay so next we are going to learn some of the very very basics of
learn some of the very very basics of Kubernetes. Now when I'm talking about
Kubernetes. Now when I'm talking about Kubernetes and the reason why I'm
Kubernetes and the reason why I'm laughing because I thought first time
laughing because I thought first time I'm not going to cover this in this part
I'm not going to cover this in this part one. Now this is a complex topic. Okay.
one. Now this is a complex topic. Okay. Now I I don't want to sound very like
Now I I don't want to sound very like hard or something but Kubernetes is not
hard or something but Kubernetes is not that much simple. If you have experience
that much simple. If you have experience on Kubernetes like I'm talking about
on Kubernetes like I'm talking about like professional experience right not
like professional experience right not like you worked five years 7 years on
like you worked five years 7 years on that but if you have worked on some team
that but if you have worked on some team and that team is using Kubernetes then
and that team is using Kubernetes then also you'll be having some idea right so
also you'll be having some idea right so I usually work like that so from from my
I usually work like that so from from my professional experience I'm talking
professional experience I'm talking Kubernetes is not a beginner topic ask
Kubernetes is not a beginner topic ask charg some other go to Google and search
charg some other go to Google and search it's like it will like it it is like a
it's like it will like it it is like a final boss right so final boss means
final boss right so final boss means it's very very complex and there are a
it's very very complex and there are a lot of things are there but just watch
lot of things are there but just watch this video for next 1 hour and see how I
this video for next 1 hour and see how I have make each and everything very very
have make each and everything very very simple when I'm going to cover
simple when I'm going to cover Kubernetes in depth in part two and
Kubernetes in depth in part two and three and you'll see that we're going to
three and you'll see that we're going to cover a lot of complex topic that time
cover a lot of complex topic that time and you'll see how much easy it will be
and you'll see how much easy it will be for you to understand so before starting
for you to understand so before starting that section I want to highlight that
that section I want to highlight that these whatever we are going to cover in
these whatever we are going to cover in the next one or it's very very important
the next one or it's very very important but also we not going to cover all the
but also we not going to cover all the basics right sorry not going to cover
basics right sorry not going to cover like too much depth it will be extremely
like too much depth it will be extremely difficult if you don't have that much
difficult if you don't have that much idea from or you are not from a devos
idea from or you are not from a devos background it's not a simple topic to uh
background it's not a simple topic to uh start with right so that is the reason
start with right so that is the reason if you are aware that I thought that I'm
if you are aware that I thought that I'm not going to include but then I decided
not going to include but then I decided that instead of giving monitoring
that instead of giving monitoring section it will be better if I cover the
section it will be better if I cover the basic so that you'll get overview and
basic so that you'll get overview and then we're going to apply all these
then we're going to apply all these concepts in the in the man app that we
concepts in the in the man app that we are using now right this is the same
are using now right this is the same method we are going to apply so that
method we are going to apply so that you'll get at least some overview that
you'll get at least some overview that what actually kubernetes is how we can
what actually kubernetes is how we can practically use or apply those commands
practically use or apply those commands then in the next part obviously we're
then in the next part obviously we're going to cover some of that comp so it's
going to cover some of that comp so it's like simple right I'm I'm mentioning all
like simple right I'm I'm mentioning all of this like maybe 100 times you you
of this like maybe 100 times you you will be thinking like okay why he is
will be thinking like okay why he is telling all this multiple time the
telling all this multiple time the reason is because if you watched my
reason is because if you watched my nodej series and see my part one of the
nodej series and see my part one of the nodejs and the part two you see there
nodejs and the part two you see there will be a huge difference part two is
will be a huge difference part two is very very complex we have microservices
very very complex we have microservices those kind of things part one is very
those kind of things part one is very very simple so consider this part one
very simple so consider this part one similar to that only as simple as that
similar to that only as simple as that okay so now let's start with Kubernetes
okay so now let's start with Kubernetes but again I want to I'm not going to do
but again I want to I'm not going to do one but I wanted to explain that it is
one but I wanted to explain that it is not going to be a simple thing so you
not going to be a simple thing so you need to give attention and try to apply
need to give attention and try to apply all the things that I'll be doing in
all the things that I'll be doing in next uh 1 hour maybe so let's get
next uh 1 hour maybe so let's get started all right everyone so now let's
started all right everyone so now let's start with Kubernetes now again I
start with Kubernetes now again I already mentioned that we are going to
already mentioned that we are going to cover only the basics so first we need
cover only the basics so first we need to understand couple of things and then
to understand couple of things and then only we can apply all of this in mind
only we can apply all of this in mind because for this one I can't apply all
because for this one I can't apply all the concepts without knowing anything
the concepts without knowing anything it's not that much simple right so you
it's not that much simple right so you need to know the architecture why
need to know the architecture why actually we need kubernetes what is the
actually we need kubernetes what is the problem that it solves and all the
problem that it solves and all the things right so first of all so you see
things right so first of all so you see that from definition wise it's like so
that from definition wise it's like so it's created by Google definitely
it's created by Google definitely obviously and then now it's open source
obviously and then now it's open source so it's also called as ks it's open
so it's also called as ks it's open source system for automating deployment
source system for automating deployment scaling manage managing your
scaling manage managing your containerized application right so how
containerized application right so how it actually help so it will automate how
it actually help so it will automate how the containers are deployed scaledworked
the containers are deployed scaledworked updated and healed right and how it will
updated and healed right and how it will do actually so we'll be having a cluster
do actually so we'll be having a cluster of machines and these all the things we
of machines and these all the things we are going to learn step by step so first
are going to learn step by step so first again we'll do just we as usual do so
again we'll do just we as usual do so here what I'm going to do right so let's
here what I'm going to do right so let's write all of these in this block only
write all of these in this block only each and everything right so it will be
each and everything right so it will be little
little like this. Okay. So, first of all, what
like this. Okay. So, first of all, what is Kubernetes? So, here it's a
is Kubernetes? So, here it's a opensource
container. Okay. Let's copy from here. Why not need
Okay. Let's copy from here. Why not need to write? So, so opensource system for
to write? So, so opensource system for automatic deployment, scaling and
automatic deployment, scaling and management of these applications. So,
management of these applications. So, I'll copy here
I'll copy here and paste it. Now
and paste it. Now why now here the first thing we need to
why now here the first thing we need to understand and because in the previous
understand and because in the previous section only we have covered the docker
section only we have covered the docker containerizations that why containers
containerizations that why containers are not enough right so this is the main
are not enough right so this is the main key
key problem or the root that we need to get
problem or the root that we need to get into to understand that why actually
into to understand that why actually need kubernetes so first I will say that
need kubernetes so first I will say that okay containers are not enough right so
okay containers are not enough right so it's not enough
it's not enough okay So see what actually docker does
okay So see what actually docker does right so docker makes packaging and
right so docker makes packaging and running your apps very easily right but
running your apps very easily right but when you're going to have many
when you're going to have many containers for example front end back
containers for example front end back end db work workers
end db work workers you need something right you can't do or
you need something right you can't do or manage multiple containers manually
manage multiple containers manually there are lot of issues that we are
there are lot of issues that we are going to cover that there are a lot of
going to cover that there are a lot of issues you can't handle all of these
issues you can't handle all of these this is where kubernetes will comes into
this is where kubernetes will comes into picture so it's okay how you can uh tell
picture so it's okay how you can uh tell like okay so you consider as a GitHub
like okay so you consider as a GitHub autopilot so I'm going to or copilot not
autopilot so I'm going to or copilot not autopilot copilot right so it's doing
autopilot copilot right so it's doing the work for you right so similarly you
the work for you right so similarly you think kubernetes as uh it's like a
think kubernetes as uh it's like a manager right it's like a manager or
manager right it's like a manager or autopilot right where you are going to
autopilot right where you are going to declare what you want in terms of a yml
declare what you want in terms of a yml file again yml file part we are going to
file again yml file part we are going to cover in that part two where we are
cover in that part two where we are going to cover each and everything
going to cover each and everything details but for now I just want you to
details but for now I just want you to know all the terms right so you declare
know all the terms right so you declare what you want and then
what you want and then what it will do right it will follow it
what it will do right it will follow it follow the things that you want and it
follow the things that you want and it is going to follow each and everything
is going to follow each and everything that is mentioned and it is going to do
that is mentioned and it is going to do the work for you as simple as that right
the work for you as simple as that right and it is going to do it at a scale
and it is going to do it at a scale level right scale means it's very very
level right scale means it's very very efficient you don't have to manage at
efficient you don't have to manage at all right it's going to take care each
all right it's going to take care each and everything on behalf of you now this
and everything on behalf of you now this is I explain from a like very simple not
is I explain from a like very simple not a technical point of view very simple
a technical point of view very simple point of view that why containers are
point of view that why containers are not enough when you're going to have
not enough when you're going to have multiple containers it will be very very
multiple containers it will be very very difficult to manage right now coming to
difficult to manage right now coming to little technical terms right that why
little technical terms right that why actually we need Kubernetes right now
actually we need Kubernetes right now because we have covered the man app in
because we have covered the man app in this throughout this video it will be
this throughout this video it will be easy if I try to explain in context of
easy if I try to explain in context of that right so for example let's say
that right so for example let's say currently uh what you are having you are
currently uh what you are having you are having a EC2 right so we are doing EC2
having a EC2 right so we are doing EC2 and then we are having a docker
and then we are having a docker compose up correct now let's say back
compose up correct now let's say back end crashed right what you're going to
end crashed right what you're going to do so let's say back end crashed right
do so let's say back end crashed right so your obviously your website will be
so your obviously your website will be down so what you're going to do so your
down so what you're going to do so your site will be down
until you're going to restart right as simple as that until you're going to
as simple as that until you're going to restart it second what will happen
restart it second what will happen normally your website faces has 1,000
normally your website faces has 1,000 users or uses 1,000 user per day. What
users or uses 1,000 user per day. What happen if this changes to let's say
happen if this changes to let's say 50,000 users I'm just giving example
50,000 users I'm just giving example okay what that means there will be some
okay what that means there will be some problem right so you need to scale it
problem right so you need to scale it manually right and then the third part
manually right and then the third part will be that see this part we have
will be that see this part we have already covered okay so it's like front
already covered okay so it's like front end needs your back end right so you
end needs your back end right so you remember we have done the uh port
remember we have done the uh port mapping and everything that front end
mapping and everything that front end needs the back end and then what you're
needs the back end and then what you're going to do you're going to hardcode
going to do you're going to hardcode your IP right IP or maybe port
your IP right IP or maybe port so all these now this is only three
so all these now this is only three problem there can be multiple issues
problem there can be multiple issues that can occur now here what you need
that can occur now here what you need when you have a product level
when you have a product level application for example let's say P 0 P1
application for example let's say P 0 P1 or P2 application that we have discussed
or P2 application that we have discussed the tunnels you need automation very
the tunnels you need automation very very important scaling you need load
very important scaling you need load balancing you need right service
balancing you need right service discovery
discovery rollouts lot of things and there
rollouts lot of things and there kubernetes is going going to provide
kubernetes is going going to provide each and everything that I mentioned at
each and everything that I mentioned at all at one place right so it's very very
all at one place right so it's very very helpful now let's see what are the very
helpful now let's see what are the very very important problem that Kubernetes
very important problem that Kubernetes solves extremely important for your
solves extremely important for your interview also so please note it down
interview also so please note it down these things are very very important
these things are very very important first one is scaling right now again all
first one is scaling right now again all of these we'll be discussing but for now
of these we'll be discussing but for now just consider that scaling is one of the
just consider that scaling is one of the things that Kubernetes uh solves right
things that Kubernetes uh solves right what will happen when you don't have
what will happen when you don't have kubernetes you're going to start your
kubernetes you're going to start your more containers manually by hand but in
more containers manually by hand but in here you just have to mention some
here you just have to mention some config and it's going to keeps multiple
config and it's going to keeps multiple pods running now again pods is a term
pods running now again pods is a term that we haven't started so that is the
that we haven't started so that is the reason I don't want to mention the terms
reason I don't want to mention the terms but again sometimes I need to mention or
but again sometimes I need to mention or else it will be difficult so scaling is
else it will be difficult so scaling is one of the main advantage selfhealing
one of the main advantage selfhealing extremely important so what is actually
extremely important so what is actually like whenever you are going to have a
like whenever you are going to have a crash you'll be having a downtime
crash you'll be having a downtime downtime in the in the sense let's say
downtime in the in the sense let's say your back end crashes your website will
your back end crashes your website will be down until unless you're going to
be down until unless you're going to restart it. So in between that time that
restart it. So in between that time that calls calls as downtime here what will
calls calls as downtime here what will happen Kubernetes is going to sorry pods
happen Kubernetes is going to sorry pods so pods we are going to have inside
so pods we are going to have inside kubernetes that is one of the main uh I
kubernetes that is one of the main uh I will objects or concept so pods are
will objects or concept so pods are automatically restart or replaced
automatically restart or replaced extremely beneficial right then you're
extremely beneficial right then you're going to have load balancing load
going to have load balancing load balancing is one of the another very
balancing is one of the another very very important advantages of using ks
very important advantages of using ks then you are going to have the
then you are going to have the declarative in infrastructure Now again
declarative in infrastructure Now again this is talking about when you're going
this is talking about when you're going to write all the configs in terms of YML
to write all the configs in terms of YML file means you you tell or you describe
file means you you tell or you describe what you want
what you want right and it's going to do the things
right and it's going to do the things for you and then also you're going to
for you and then also you're going to have some portability related uh
have some portability related uh advantages also but the main thing is
advantages also but the main thing is okay portability main thing is here you
okay portability main thing is here you need to think all of this right scaling
need to think all of this right scaling self-filling and load balancing only yet
self-filling and load balancing only yet these three only itself is very very
these three only itself is very very important. So what we understand that
important. So what we understand that again we still don't know some of the
again we still don't know some of the terms and technical terms how kubernetes
terms and technical terms how kubernetes works and everything that we are going
works and everything that we are going to know now but at least the problem
to know now but at least the problem with docker and why actually we need
with docker and why actually we need kubernetes and what is the problem that
kubernetes and what is the problem that it will resolve now what I'm going to do
it will resolve now what I'm going to do right so I'm going to now write
right so I'm going to now write architecture very simple one I try to
architecture very simple one I try to keep this one as simple as possible and
keep this one as simple as possible and there we are going to have lot of terms
there we are going to have lot of terms right and those terms definitely If
right and those terms definitely If you're complete beginner, you'll not
you're complete beginner, you'll not understand okay what is happening there.
understand okay what is happening there. So I'll try to keep each and everything
So I'll try to keep each and everything very simple. So I'm just going to pause
very simple. So I'm just going to pause this. All right. So let's start with the
this. All right. So let's start with the architecture right. So I'm going to just
architecture right. So I'm going to just first I'm going to just create it and
first I'm going to just create it and then we're going to discuss in details.
then we're going to discuss in details. Okay. So let's do one thing. Let's take
Okay. So let's do one thing. Let's take one
one here.
Okay. And this one I'm going to write as control panel.
control panel. You'll see what all this is.
You'll see what all this is. Okay. Then here I'm going to
Okay. Then here I'm going to take one more
take one more like this. I'm going to paste it.
like this. I'm going to paste it. And here I'm going to have some three
And here I'm going to have some three boxes. Again I'm telling boxes because I
boxes. Again I'm telling boxes because I don't want to explain the term or else
don't want to explain the term or else it will go right over your head. write
it will go right over your head. write what all these things are now again. So
what all these things are now again. So first of all this is our
first of all this is our cube
cube cube ctl. Now first let's start with
cube ctl. Now first let's start with this one. What actually this cube uh ctl
this one. What actually this cube uh ctl is? So this is actually the command line
is? So this is actually the command line tool that we are going to use which will
tool that we are going to use which will interact with kubernetes right so this
interact with kubernetes right so this is so we are going to write the command
is so we are going to write the command line tool that we are going to use. So
line tool that we are going to use. So you will you will use to interact
you will you will use to interact with Kubernetes.
with Kubernetes. All right.
All right. Now here what I'm going to do simply so
Now here what I'm going to do simply so this CLI is going to talk with the
this CLI is going to talk with the control panel. Now this control panel is
control panel. Now this control panel is very very important. This also we can
very very important. This also we can consider as the master node. Okay. So
consider as the master node. Okay. So this control panel we can consider also
this control panel we can consider also as the master node. Now what actually
as the master node. Now what actually this control panel has? Now this will
this control panel has? Now this will has the this will have the API server.
has the this will have the API server. This will be having the controlling or
This will be having the controlling or controller controller manager
controller controller manager and also this will has sort ectd or this
and also this will has sort ectd or this is where we are going to store the
is where we are going to store the state. Now everything again all this
state. Now everything again all this will be very very difficult if I explain
will be very very difficult if I explain here. So just bear for some time I'm
here. So just bear for some time I'm just going to uh write the diagram then
just going to uh write the diagram then we are going to go each and everything
we are going to go each and everything in details and then what will happen
in details and then what will happen right now then we are going to have our
right now then we are going to have our worker nodes. So this is all our worker
worker nodes. So this is all our worker nodes right. So this will be our worker
nodes right. So this will be our worker node one then we'll be having a worker
node one then we'll be having a worker node two and this let's say worker node
node two and this let's say worker node three.
three. Now if I want to explain
Now if I want to explain this one more further. So this is where
this one more further. So this is where I'll be having my
I'll be having my cube bl and this uh this is where I'll
cube bl and this uh this is where I'll be having the cube proxy
be having the cube proxy and this is let's say one of the part
and this is let's say one of the part where it will handle both back end
where it will handle both back end front end again this will be little
front end again this will be little tricky to understand just give me some
tricky to understand just give me some time to write and then we are going to
time to write and then we are going to explain then I'm going to just copy this
explain then I'm going to just copy this and I'm going to paste it here and then
and I'm going to paste it here and then I'm going to Maybe let's remove the
I'm going to Maybe let's remove the front end. Then I'm going to have the
front end. Then I'm going to have the worker node three. And this is I'm going
worker node three. And this is I'm going to just copy from here. Oh, sorry.
to just copy from here. Oh, sorry. And I'm going to write here
And I'm going to write here front end.
front end. Okay. And all these
Okay. And all these will be connected.
Awesome. So these also you can consider as the master node. Now we will go into
as the master node. Now we will go into details that what actually is happening
details that what actually is happening here.
here. All right. So first one. So let's start
All right. So first one. So let's start with the first one. Right. So I'm going
with the first one. Right. So I'm going to write here. Let's copy it from here.
So first one is the master node. So what is master node? This is
node. So what is master node? This is also called as control app plane.
also called as control app plane. I have written panel is it. This will be
I have written panel is it. This will be control plane.
control plane. Right.
Right. And this will be master node.
And this will be master node. So control plane. What actually are
So control plane. What actually are doing here? Right.
doing here? Right. This is simply is going to make
This is simply is going to make decisions
decisions and it is going to remember that state
and it is going to remember that state that it has.
that it has. Okay. How? Now you consider all of these
Okay. How? Now you consider all of these terms, right? These things are very very
terms, right? These things are very very important. Now first we are going to
important. Now first we are going to write some terms here
write some terms here server is like you can say like a front
server is like you can say like a front man front main right front man I'm
man front main right front man I'm talking about it's not frontman or like
talking about it's not frontman or like it's like front desk much simpler way
it's like front desk much simpler way which will take all the requests
which will take all the requests okay so it's like front front desk of
okay so it's like front front desk of all requests API server right where all
all requests API server right where all request will come so API server will get
request will come so API server will get all the request first one second we're
all the request first one second we're going to have etc right this is you can
going to have etc right this is you can consider as the memory
consider as the memory right this is this is going to stores
right this is this is going to stores the whole
cluster state now when I'm talking about the
state now when I'm talking about the whole cluster state this will handle
whole cluster state this will handle ports. This is going to uh memorize or
ports. This is going to uh memorize or stores the services.
This is going to also going to handle the deployments and also configs. Okay.
the deployments and also configs. Okay. So this is where we're going to have all
So this is where we're going to have all the memory. So API server is going to
the memory. So API server is going to catch all the request. This is going to
catch all the request. This is going to store all the memories. Enter ports,
store all the memories. Enter ports, services, deployment and configs. Then
services, deployment and configs. Then we are also going to have a serial.
we are also going to have a serial. So serial is nothing but dispatcher
So serial is nothing but dispatcher right? So it's like a dispatcher. What
right? So it's like a dispatcher. What this is does this is now this is where
this is does this is now this is where it gets very interesting. This is going
it gets very interesting. This is going to pick the best worker node for each
to pick the best worker node for each quad. Now remember we have multiple
quad. Now remember we have multiple worker node right? So this scheduleuler
worker node right? So this scheduleuler is going to understand okay I need to
is going to understand okay I need to pick this worker node here for this
pick this worker node here for this particular use case. So this dispatcher
particular use case. So this dispatcher is going to pick
the best worker node
node for each board that we are going to. So
for each board that we are going to. So this is about the uh master node or the
this is about the uh master node or the control plane. Now next we are going to
control plane. Now next we are going to have the term which is worker node. So
have the term which is worker node. So what actually worker node will do right?
what actually worker node will do right? So, so here worker node is where your
So, so here worker node is where your containers will actually run will
containers will actually run will actually run. So, this is actually
actually run. So, this is actually inside quartz,
inside quartz, right? This is where your containers
right? This is where your containers will run and how it will run. So, you
will run and how it will run. So, you can see that there are some terms. So,
can see that there are some terms. So, cubeate cubate. So, this is a node
cubeate cubate. So, this is a node agent. This is going to ensure that
agent. This is going to ensure that containers match the pods specification.
containers match the pods specification. Okay. So cublet
is node agent can search all of these right. So I'm going to just copy this.
You see that this is the primary agent on each node in a kubernetes cluster
on each node in a kubernetes cluster responsible for ensuring the container
responsible for ensuring the container described in the pod specs are running
described in the pod specs are running healthy and managed correctly. So in
healthy and managed correctly. So in simple words it's a node agent. Then
simple words it's a node agent. Then you're going to have the cube proxy. You
you're going to have the cube proxy. You see there is a term that cube proxy. So
see there is a term that cube proxy. So cube proxy.
cube proxy. So cube proxy is nothing but it's like
So cube proxy is nothing but it's like it will manage the networking. So I'm
it will manage the networking. So I'm going to write in s net uh node
going to write in s net uh node networking
networking plus it's going to handle the simple
plus it's going to handle the simple load balancing. So I'm going to do
load balancing. So I'm going to do simple load balancing for services that
simple load balancing for services that you are going to have. This will be
you are going to have. This will be handled by cube proxy. Then you're going
handled by cube proxy. Then you're going to have the extremely important term
to have the extremely important term that is called ports. So what actually
that is called ports. So what actually ports is right. So it's like a uh it's
ports is right. So it's like a uh it's like a okay the best way of explaining
like a okay the best way of explaining will be smallest deployment unit. So
will be smallest deployment unit. So it's like a unit that is going to wrap
it's like a unit that is going to wrap one container. So say when you worked
one container. So say when you worked with DevOps right you're going to so not
with DevOps right you're going to so not DevOps Docker you're going to have
DevOps Docker you're going to have container for your front end back end DV
container for your front end back end DV blah blah right. So it's like here the
blah blah right. So it's like here the concept is pods. It's like a simple uh
concept is pods. It's like a simple uh small deployment unit that's going to
small deployment unit that's going to wrap one particular container. Okay.
wrap one particular container. Okay. Now here what I'm going to do right so
Now here what I'm going to do right so let's say let's consider this man
let's say let's consider this man example right here if you notice that
example right here if you notice that when I'm going to create the node sorry
when I'm going to create the node sorry pods for back end or front end consider
pods for back end or front end consider backend ports right so back end ports
backend ports right so back end ports might be on node one or node two
might be on node one or node two remember this is very important so that
remember this is very important so that is the reason I'm written in both the
is the reason I'm written in both the places so these can be node one or node
places so these can be node one or node two right and here front end ports on
two right and here front end ports on node three And here how it will going to
node three And here how it will going to work. Now you might be thinking this is
work. Now you might be thinking this is a little complicated because then we're
a little complicated because then we're going to have the concept of services.
going to have the concept of services. So this services is going to keep the
So this services is going to keep the connection or the connectivity stable.
connection or the connectivity stable. Now again it will be a little complex
Now again it will be a little complex but remember I want you to remember this
but remember I want you to remember this term here that pod is a simplest
term here that pod is a simplest deployment unit which is going to so I'm
deployment unit which is going to so I'm going to write which wraps
going to write which wraps one container right something like that.
one container right something like that. So two things we three things I will
So two things we three things I will say. So first one is the cube uh cubectl
say. So first one is the cube uh cubectl which is the command line tool that we
which is the command line tool that we are going to use to interact with
are going to use to interact with kubernetes. Then you're going to have
kubernetes. Then you're going to have the control plane. So you can consider
the control plane. So you can consider this one as a human mind right. So this
this one as a human mind right. So this is going to this is like managing
is going to this is like managing everything. This is the master node
everything. This is the master node where you are getting all the request
where you are getting all the request API server is handling that controlling
API server is handling that controlling manager. You're going to have is atcd
manager. You're going to have is atcd which is going to store all the memory
which is going to store all the memory of part services deployment blah blah
of part services deployment blah blah everything. Right? I have written all of
everything. Right? I have written all of these. Then you're going to have the
these. Then you're going to have the scheduleuler which is nothing but
scheduleuler which is nothing but dispatcher. It's going to pick the best
dispatcher. It's going to pick the best worker node for each node. Each pod best
worker node for each node. Each pod best worker node for each pod. When I'm
worker node for each pod. When I'm talking about the worker node, worker
talking about the worker node, worker node is actually where you're going to
node is actually where you're going to run all the containers, your backend,
run all the containers, your backend, front end containers, right? Where
front end containers, right? Where you're going to have a cube l which is
you're going to have a cube l which is the node agent. Cube proxy which is
the node agent. Cube proxy which is going to uh be a load balancing for
going to uh be a load balancing for services and then pods which is very
services and then pods which is very very important smallest deployment unit
very important smallest deployment unit that's going to wrap or you can consider
that's going to wrap or you can consider that your container will live inside a
that your container will live inside a pod that that will be much more simpler
pod that that will be much more simpler way of explaining now let's say how this
way of explaining now let's say how this will work right so I'm going to write
will work right so I'm going to write once again okay let's copy from here
so let's Say this is how it will work. Okay. So what will happen? So I am going
Okay. So what will happen? So I am going to run. So I'll be running. So user will
to run. So I'll be running. So user will be running, right? So let's say I have a
be running, right? So let's say I have a user. User is running this. So user is
user. User is running this. So user is going to run that cube
going to run that cube DL. Now remember this is the command
DL. Now remember this is the command line or CLI that will help us to
line or CLI that will help us to interact with Kubernetes. So we're going
interact with Kubernetes. So we're going to write a cube command here. Now
to write a cube command here. Now remember I'm not writing the command and
remember I'm not writing the command and you see that why I'm not writing because
you see that why I'm not writing because we haven't started anything on the
we haven't started anything on the command. Right? If I write a command
command. Right? If I write a command here, you don't know what is happening
here, you don't know what is happening there. So I'm just going to write a
there. So I'm just going to write a cubectl or Kubernetes command. This is
cubectl or Kubernetes command. This is going to hit the API server. Now
going to hit the API server. Now remember API server stays inside your
remember API server stays inside your control plane. This is going to receive
control plane. This is going to receive the YML file. YML file again it's like a
the YML file. YML file again it's like a file where we going to write each and
file where we going to write each and every step right. This section this
every step right. This section this video we are going to not going to cover
video we are going to not going to cover it but definitely in the next part we'll
it but definitely in the next part we'll be having but so it's better to know. So
be having but so it's better to know. So that YML file is going to receive by
that YML file is going to receive by this API server. Then API server is
this API server. Then API server is going to pass it to
going to pass it to etc which is going to store the desired
etc which is going to store the desired state. This will be connected to your
state. This will be connected to your controller
controller manager.
manager. Right here what will happen right? So
Right here what will happen right? So this is like uh it will check the
this is like uh it will check the difference like okay I want to get a pod
difference like okay I want to get a pod and it will check that okay there is
and it will check that okay there is some part that is missing. So it's going
some part that is missing. So it's going to request that particular pod and this
to request that particular pod and this is connected to seduler. Cedular I think
is connected to seduler. Cedular I think we have already decided that this is the
we have already decided that this is the dispatcher which is going to now choose
dispatcher which is going to now choose the best worker not so what will happen
the best worker not so what will happen so your controller manager tell that
so your controller manager tell that okay there is some parts are missing so
okay there is some parts are missing so I need to request some parts so it's
I need to request some parts so it's going to request now this scheduleuler
going to request now this scheduleuler is going to check okay there are five
is going to check okay there are five parts are available I'm just explaining
parts are available I'm just explaining in a simple way and I need to find the
in a simple way and I need to find the best worker node here not parts worker
best worker node here not parts worker node so best worker node so is going to
node so best worker node so is going to pick the best worker node and then ser
pick the best worker node and then ser will be basically nothing but connected
will be basically nothing but connected with the worker node here So it is going
with the worker node here So it is going to pick the best worker node. So let's
to pick the best worker node. So let's say I have worker node two. I think this
say I have worker node two. I think this I've already discussed worker node one
I've already discussed worker node one and then you're going to have your
and then you're going to have your worker node three. Right?
worker node three. Right? So this will be the overall flow. So
So this will be the overall flow. So you're going to write your command. It's
you're going to write your command. It's going to fit the API server where you
going to fit the API server where you will be getting all the request. It's
will be getting all the request. It's going to pass and save the store in the
going to pass and save the store in the here uh not store the state here of all
here uh not store the state here of all pod services and everything. It will
pod services and everything. It will pass to controller manager. It's going
pass to controller manager. It's going to check if any parts are missing or I
to check if any parts are missing or I need to request those parts. It's going
need to request those parts. It's going to request. It will come to
to request. It will come to scheduleuler. Seduler is now actually
scheduleuler. Seduler is now actually check all the worker nodes that are
check all the worker nodes that are available. Let's have a three worker
available. Let's have a three worker nodes that are available. So it's going
nodes that are available. So it's going to pick the best worker node from here.
to pick the best worker node from here. All right,
All right, that's it. So now we know that why what
that's it. So now we know that why what is Kubernetes why actually we need it
is Kubernetes why actually we need it and what is the very basic overview. We
and what is the very basic overview. We need to learn some objects core objects
need to learn some objects core objects in Kubernetes. So in this particular
in Kubernetes. So in this particular video I've decided to cover only three
video I've decided to cover only three which is very very important. Now again
which is very very important. Now again remember there are lot of advanced
remember there are lot of advanced things are available. If you go to
things are available. If you go to YouTube right and search Kubernetes
YouTube right and search Kubernetes you'll see that there are some videos
you'll see that there are some videos only for Kubernetes. It's more than five
only for Kubernetes. It's more than five or six hours right? It's that much
or six hours right? It's that much complex not complex but I will say like
complex not complex but I will say like so many things are there. Uh so here
so many things are there. Uh so here what I'm going to do we are going to
what I'm going to do we are going to cover three things we'll be learning
cover three things we'll be learning what is pod is what is deployment and
what is pod is what is deployment and what is service right three things. So
what is service right three things. So let's start with pod. So I'm going to
let's start with pod. So I'm going to just copy this and paste it here. So
just copy this and paste it here. So let's start with a pod. So what is a
let's start with a pod. So what is a pod? It's like a small or smallest
pod? It's like a small or smallest building
building block,
block, right? So it is a simplest or smallest
right? So it is a simplest or smallest deployment unit which is going to wrap
deployment unit which is going to wrap one container. Consider let's say your
one container. Consider let's say your NodeJS backend container. Right?
NodeJS backend container. Right? Now here the base uh the best advantage
Now here the base uh the best advantage of Kubernetes is Kubernetes can actually
of Kubernetes is Kubernetes can actually restart and replace the ports. Right?
restart and replace the ports. Right? Now how you're going to understand this
Now how you're going to understand this one in a simpler way consider pod so pod
one in a simpler way consider pod so pod as a single house
as a single house right so consider it's a single house
right so consider it's a single house and each and every house uh contains a
and each and every house uh contains a particular container or leaves a
particular container or leaves a container right now what will happen
container right now what will happen let's say this house breaks uh okay I
let's say this house breaks uh okay I don't know how why I'm explaining but
don't know how why I'm explaining but okay I want to explain for all of you so
okay I want to explain for all of you so that it will be easy so let's say this
that it will be easy so let's say this house breaks so what will happen if this
house breaks so what will happen if this House breaks means pod will be
House breaks means pod will be destroyed. Right? So what will happen?
destroyed. Right? So what will happen? Kubernetes will rebuild it. Rebuild the
Kubernetes will rebuild it. Rebuild the pod. Right? So Kubernetes rebuilds the
pod. Right? So Kubernetes rebuilds the pod. That's it. Simp simplest done. Now
pod. That's it. Simp simplest done. Now here uh we can write some yml file but
here uh we can write some yml file but but again I don't want to go into the
but again I don't want to go into the declarative way of writing because that
declarative way of writing because that I kept it for the next part. There are
I kept it for the next part. There are some useful commands we need to know
some useful commands we need to know that is how we are going to get all the
that is how we are going to get all the pods, how we can describe a pod, how
pods, how we can describe a pod, how you're going to get the logs for a
you're going to get the logs for a particular pod. But that we are going to
particular pod. But that we are going to only do when we'll be doing hands-on.
only do when we'll be doing hands-on. Now just understand the conceptual flow.
Now just understand the conceptual flow. Next we're going to have the deployment.
Next we're going to have the deployment. So pods is the smallest building block
So pods is the smallest building block where all the container will live. Then
where all the container will live. Then you're going to have the
you're going to have the deployment. Right? Now what is
deployment. Right? Now what is deployment? Deployment is manager of
deployment? Deployment is manager of ports. Simple means deployment when
ports. Simple means deployment when you're going to do the deployment it is
you're going to do the deployment it is going to manage the ports. So it will
going to manage the ports. So it will create the ports. It's going to keep the
create the ports. It's going to keep the ports in right number. It is going to do
ports in right number. It is going to do some rolling updates. It's going to roll
some rolling updates. It's going to roll back if needed. All these will be
back if needed. All these will be handled by man uh deployment. Now here
handled by man uh deployment. Now here what we can consider this one for
what we can consider this one for example if pod is a single house what
example if pod is a single house what will be deployment? It will be society
will be deployment? It will be society manager. uh maybe society manager or
manager. uh maybe society manager or area manager whatever you want to do
area manager whatever you want to do area manager right so area manager is
area manager right so area manager is going to manage all the houses that that
going to manage all the houses that that particular area has right
particular area has right uh so this is like very simple way so
uh so this is like very simple way so pod is going to see all the containers
pod is going to see all the containers will live inside pods deployment is
will live inside pods deployment is going to manage the pods you see how
going to manage the pods you see how these things are related right the third
these things are related right the third one will be now again here also we have
one will be now again here also we have some commands but for now let's keep it
some commands but for now let's keep it like that let's understand the concept
like that let's understand the concept Now next one will be the services. This
Now next one will be the services. This is also very very important right. So
is also very very important right. So what is actually services?
what is actually services? Services is like a door or address
Services is like a door or address right? It's like a door or address. So
right? It's like a door or address. So that means services is going to give
that means services is going to give whatever ports that you you are going to
whatever ports that you you are going to have that a name and it is going to do
have that a name and it is going to do the load balancing right I already
the load balancing right I already mentioned it's going to do the load
mentioned it's going to do the load balancing
balancing also. it can so important interview
also. it can so important interview question services can locate pods via
question services can locate pods via label selectors so if I want to explain
label selectors so if I want to explain this one in a simple way so it's like so
this one in a simple way so it's like so we have house single house then area
we have house single house then area manager and this is like you consider
manager and this is like you consider this one as the area main gate right or
this one as the area main gate right or the entry main gate address whatever you
the entry main gate address whatever you consider address or the entry okay so
consider address or the entry okay so that means If consider if pods change
that means If consider if pods change again very very important everyone if
again very very important everyone if pods change pod means house means if
pods change pod means house means if house changes the gate will always
house changes the gate will always remain same correct gate will be same
remain same correct gate will be same now here what I mean by gate so let's
now here what I mean by gate so let's say your pod are staying in a your back
say your pod are staying in a your back end is staying in a particular pod or
end is staying in a particular pod or particular house visitor visitor will be
particular house visitor visitor will be coming through your gate right visitor
coming through your gate right visitor is But here visitor is nothing but your
is But here visitor is nothing but your front end. So front end will come and
front end. So front end will come and front end is going to connect with back
front end is going to connect with back end means what I'm trying to explain
end means what I'm trying to explain that your services whenever your part
that your services whenever your part destroyed or parts is not working or
destroyed or parts is not working or parts are down services will be always
parts are down services will be always intact right intact in the sense means
intact right intact in the sense means it is not going to change it will be
it is not going to change it will be always uh stays the same. What we're
always uh stays the same. What we're going to do right when we will be
going to do right when we will be implementing these services. So in our
implementing these services. So in our man application we're going to create a
man application we're going to create a backend svc. So svc is nothing but it is
backend svc. So svc is nothing but it is going to point to that backend pods and
going to point to that backend pods and then front end is going to call that
then front end is going to call that backend pods via that svc that we're
backend pods via that svc that we're going to create back end svc. Okay. So
going to create back end svc. Okay. So these will be the overall concepts that
these will be the overall concepts that we need to like whatever I'm talking
we need to like whatever I'm talking about the what I need in the sense means
about the what I need in the sense means that as a beginner these would be more
that as a beginner these would be more than enough for you to understand all
than enough for you to understand all these terms still you need to go through
these terms still you need to go through these terms multiple times to get a good
these terms multiple times to get a good overview or else if you if you are in
overview or else if you if you are in hurry and let's say you want to learn
hurry and let's say you want to learn everything very quickly it will be a
everything very quickly it will be a mess you'll forget all the things very
mess you'll forget all the things very easily right these things are very very
easily right these things are very very important. Now let's say I want to give
important. Now let's say I want to give you one very basic overview that how
you one very basic overview that how these things will work and it will be
these things will work and it will be very very easy for you to understand
very very easy for you to understand right. So what will happen right? So
right. So what will happen right? So let's say I have my user
let's say I have my user and this is my browser
and this is my browser and this browser is going to call. So
and this browser is going to call. So here the front end is VC
right here we are going to have the front end
front end ports right front end house front end
ports right front end house front end ports so here we're going to have the uh
ports so here we're going to have the uh deployment replicas rollouts and
deployment replicas rollouts and everything these front end ports is
everything these front end ports is going to call via HTTP which is going to
going to call via HTTP which is going to call the backend SBC okay
call the backend SBC okay and backend SBC is going to connect it
and backend SBC is going to connect it to backend ports
Right? And here let's say this is connected to your MongoDB blah blah
connected to your MongoDB blah blah whatever. So here important part is that
whatever. So here important part is that how the services and the parts are
how the services and the parts are working together. That is the key point
working together. That is the key point here you need to understand. All right.
here you need to understand. All right. So now whatever things you have learned
So now whatever things you have learned so far. So you have learned all the pod
so far. So you have learned all the pod concepts deployment services what is m
concepts deployment services what is m uh control plane master node worker node
uh control plane master node worker node the term as cubectl cubeate all these
the term as cubectl cubeate all these things right. So with this we have
things right. So with this we have actually covered the basic overview of
actually covered the basic overview of Kubernetes what is the architecture. So
Kubernetes what is the architecture. So now from the next part we'll be learning
now from the next part we'll be learning all the things whatever we've learned so
all the things whatever we've learned so far and then we are going to deploy this
far and then we are going to deploy this uh man application. So let's see how we
uh man application. So let's see how we are going to do that. All right. So
are going to do that. All right. So let's see how we are going to apply all
let's see how we are going to apply all the concepts that we have learned so far
the concepts that we have learned so far in our man application. So what will be
in our man application. So what will be our first step? See the first step will
our first step? See the first step will be so let's go here and uh let's do one
be so let's go here and uh let's do one thing. Let's copy this. So we're going
thing. Let's copy this. So we're going to write each and every steps that we
to write each and every steps that we are doing so that it will be easy to
are doing so that it will be easy to understand. So the first one will be we
understand. So the first one will be we need to install
need to install cube ctl right. So this is the CLI that
cube ctl right. So this is the CLI that will interact with Kubernetes that we
will interact with Kubernetes that we have discussed and to do that what we
have discussed and to do that what we going to do right. So let's open
going to do right. So let's open PowerShell
and I'm going to just install. I already have installed. So let's do one second.
have installed. So let's do one second. So I'm going to do choco
So I'm going to do choco install
kubernetes and I'm going to do cla. Okay. And let's
and I'm going to do cla. Okay. And let's enter.
Okay. You can see that it's already installed which is fine. And now once
installed which is fine. And now once you do that you need to check the
you do that you need to check the version. So I'm going to do cube ctl.
version. So I'm going to do cube ctl. All right. Vers. And I'm going to do
All right. Vers. And I'm going to do hyphen client. And let's copy this
hyphen client. And let's copy this and let's paste it here.
and let's paste it here. All right. And hit enter.
All right. And hit enter. And you can see that we have the client
And you can see that we have the client version and this is all the version that
version and this is all the version that is mentioned. So that mean this is
is mentioned. So that mean this is already installed. So now what we're
already installed. So now what we're going to do right once we install the
going to do right once we install the CLI, we need to install one more thing
CLI, we need to install one more thing and that is called mini cube. So what
and that is called mini cube. So what actually this is? So this is actually
actually this is? So this is actually very easy for your learning. So it's a
very easy for your learning. So it's a single node Kubernetes cluster right. So
single node Kubernetes cluster right. So what happened we have discussed the
what happened we have discussed the concept of control plane and the worker
concept of control plane and the worker node right? So what will happen both the
node right? So what will happen both the control plane and the worker node will
control plane and the worker node will be inside one VM or virtual machine. So
be inside one VM or virtual machine. So if you go go here you can see that it's
if you go go here you can see that it's actually local Kubernetes. This is easy
actually local Kubernetes. This is easy to learn and develop for your Kubernetes
to learn and develop for your Kubernetes right so that is the reason I decided to
right so that is the reason I decided to implement the same and to do this one
implement the same and to do this one this is also very very easy. So what you
this is also very very easy. So what you can do right is just choco install and
can do right is just choco install and you'll do mini cube. That's it. Mini
you'll do mini cube. That's it. Mini cube.
I also have this one also installed. Right. And to check the version, you
Right. And to check the version, you just have to do mini cube
just have to do mini cube version.
Okay. So let's do here. So once we install this, so we're going to do
install this, so we're going to do install
install mini cube
mini cube and mini cube
and mini cube version. Awesome. Now what will be our
version. Awesome. Now what will be our next step? And as I already told you
next step? And as I already told you that this is a Kubernetes cluster. Now
that this is a Kubernetes cluster. Now this cluster we need to start it. Now
this cluster we need to start it. Now why? Because what we going to do right?
why? Because what we going to do right? We are going to deploy man application
We are going to deploy man application that is going to run inside this cluster
that is going to run inside this cluster which is nothing but where this cluster
which is nothing but where this cluster will be having the main control planning
will be having the main control planning uh plane that we have discussed the
uh plane that we have discussed the master node and the worker node right
master node and the worker node right because if you see at the end worker
because if you see at the end worker nodes are managing all the pods and pods
nodes are managing all the pods and pods are managing all the containers that we
are managing all the containers that we are going to have right so now what I'm
are going to have right so now what I'm going to do right simply and to start it
going to do right simply and to start it we'll use this command that is called
we'll use this command that is called mini cube
mini cube right then I'm going to do part and here
right then I'm going to do part and here we are going to use the driver of docker
we are going to use the driver of docker right now this will what will happen
right now this will what will happen right this will run the cluster inside
right this will run the cluster inside docker right this cluster will be
docker right this cluster will be running inside docker so this what I'm
running inside docker so this what I'm going to do here so I'm going to do mini
going to do here so I'm going to do mini cube right and then I'm going to do
cube right and then I'm going to do start and I'm going to do driver this
start and I'm going to do driver this will be equal to docker and this also I
will be equal to docker and this also I have installed already okay so I hit
have installed already okay so I hit Enter.
I already have this one installed. You can see that it's showing that it's
can see that it's showing that it's based on the existing profile.
I think this will take some time. Let me just pause this. Once this is done, then
just pause this. Once this is done, then we're going to again I'll resume. All
we're going to again I'll resume. All right. So now you can see that uh this
right. So now you can see that uh this is now done. So now we need to uh do
is now done. So now we need to uh do quite a few steps right and we need to
quite a few steps right and we need to understand that why actually we are
understand that why actually we are doing each and everything. So first what
doing each and everything. So first what we need to do first we need to create
we need to do first we need to create images that we are going to use inside
images that we are going to use inside our mini cube. Now you might ask me why
our mini cube. Now you might ask me why actually we need that. Now remember one
actually we need that. Now remember one very very important point that our
very very important point that our cluster is running via mini cube right
cluster is running via mini cube right that means whenever we'll be creating
that means whenever we'll be creating that means mini cube doesn't know that
that means mini cube doesn't know that we'll be we are having these docker
we'll be we are having these docker images. Okay. So what we need to do
images. Okay. So what we need to do right, we need to add or get our docker
right, we need to add or get our docker images into mini cube, right? So what is
images into mini cube, right? So what is the flow right? So see if you see here,
the flow right? So see if you see here, right? So we have Kubernetes
right? So we have Kubernetes is doing what? It's running the
is doing what? It's running the containers, right? So it runs
containers, right? So it runs containers.
containers. Here containers
Here containers comes from where? So containers will be
comes from where? So containers will be coming from images right
coming from images right that means these images we need to
that means these images we need to create and we need to add in mini cube
create and we need to add in mini cube so that mini cube can see these docker
so that mini cube can see these docker images. So do mini cube can see docker
images. So do mini cube can see docker images. All right. Now remember that
images. All right. Now remember that when you've done docker compose on EC2,
when you've done docker compose on EC2, docker could see those images directly,
docker could see those images directly, right? But here what is happening? Mini
right? But here what is happening? Mini cube has its own docker engine inside
cube has its own docker engine inside the cluster VM, right? That cluster VM
the cluster VM, right? That cluster VM means where we are having the master
means where we are having the master node and the worker nodes, right? So
node and the worker nodes, right? So that means images that we built on our
that means images that we built on our laptop are not automatically visible. I
laptop are not automatically visible. I hope you're getting this is very
hope you're getting this is very important. It's not locally available
important. It's not locally available inside mini cube. we need to push or add
inside mini cube. we need to push or add or inject like in simple terms into mini
or inject like in simple terms into mini cube right so how we are going to do
cube right so how we are going to do that so actually what I've done right I
that so actually what I've done right I just add all the processes and I'm going
just add all the processes and I'm going to explain each and everything that what
to explain each and everything that what we are doing and I'll try to make this
we are doing and I'll try to make this one as simple as possible now before
one as simple as possible now before that we are going to make one change and
that we are going to make one change and that is so here you can see that we are
that is so here you can see that we are using the client's ID and we now again
using the client's ID and we now again we are using Kubernetes for our local so
we are using Kubernetes for our local so you'll be using local deployment Right?
you'll be using local deployment Right? That is the reason for now what I'll do
That is the reason for now what I'll do right simply remove this docker ignore
right simply remove this docker ignore from here this env. And also I'm going
from here this env. And also I'm going to remove this uh maybe let's remove
to remove this uh maybe let's remove that okay from this docker file also we
that okay from this docker file also we don't need this one for now. So let's
don't need this one for now. So let's see save uh remove both. Now what we
see save uh remove both. Now what we going to do right so first I'm going to
going to do right so first I'm going to build two images. So if you go here
build two images. So if you go here right so we don't have any image for
right so we don't have any image for now. So I'm going to create two images.
now. So I'm going to create two images. One will be for man back end. One will
One will be for man back end. One will be for man front end. Okay. So I'll go
be for man front end. Okay. So I'll go here. So you can see that we are simply
here. So you can see that we are simply using docker build t which is for tag
using docker build t which is for tag man backend colon dev. And this is the
man backend colon dev. And this is the directory. If you directly running from
directory. If you directly running from server then you have to give the context
server then you have to give the context remember only dot but we are running
remember only dot but we are running from the root. So you can just simply
from the root. So you can just simply copy this and then I'm going to just
copy this and then I'm going to just paste it here. Okay. Enter.
Now this will create our first docker image right. So this will be man backend
image right. So this will be man backend colon dev. So if you go here you'll be
colon dev. So if you go here you'll be able to see this. Similarly we need to
able to see this. Similarly we need to copy this
copy this and do the same for client side also. So
and do the same for client side also. So I'm going to just right click enter.
Awesome. So now I'm going to simply docker
docker images
images and you can see that you're getting this
and you can see that you're getting this one front end and back end both. Now
one front end and back end both. Now what we need to do right now we are
what we need to do right now we are going to load these two images into mini
going to load these two images into mini cube right. So how we are going to do
cube right. So how we are going to do that very very simple just have to use
that very very simple just have to use mini cube image load the name of the
mini cube image load the name of the image as simple as that. So copy this
and that's it. So it will take some time.
that's it. So it will take some time. Let's wait.
Awesome. So now it's done. The same thing we need to do for front end. So
thing we need to do for front end. So copy this one. Awesome.
So this is done. So now what we'll do right we'll simply do mini cube
right we'll simply do mini cube image ls
image ls and you'll be able to see that right. So
and you'll be able to see that right. So you're getting both awesome. So now what
you're getting both awesome. So now what you're going to do right if you go here
you're going to do right if you go here now you're going to create deployment
now you're going to create deployment for back end. We are going to save the
for back end. We are going to save the env. We are going to get the pods. It is
env. We are going to get the pods. It is going to create a pod. Then we are going
going to create a pod. Then we are going to forward the port because we are going
to forward the port because we are going to use the 5,000 for back end. We are
to use the 5,000 for back end. We are going to create the deployment for front
going to create the deployment for front end. And then we're going to expose this
end. And then we're going to expose this one to use this 5173 port. Right? So all
one to use this 5173 port. Right? So all these processes we need to do. Now here
these processes we need to do. Now here one more thing I want to mention that
one more thing I want to mention that why we are using deployment not parts.
why we are using deployment not parts. Now you can do that using ports also
Now you can do that using ports also because we have discussed that what is
because we have discussed that what is pod. Pod is actually the smallest
pod. Pod is actually the smallest deployment deployable unit. The only
deployment deployable unit. The only disadvantages of using pods and that is
disadvantages of using pods and that is what will happen right? If pods are
what will happen right? If pods are getting deleted right so they don't come
getting deleted right so they don't come back right. So that is the reason it's
back right. So that is the reason it's always better to create uh deployment.
always better to create uh deployment. Why? Because deployment will I already
Why? Because deployment will I already mentioned this one that this will fix
mentioned this one that this will fix the problem that it works as a pod
the problem that it works as a pod manager right? So that handles
manager right? So that handles everything right scaling update self
everything right scaling update self filling and all the things. Now again in
filling and all the things. Now again in the next when I'm going to explain all
the next when I'm going to explain all the things in details and also we're
the things in details and also we're going to write each and everything
going to write each and everything declarative means using yml file. These
declarative means using yml file. These things will be much more clear but here
things will be much more clear but here just learn simply that how you are going
just learn simply that how you are going to create a deployment. Now the next
to create a deployment. Now the next thing what we're going to do right so
thing what we're going to do right so creating deployment is very very simple.
creating deployment is very very simple. So just have to use cube ctl create
So just have to use cube ctl create deployment is going to create the
deployment is going to create the deployment. This back end is the name of
deployment. This back end is the name of the deployment and this is the image
the deployment and this is the image that based on which image you want to
that based on which image you want to create the deployment. So I'm going to
create the deployment. So I'm going to copy this and then just enter and this
copy this and then just enter and this will create a uh deployment right. What
will create a uh deployment right. What actually happen in the background? So it
actually happen in the background? So it will create a replica set. This replica
will create a replica set. This replica set create one pod running your back
set create one pod running your back ender because this is for back end image
ender because this is for back end image we have created right so that is the
we have created right so that is the advantages of using a deployment why
advantages of using a deployment why because deployment will going to take
because deployment will going to take care of this creating pods managing
care of this creating pods managing everything right so now if you want to
everything right so now if you want to check it what you can do you do cube ctl
check it what you can do you do cube ctl and you simply do get deployments
and you simply do get deployments enter and you can see that it's here now
enter and you can see that it's here now what we can do simply we need to add a
what we can do simply we need to add a env So here I already just copy this. So
env So here I already just copy this. So I'll just copy this one. STNV
I'll just copy this one. STNV deployment/backend
deployment/backend and this is the uri because this
and this is the uri because this is the same that we are using here. So
is the same that we are using here. So right click enter. So this will be
right click enter. So this will be updated and then what you're going to do
updated and then what you're going to do simply so let's check what parts are
simply so let's check what parts are there. So I'm going to copy this.
Okay. So you can see that this is now running. Now we will also get the logs
running. Now we will also get the logs right. So let's copy this. I want to get
right. So let's copy this. I want to get the logs
the logs connected to MongoDB and this is running
connected to MongoDB and this is running on port 5,000. Awesome. So now what we
on port 5,000. Awesome. So now what we can do simply we need to do this part.
can do simply we need to do this part. What we going to do? We're going to uh
What we going to do? We're going to uh forward this port to use this 5,000.
forward this port to use this 5,000. Okay. So I'm going to copy this one
Okay. So I'm going to copy this one and then right click enter. Now this
and then right click enter. Now this will take some time. Okay. You leave
will take some time. Okay. You leave this one as it is. Open a new terminal.
this one as it is. Open a new terminal. So now this will create our back end
So now this will create our back end deployment or back end deployment is
deployment or back end deployment is actually done. So now now back end is
actually done. So now now back end is running inside our cluster right mini
running inside our cluster right mini cube cluster which is actually using a
cube cluster which is actually using a VM that has the master node that we have
VM that has the master node that we have discussed and the worker nodes right
discussed and the worker nodes right which is basically handed by the
which is basically handed by the deployment. Deployment is created
deployment. Deployment is created deployments is actually created the pods
deployments is actually created the pods and that pod is actually running the
and that pod is actually running the container. See this is lot of things are
container. See this is lot of things are happening. Okay, so you need to
happening. Okay, so you need to understand this that image you we we
understand this that image you we we have fit those images into mini cube,
have fit those images into mini cube, right? Mini cube is actually running
right? Mini cube is actually running inside a VM, right? It's a cluster. Now
inside a VM, right? It's a cluster. Now what is actually VM? So we already
what is actually VM? So we already discussed the architecture of
discussed the architecture of Kubernetes, right? That we have a master
Kubernetes, right? That we have a master node and then we have the worker nodes
node and then we have the worker nodes in between what is happening, right?
in between what is happening, right? This deployment is actually managing all
This deployment is actually managing all these pods and everything and this pod
these pods and everything and this pod is actually managing or handling the
is actually managing or handling the container right container is nothing but
container right container is nothing but the container will be created from that
the container will be created from that image that docker image that we have
image that docker image that we have created. Which docker image I'm talking
created. Which docker image I'm talking about these two docker image. So now I'm
about these two docker image. So now I'm going to create the front end
going to create the front end deployment. So it's exactly the same
deployment. So it's exactly the same thing. So you just do create deployment
thing. So you just do create deployment front end. This is the name of the
front end. This is the name of the deployment and this is the image. So
deployment and this is the image. So copy this.
Okay. And then I'll just again expose this port 5173.
Okay. And now what we're going to do? So internally what will happen? Front end
internally what will happen? Front end SBC is going to call the back end SBC.
SBC is going to call the back end SBC. And then we are simply going to open
And then we are simply going to open this. Right. Expose uh not expose. We
this. Right. Expose uh not expose. We are going to open this one. So simply
are going to open this one. So simply we're going to copy this and then let's
we're going to copy this and then let's go here right click and let's do enter
and you can see that this is working awesome. So now you can see this is
awesome. So now you can see this is actually handled by Kubernetes. Each and
actually handled by Kubernetes. Each and everything is handled by Kubernetes.
everything is handled by Kubernetes. That means we have successfully deployed
That means we have successfully deployed our application in using Kubernetes. Now
our application in using Kubernetes. Now if you see here it will work absolutely
if you see here it will work absolutely fine. go here refresh and see this it's
fine. go here refresh and see this it's calling through this 5,000 API right so
calling through this 5,000 API right so if you add let's say new task added 1 2
if you add let's say new task added 1 2 3 4 5
this is added refresh this you'll be getting the updated data awesome so this
getting the updated data awesome so this is what process like lot of things are
is what process like lot of things are there definitely I can't uh like tell
there definitely I can't uh like tell that this is easy I already mentioned
that this is easy I already mentioned this will be lot of things will happen
this will be lot of things will happen also this is like a very very basic
also this is like a very very basic level of overflow that whatever you
level of overflow that whatever you discuss about Kubernetes we haven't
discuss about Kubernetes we haven't discussed anything at all I will say
discussed anything at all I will say there are a lot of things are there but
there are a lot of things are there but as a beginner I will pretty much you go
as a beginner I will pretty much you go to any DevOps course right they will not
to any DevOps course right they will not cover Kubernetes at all right you have
cover Kubernetes at all right you have to pay money or like I've noticed in
to pay money or like I've noticed in some YouTube videos it's there it's
some YouTube videos it's there it's pretty good right uh I think three four
pretty good right uh I think three four channels they cover really good so you
channels they cover really good so you can follow all these channels but most
can follow all these channels but most of the channels you'll see that they
of the channels you'll see that they will be not they will not cover
will be not they will not cover Kubernetes as a
Kubernetes as a you have to pay right then only you'll
you have to pay right then only you'll be able to understand because it's a
be able to understand because it's a very complex thing and using
very complex thing and using documentation you can learn but it is
documentation you can learn but it is very very tricky to learn so if someone
very very tricky to learn so if someone is teaching you it will be easy to learn
is teaching you it will be easy to learn right so with this I think now we have
right so with this I think now we have completed our first part of DevOps I'm
completed our first part of DevOps I'm pretty sure I think this will definitely
pretty sure I think this will definitely going to help you because we have done a
going to help you because we have done a lot of things small small parts but each
lot of things small small parts but each and every section is extremely important
and every section is extremely important if you want to become a DevOps engineer
if you want to become a DevOps engineer or you want to move to a different field
or you want to move to a different field from one field to DevOps field right or
from one field to DevOps field right or let's say you're in college you want to
let's say you're in college you want to learn DevOps this is like perfect start
learn DevOps this is like perfect start for you as a beginner so with this I
for you as a beginner so with this I think we have covered almost all the
think we have covered almost all the things I will I will add all the details
things I will I will add all the details in the uh description you can download
in the uh description you can download from my website you can just join for
from my website you can just join for free right I'll also be launching some
free right I'll also be launching some new course uh coming next year probably
new course uh coming next year probably I'm not sure about the exact dates so
I'm not sure about the exact dates so you can follow in my website all the
you can follow in my website all the things everything is free so with this
things everything is free so with this that's all for this particular video
that's all for this particular video I'll see you in my next video till then
I'll see you in my next video till then good luck and peace
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.