Hey, did everyone are they sure?
And in this video, we're going to talk about how we can push our application to Heroku.
Let me remind you again, this application is still buggy and we are pushing the application in the
bug format onto the Heroku.
And I want you to do that also so that you can see that what kind of things goes wrong, what to expect,
and of course always expect that your application is not going to run on the first go.
So here is a kind of summary and the kind of a generalized code or workflow, whatever you want to call
to push your application on to Heroku, you'll see these kinds of things throughout the course.
I have designed a whole lot of them in this one.
So first step is to get in it, initialize your git, I'll walk you through with that.
Then we simply add all the files to this git repository or kind of a git tracking system and we commit
it to the git optionally.
You can push it to GitHub.
I won't be doing it.
It is not compulsory that you have to push everything to GitHub.
You can connect your GitHub to the application.
That is one of the way of doing the things.
But also you can directly maintain the entire git setup directly on the Hiroko as well.
A lot of people and a lot of companies do that and then you can simply go ahead, create a Heroku app,
push your code to Heroku debug and push again.
That's how it works.
Let's go ahead and give it a try.
The first thing I would like to do here is come on to any of your terminal and just go ahead and say
Heroku V.
This will give you at least some version of Heroku that is install if the hero quickly is installed.
Now reminding a gentle reminder to all of you for this one we are going to use CLI.
So make sure the heroku cli is installed.
It's a pretty simple install.
It couldn't be much more simpler than this, especially for windows.
Quickly click, click next.
I agree.
Okay.
And for my guys, it takes a little bit while to install it via brew.
Maybe you need to update your brew with the latest configuration of GitHub and everything.
So it might take some time, probably a couple of a couple of hours for the bad guys, assuming that
this is all ready.
Now, let's go ahead and check out our application.
So this is all good.
Okay, so now we are here.
Now we need to follow the instruction as it is.
So we're going to initialize a git repository and a whole bunch of other things.
So let's go ahead and do that.
It's pretty easy.
The first thing that we're going to do is make sure the git is installed in your system.
Then we are going to simply say, Get in it.
That's the command to initialize the git repository.
Now as soon as you're going to do this, this will create an empty directory which will have nothing
at all inside it.
It will also be hidden.
It can be seen on the Linux and Mac by issuing a command ls dash la and it will show you a dot.
Get in the VTS code.
It's not going to appear because the dot files are usually hidden and that's why on the windows there
are different set of commands, which I don't remember at the moment, but that's the command.
So moving further, once you are doing this and you are adding anything to that, that is an important
file known as git ignore.
Now this file is super important because I don't want to add all the things onto my git tracking system.
Some things like node modules can be recreated whenever I move anything to my system.
All I have to do is say NPM install.
That's it.
No argument or nothing.
I have to simply go ahead and here, come up say and NPM install and all the repositories will be taken
from the package store, JSON and the rest of the dependencies will be installed for me.
So you don't ever just pass on this node module file to anybody because simply it can be recreated.
Now once you put this git ignore, then you have to simply say that anything inside the node underscore
modules.
If I can write that correctly, make sure you write that correctly.
Anything inside the node modules.
I don't care about it.
I don't want to keep it under the track.
That's nice.
And whenever now you say that, hey, just add all the files it will be first looking into git ignore
will ignore all the files and then we'll install the rest of the stuff.
Let's go ahead and now add all of this.
So we're going to say get add and DOT means just add everything.
You can selectively mark the files as well, but I'll just add this one now this is okay.
And now we simply want to comment.
So we're going to simply say get commit, dash m make sure you issue a dash am option.
Otherwise it will open up a default data but don't want to go there.
So just go ahead and on that.
So we're going to call this one as let's call this on as my first production release OC Let's go ahead
and hit Enter.
Now it says, okay, all these files are now under the tracking, so that's nice.
Let's see, what are the other steps coming back up here?
So we have initialized the gate.
We have committed to this optionally to push GitHub.
I'm not going to do it.
Let's create a Heroku app next.
And by the way, these are all codes and everything.
These flows will be available to you as well so that you can do all of your development personally as
well.
Okay, let's create an app, make sure you are creating an app, not a pipeline.
There are a couple of options here.
Always this time at least we want to create an app.
We're going to call this one as AE and feel free to choose any name.
Something like AE of your name.
Something what?
Be awesome.
Let's create an app.
There we go.
And it's usually is an instantaneous process and we can do that.
Now it says you can use Hiroko, get you can connect to your GitHub or you can use the registry.
We'll be using this one, so make sure you install the hero quickly.
Great.
We have already done that.
Then use the Heroku login login to and just log in into the application.
Okay.
So let's go up here and say Heroku login.
Let's go ahead and do that and it's going to ask you that, hey, I'll open up a browser, press any
key, just go ahead and press any and it will open up things into the browser.
There we go.
You have to simply click on login, enter email and password if it asks you mine is not going to do
it and I can just go ahead and return back to my console and say, Hey, you have installed this one.
This is a fresh account that I've created just for this course.
So we are all good.
Okay, instructions are pretty clear.
Let's go back and see what more it is asking us to do.
Then you can go into a project, initialize your git.
We have already done that.
Now importantly, we have to mark a Heroku remote repository.
Make sure you copy it from here.
Because this includes the AE app, which is the app name yours is going to be different.
So you need to do that.
Once you copy this and add this, we'll come back here in a second.
First, let's do this match.
Let's go ahead and add this one.
This will instantaneous.
This won't be taking much of the time.
There we go.
And now we'll go back.
Now it will ask you to add all the files, make a commit.
We have already done that.
And now all we've got to do is say Git push Heroku master.
Now the GitHub master is different.
The Heroku master is different.
So I don't want to keep a track of my files two times.
I just want to do it once.
So I'm going to go ahead and add it, copy it up here and we'll push it directly to Heroku.
Let's go ahead and push it on to Heroku.
This shouldn't take much of the time.
And there we go.
It says, Building the resources.
Let's expand this fully.
And you can see all the logs here as well as you can see all the logs into the GitHub, not GitHub of
the Heroku as well.
Let's go ahead and do that.
A couple of things that I wanted to mention or bring your attention to is pruning the dev dependencies,
so it is removing all the packages which are associated to the dev dependencies.
And now it's saying, hey, everything looks good, verifying, deploying, it's done.
Okay, cool, it looks great.
Now let's see into the overview that how this thing is looking up.
It says, Hey, build, succeed.
Now you can go ahead and check your application.
Let's go ahead and click on open application and see what is happening.
Application error.
Okay.
A couple of bugs as I as I expected.
So this is all what we wanted to do in this video.
Yes, I know this is a cliff hanger.
We haven't successfully deployed our application, but at least it has been released to the application
or the production itself.
In the next video, we're going to work on fixing the bugs and issues and we'll talk more about that.
And let's go ahead and catch up in the next video.