Hey, did everyone stay here?
And welcome to another video.
Now, in this video, I will walk you through some of the real world aspects of how you build the back
end application.
Now, for majority of the course, we have predefined things that this is what we want to do and we
directly get started on to the code editor.
But this is not sometimes in fact, most of the time the case when you are building their real world
application, you first need to go ahead and write down what really your application should be doing
and then start a whole lot of brainstorming session, which involves a lot of pen and paper, sometimes
some online boards, and then once this is all being finalized, then you start writing your models
and there is a whole lot of complex process and I'll walk you through with majority of them.
Let's first go ahead and get started.
What we are going to build our very first application in this section and what we are going to push
into the production.
This will help you to understand that how you can craft application, which are lot more bigger than
what we are about to build, but this will give you a flow process.
So the first thing is build an application and I want an application that has following feature.
This is really complex and when it comes through the client work or a freelancing work, this is not
much of the clarity is there?
And client usually have no idea how they want their application to look.
They have a vague idea and you have to clarify your idea.
Remember, you are the brain of operation, so you will govern that how it's going to look like, what
you are going to support, what you are not going to support, what you'll have, what you'll drop.
So this is what I have now.
I have cleared it a little bit more.
So let's read what's the requirement here?
The return my username followers and followers for LinkedIn, Instagram and Facebook.
Now right now we are not writing an application which is having heavy complexity.
We will eventually will do that.
But right now these all values will be hardcoded.
So they will not be coming from the API of Facebook and all these things.
We can eventually we will have the knowledge eventually to do it.
But right now these are all going to be hardcoded values.
So Instagram, LinkedIn and Facebook and we have three values to return username followers and followers.
Now apart from that, we also want to return the active time and date when the request was made.
Why?
I don't know.
A lot of time we are going to see that client request for certain features that are very important for
them.
But you don't expect that he is going to use that.
You don't have to question at that point of time.
You simply want to just do the job that is really, really important.
Now, of course, your suggestion matters that if there is an alternative or better thing, you can
provide that.
But majority of the time you'll see that whatever the client needs, you need to deliver them.
Of course, we are just a medium to provide feasibility and feasibility of doing the work that they
want to do.
And at the very end, we are going to see that how we can return a value from the URL testing for API.
What does this means?
Now there is a strange requirement by this client that he wants to return the followers.
He wants to return the time as well, but also he want to create an application where if the user pass
on anything you in the URL, let just say where you are.
Is localhost something on the port slash hit?
Then we go ahead and return as back.
If I just say slash to it returns to back.
So this will help us to create some of the issues in our applications, some of the bugs.
And this will help us to understand a little bit more.
Now, once this is all clear, what do you do?
You go ahead and literally plan it.
And literally this happens on pen and papers, usually in most of the cases.
But in some cases I use these kinds of mind mapping tools and if you'll just Google it out, there is
no shortage of mind mapping tool.
This is in fact a really, really common process.
So if you look for mind mapping tool, you'll find a whole lot of them and feel free to use any one
of them.
You can go for exe mind, mind map, mirror whatever you want to use.
I recently have found that Miro has a great capabilities to work on with, so in the recent days I'm
using this one how you can use Miro to craft an application and decide what you're going to do, what
you are not going to do.
You simply first click on these three dots and you use the mind map and just drag and drop this mind
map up here on here so that we can easily access that.
You, by the way, also have an axis of templates and you can use the pre cooked up templates in case
you want to use that.
I usually don't use them and we're going to go ahead and click on this mind map and let's go ahead and
draw a mind map for this one.
So the first thing that we are going to have in this mind map is what do you want to write?
So let's go ahead and write in this one.
Some of the text that this is going to be my application.
So let's go ahead and add up some of the text.
So there we go.
Come on.
Okay.
So turns out it just needed a refresh.
Yes.
Sometimes they behave a little bit odd.
So let's go ahead and start with that.
So this is going to be my first application.
So let's call this as one app.
Okay.
Now moving further, what this app is going to do now, all the client has said that we just want the
user name and followers and follow us on Facebook, LinkedIn and all of that.
But I think it would be great if this application has a little bit more onto that.
So let's go ahead and create this very first route.
And here we are going to go ahead.
And let's just have a kind of a the subject is good.
So what we want to do, we want to create a home page for this API.
Now we won't be going too much in depth of this home page.
We just want to greet the user.
So let's go ahead and also write that that I want to greet the user here.
That's all.
That's all what we'll be doing.
Okay.
Now, apart from this, we also know that we have we are going to have a few roots up here.
So let's go ahead and create this one up here.
So in here we're going to go ahead and have another one.
And this time, let's kind of have the same up here.
This will be get route.
Now, don't you worry, I will talk a lot more about in depth about the get and status code and all
of that just for now.
There are multiple types of requests that a user can send and your application can behave accordingly
to that.
Right now, let's just call it as simply get request and that's all what we want to have.
The further down this get request can be transformed into multiple URL.
So how this is going to behave, let's go ahead and address that that somebody will say slash API,
of course, local host, whatever the port number is, then we are going to have a slash API slash and
then let's call this first one as Facebook or Instagram, which is I love that.
So we're going to go ahead and call this one as Instagram.
This sounds great and this sounds nice that we have this route and what we're going to return on this
route.
Now, that is also crucial for us.
So let's go ahead and have this one.
So in here, we're going to go ahead and return something really simple.
So we're going to use a simple node like this, or we can use this object like this.
So here we're going to return three things.
So let's call this one as username.
Then we are going to have follow followers and we're going to have followers.
Now of course these are going to be hardcoded, but this actually gives me a brief idea of how the things
are going to happen.
Now, similar to this, if somebody says that I want to have one more route, so let's go ahead and
have this another one and let's go ahead and get started.
This one, if somebody requests an API slash Facebook, I'm going to go ahead and first expand this
a little bit and let's go ahead and create a node for this.
That what you're going to return again?
Same.
I'll have a username and I have a followers and followers.
I can also see that a pattern that almost these things are operating.
So I can just create these ones and can redirect them onto the same one.
Now of course, if I would be getting these information from the API, I would love to do that.
But right now they are hardcoded.
That's why I'm getting the same kind of a different notes on each one of them.
Let's go ahead and have ops, not this one.
Let's go ahead and have another one here.
So let's go ahead and bring this one up here and let's grab this one and this one will be slash API,
slash LinkedIn.
This is nice.
And here we're going to go ahead and do the same stuff.
We will provide a username.
We will provide followers, follow words, and we are going to provide followers.
So my structure looks decent and I'm pretty kind of okay and happy with this.
Let's go ahead and move this one and this one up here.
Okay.
So these are the three things which I'll have, but there's a little bit more of a requirement if I
go back.
So these things are all done.
I need to require the active time and date when the request is made.
Makes sense.
So in this case, what I'll do is instead of returning it onto a different kind of a thing, I'll return
this as a same object.
So I'll return a date in all of them.
And this is how exactly you'll be doing in the real world application.
Based on the requirement, you are going to decide that this requires a separate route, a separate
method or something like that.
So this is all basics and we have done the requirements.
So we have done with the user name follows and follows all Instagram, LinkedIn and Facebook.
I'm also done with the date and time.
Now comes the important part which will create a bug a lot of bugs in our application, which will return
a value from the URL for testing API.
What does this means?
Let me explain this.
Probably I haven't used the best of the words to actually put this one up here.
What this is saying that if you make a get request, something like this and let's just say we'll use
this guy and if somebody says and come and say slash, API slash and then say number two or say my name
hit page or somebody says for whatever it can be, it can be anything.
Then we have to return something different.
What it says, you have to simply return the same value because this is an application which will help
you to test the API routes through the postman.
So let's say what we're going to do is we are going to put up a simple note and we're going to say simply
return whatever is there in there.
If I can write that there in URL.
Okay.
I know this is not really the best of the approach, but this is what we got.
Okay, this looks a little bit of the vague, but you'll notice that this will help us to declare and
create our application so much easily as the application will become complex.
This will help you to so much in in organizing the things.
So this is all done.
Make sure you create your own similar one in the upcoming videos and upcoming projects that we'll be
doing.
But this is all done for now and make sure you don't skip this one.
Go and create an account on any of the mind mapping application.
Try to simulate what I have done here, and this is going to definitely help you a lot.
Let's go ahead in the next video and try to write some code for the UI or kind of a thing that we have
created here.
Let's catch up in the next video.