WEBVTT

00:05.150 --> 00:06.560
Hey, did everyone stay here?

00:06.560 --> 00:08.120
And welcome to another video.

00:08.150 --> 00:12.200
Now, in this video, I will walk you through some of the real world aspects of how you build the back

00:12.200 --> 00:13.260
end application.

00:13.280 --> 00:17.330
Now, for majority of the course, we have predefined things that this is what we want to do and we

00:17.330 --> 00:19.730
directly get started on to the code editor.

00:19.730 --> 00:24.320
But this is not sometimes in fact, most of the time the case when you are building their real world

00:24.320 --> 00:30.140
application, you first need to go ahead and write down what really your application should be doing

00:30.140 --> 00:35.870
and then start a whole lot of brainstorming session, which involves a lot of pen and paper, sometimes

00:35.870 --> 00:40.850
some online boards, and then once this is all being finalized, then you start writing your models

00:40.850 --> 00:45.140
and there is a whole lot of complex process and I'll walk you through with majority of them.

00:45.290 --> 00:47.120
Let's first go ahead and get started.

00:47.120 --> 00:51.470
What we are going to build our very first application in this section and what we are going to push

00:51.470 --> 00:52.990
into the production.

00:53.000 --> 00:58.340
This will help you to understand that how you can craft application, which are lot more bigger than

00:58.340 --> 01:01.340
what we are about to build, but this will give you a flow process.

01:01.550 --> 01:06.860
So the first thing is build an application and I want an application that has following feature.

01:07.100 --> 01:12.950
This is really complex and when it comes through the client work or a freelancing work, this is not

01:12.950 --> 01:14.930
much of the clarity is there?

01:14.930 --> 01:18.470
And client usually have no idea how they want their application to look.

01:18.470 --> 01:21.110
They have a vague idea and you have to clarify your idea.

01:21.110 --> 01:26.180
Remember, you are the brain of operation, so you will govern that how it's going to look like, what

01:26.180 --> 01:29.660
you are going to support, what you are not going to support, what you'll have, what you'll drop.

01:29.660 --> 01:31.220
So this is what I have now.

01:31.220 --> 01:33.050
I have cleared it a little bit more.

01:33.050 --> 01:35.330
So let's read what's the requirement here?

01:35.330 --> 01:41.020
The return my username followers and followers for LinkedIn, Instagram and Facebook.

01:41.030 --> 01:45.260
Now right now we are not writing an application which is having heavy complexity.

01:45.260 --> 01:46.880
We will eventually will do that.

01:46.880 --> 01:49.520
But right now these all values will be hardcoded.

01:49.520 --> 01:53.330
So they will not be coming from the API of Facebook and all these things.

01:53.330 --> 01:56.270
We can eventually we will have the knowledge eventually to do it.

01:56.270 --> 01:59.210
But right now these are all going to be hardcoded values.

01:59.210 --> 02:04.910
So Instagram, LinkedIn and Facebook and we have three values to return username followers and followers.

02:04.910 --> 02:10.280
Now apart from that, we also want to return the active time and date when the request was made.

02:10.280 --> 02:11.120
Why?

02:11.150 --> 02:12.080
I don't know.

02:12.170 --> 02:16.940
A lot of time we are going to see that client request for certain features that are very important for

02:16.940 --> 02:17.300
them.

02:17.300 --> 02:20.150
But you don't expect that he is going to use that.

02:20.150 --> 02:22.430
You don't have to question at that point of time.

02:22.430 --> 02:25.910
You simply want to just do the job that is really, really important.

02:25.910 --> 02:29.930
Now, of course, your suggestion matters that if there is an alternative or better thing, you can

02:29.930 --> 02:30.530
provide that.

02:30.530 --> 02:34.490
But majority of the time you'll see that whatever the client needs, you need to deliver them.

02:34.490 --> 02:39.890
Of course, we are just a medium to provide feasibility and feasibility of doing the work that they

02:39.890 --> 02:40.640
want to do.

02:40.670 --> 02:46.220
And at the very end, we are going to see that how we can return a value from the URL testing for API.

02:46.550 --> 02:47.590
What does this means?

02:47.660 --> 02:52.340
Now there is a strange requirement by this client that he wants to return the followers.

02:52.340 --> 02:58.910
He wants to return the time as well, but also he want to create an application where if the user pass

02:58.910 --> 03:01.370
on anything you in the URL, let just say where you are.

03:01.520 --> 03:04.790
Is localhost something on the port slash hit?

03:05.240 --> 03:07.670
Then we go ahead and return as back.

03:07.670 --> 03:10.460
If I just say slash to it returns to back.

03:10.460 --> 03:14.450
So this will help us to create some of the issues in our applications, some of the bugs.

03:14.450 --> 03:16.700
And this will help us to understand a little bit more.

03:16.820 --> 03:19.190
Now, once this is all clear, what do you do?

03:19.220 --> 03:21.680
You go ahead and literally plan it.

03:21.680 --> 03:25.670
And literally this happens on pen and papers, usually in most of the cases.

03:25.670 --> 03:31.190
But in some cases I use these kinds of mind mapping tools and if you'll just Google it out, there is

03:31.190 --> 03:33.920
no shortage of mind mapping tool.

03:34.130 --> 03:36.620
This is in fact a really, really common process.

03:36.620 --> 03:42.320
So if you look for mind mapping tool, you'll find a whole lot of them and feel free to use any one

03:42.320 --> 03:42.590
of them.

03:42.590 --> 03:47.690
You can go for exe mind, mind map, mirror whatever you want to use.

03:47.780 --> 03:53.450
I recently have found that Miro has a great capabilities to work on with, so in the recent days I'm

03:53.450 --> 03:58.490
using this one how you can use Miro to craft an application and decide what you're going to do, what

03:58.490 --> 03:59.690
you are not going to do.

03:59.720 --> 04:04.820
You simply first click on these three dots and you use the mind map and just drag and drop this mind

04:04.820 --> 04:07.940
map up here on here so that we can easily access that.

04:07.970 --> 04:12.560
You, by the way, also have an axis of templates and you can use the pre cooked up templates in case

04:12.560 --> 04:13.280
you want to use that.

04:13.280 --> 04:18.830
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

04:18.830 --> 04:20.450
draw a mind map for this one.

04:21.080 --> 04:25.130
So the first thing that we are going to have in this mind map is what do you want to write?

04:25.130 --> 04:27.110
So let's go ahead and write in this one.

04:27.110 --> 04:29.810
Some of the text that this is going to be my application.

04:29.810 --> 04:32.240
So let's go ahead and add up some of the text.

04:32.240 --> 04:33.320
So there we go.

04:33.320 --> 04:34.040
Come on.

04:34.760 --> 04:34.890
Okay.

04:34.970 --> 04:36.860
So turns out it just needed a refresh.

04:36.860 --> 04:37.190
Yes.

04:37.190 --> 04:38.900
Sometimes they behave a little bit odd.

04:38.930 --> 04:40.700
So let's go ahead and start with that.

04:40.700 --> 04:42.950
So this is going to be my first application.

04:42.950 --> 04:45.320
So let's call this as one app.

04:46.100 --> 04:46.380
Okay.

04:46.550 --> 04:51.260
Now moving further, what this app is going to do now, all the client has said that we just want the

04:51.260 --> 04:54.920
user name and followers and follow us on Facebook, LinkedIn and all of that.

04:54.920 --> 04:58.880
But I think it would be great if this application has a little bit more onto that.

04:58.880 --> 05:01.280
So let's go ahead and create this very first route.

05:01.280 --> 05:02.630
And here we are going to go ahead.

05:02.840 --> 05:06.950
And let's just have a kind of a the subject is good.

05:06.950 --> 05:10.850
So what we want to do, we want to create a home page for this API.

05:10.880 --> 05:13.430
Now we won't be going too much in depth of this home page.

05:13.430 --> 05:14.840
We just want to greet the user.

05:14.840 --> 05:18.320
So let's go ahead and also write that that I want to greet the user here.

05:18.320 --> 05:18.770
That's all.

05:18.770 --> 05:20.090
That's all what we'll be doing.

05:20.360 --> 05:20.700
Okay.

05:20.720 --> 05:24.800
Now, apart from this, we also know that we have we are going to have a few roots up here.

05:24.800 --> 05:26.780
So let's go ahead and create this one up here.

05:26.900 --> 05:29.720
So in here we're going to go ahead and have another one.

05:29.720 --> 05:34.250
And this time, let's kind of have the same up here.

05:34.250 --> 05:35.660
This will be get route.

05:35.660 --> 05:40.400
Now, don't you worry, I will talk a lot more about in depth about the get and status code and all

05:40.400 --> 05:42.140
of that just for now.

05:42.140 --> 05:47.180
There are multiple types of requests that a user can send and your application can behave accordingly

05:47.180 --> 05:47.780
to that.

05:47.810 --> 05:51.830
Right now, let's just call it as simply get request and that's all what we want to have.

05:51.890 --> 05:56.120
The further down this get request can be transformed into multiple URL.

05:56.120 --> 06:02.420
So how this is going to behave, let's go ahead and address that that somebody will say slash API,

06:02.720 --> 06:08.030
of course, local host, whatever the port number is, then we are going to have a slash API slash and

06:08.030 --> 06:12.800
then let's call this first one as Facebook or Instagram, which is I love that.

06:13.100 --> 06:15.770
So we're going to go ahead and call this one as Instagram.

06:16.760 --> 06:22.430
This sounds great and this sounds nice that we have this route and what we're going to return on this

06:22.430 --> 06:22.910
route.

06:22.910 --> 06:24.380
Now, that is also crucial for us.

06:24.380 --> 06:25.940
So let's go ahead and have this one.

06:25.940 --> 06:29.330
So in here, we're going to go ahead and return something really simple.

06:29.330 --> 06:34.430
So we're going to use a simple node like this, or we can use this object like this.

06:34.430 --> 06:36.650
So here we're going to return three things.

06:36.650 --> 06:39.410
So let's call this one as username.

06:39.560 --> 06:44.720
Then we are going to have follow followers and we're going to have followers.

06:44.720 --> 06:49.100
Now of course these are going to be hardcoded, but this actually gives me a brief idea of how the things

06:49.100 --> 06:50.270
are going to happen.

06:50.270 --> 06:54.230
Now, similar to this, if somebody says that I want to have one more route, so let's go ahead and

06:54.230 --> 06:57.260
have this another one and let's go ahead and get started.

06:57.260 --> 07:05.990
This one, if somebody requests an API slash Facebook, I'm going to go ahead and first expand this

07:05.990 --> 07:08.870
a little bit and let's go ahead and create a node for this.

07:08.870 --> 07:10.700
That what you're going to return again?

07:10.700 --> 07:11.240
Same.

07:11.240 --> 07:18.380
I'll have a username and I have a followers and followers.

07:18.380 --> 07:22.340
I can also see that a pattern that almost these things are operating.

07:22.340 --> 07:26.060
So I can just create these ones and can redirect them onto the same one.

07:26.060 --> 07:30.290
Now of course, if I would be getting these information from the API, I would love to do that.

07:30.290 --> 07:31.730
But right now they are hardcoded.

07:31.730 --> 07:36.410
That's why I'm getting the same kind of a different notes on each one of them.

07:36.410 --> 07:38.870
Let's go ahead and have ops, not this one.

07:38.870 --> 07:41.330
Let's go ahead and have another one here.

07:42.870 --> 07:49.530
So let's go ahead and bring this one up here and let's grab this one and this one will be slash API,

07:49.560 --> 07:52.080
slash LinkedIn.

07:53.400 --> 07:54.540
This is nice.

07:54.540 --> 07:57.660
And here we're going to go ahead and do the same stuff.

07:58.900 --> 08:00.760
We will provide a username.

08:00.760 --> 08:07.150
We will provide followers, follow words, and we are going to provide followers.

08:07.720 --> 08:12.910
So my structure looks decent and I'm pretty kind of okay and happy with this.

08:13.690 --> 08:17.110
Let's go ahead and move this one and this one up here.

08:18.550 --> 08:18.790
Okay.

08:18.790 --> 08:23.500
So these are the three things which I'll have, but there's a little bit more of a requirement if I

08:23.500 --> 08:24.070
go back.

08:24.070 --> 08:25.390
So these things are all done.

08:25.390 --> 08:29.410
I need to require the active time and date when the request is made.

08:29.740 --> 08:30.520
Makes sense.

08:30.520 --> 08:35.770
So in this case, what I'll do is instead of returning it onto a different kind of a thing, I'll return

08:35.770 --> 08:36.820
this as a same object.

08:36.820 --> 08:38.650
So I'll return a date in all of them.

08:39.190 --> 08:42.250
And this is how exactly you'll be doing in the real world application.

08:42.250 --> 08:46.570
Based on the requirement, you are going to decide that this requires a separate route, a separate

08:46.570 --> 08:48.160
method or something like that.

08:48.760 --> 08:51.160
So this is all basics and we have done the requirements.

08:51.160 --> 08:56.590
So we have done with the user name follows and follows all Instagram, LinkedIn and Facebook.

08:56.590 --> 08:58.750
I'm also done with the date and time.

08:58.750 --> 09:03.580
Now comes the important part which will create a bug a lot of bugs in our application, which will return

09:03.580 --> 09:05.770
a value from the URL for testing API.

09:05.980 --> 09:07.090
What does this means?

09:07.090 --> 09:08.050
Let me explain this.

09:08.050 --> 09:11.740
Probably I haven't used the best of the words to actually put this one up here.

09:11.830 --> 09:17.650
What this is saying that if you make a get request, something like this and let's just say we'll use

09:17.650 --> 09:25.960
this guy and if somebody says and come and say slash, API slash and then say number two or say my name

09:25.960 --> 09:31.360
hit page or somebody says for whatever it can be, it can be anything.

09:31.360 --> 09:33.220
Then we have to return something different.

09:33.220 --> 09:38.440
What it says, you have to simply return the same value because this is an application which will help

09:38.440 --> 09:40.600
you to test the API routes through the postman.

09:40.750 --> 09:46.240
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

09:46.240 --> 09:51.940
return whatever is there in there.

09:51.940 --> 09:55.280
If I can write that there in URL.

09:55.330 --> 09:55.890
Okay.

09:55.930 --> 09:59.470
I know this is not really the best of the approach, but this is what we got.

09:59.470 --> 10:04.870
Okay, this looks a little bit of the vague, but you'll notice that this will help us to declare and

10:04.870 --> 10:09.220
create our application so much easily as the application will become complex.

10:09.220 --> 10:13.600
This will help you to so much in in organizing the things.

10:14.110 --> 10:14.980
So this is all done.

10:14.980 --> 10:19.420
Make sure you create your own similar one in the upcoming videos and upcoming projects that we'll be

10:19.420 --> 10:19.660
doing.

10:19.660 --> 10:23.080
But this is all done for now and make sure you don't skip this one.

10:23.080 --> 10:26.380
Go and create an account on any of the mind mapping application.

10:26.380 --> 10:30.580
Try to simulate what I have done here, and this is going to definitely help you a lot.

10:30.610 --> 10:36.220
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

10:36.220 --> 10:36.880
created here.

10:36.880 --> 10:38.230
Let's catch up in the next video.
