1
00:00:05,320 --> 00:00:11,530
It's time for us to create our own server using Node.js.

2
00:00:12,220 --> 00:00:18,910
But before we get into that, let's understand to the question what is a server?

3
00:00:19,890 --> 00:00:26,550
Technically, a server is a computer program that runs on a computer.

4
00:00:27,030 --> 00:00:30,670
Well, this definition doesn't seem to be clear.

5
00:00:30,720 --> 00:00:35,880
So let's break it down into layman's understanding of a server.

6
00:00:37,090 --> 00:00:45,910
A server is a program that accepts requests from clients and then responds to those requests.

7
00:00:46,980 --> 00:00:52,830
The key word here is called the request and response.

8
00:00:53,310 --> 00:00:58,590
These two are the core responsibility of a server.

9
00:00:59,440 --> 00:01:07,480
A server, always take a request from a client and then process that request and give a response to

10
00:01:07,480 --> 00:01:09,850
the user based on the request.

11
00:01:10,570 --> 00:01:17,530
So as a back end developer, the server that we are going to create or you are going to create the core

12
00:01:17,530 --> 00:01:22,630
responsibility is to handle requests and response.

13
00:01:23,380 --> 00:01:31,570
Let's go back when we treated components of a Web application and let's talk more about a server.

14
00:01:32,630 --> 00:01:37,400
Well, a complete application comprises of clients.

15
00:01:37,400 --> 00:01:39,340
That is the front end part.

16
00:01:39,350 --> 00:01:43,460
So when we say clients, you always refers to the browser.

17
00:01:43,670 --> 00:01:51,620
For front end application, we use HTML, CSS and JavaScript to develop the front end application or

18
00:01:51,620 --> 00:01:53,390
we can use React.

19
00:01:53,390 --> 00:01:55,730
And that is what we have covered.

20
00:01:55,940 --> 00:02:03,230
That is HTML, CSS and JavaScript, and this is the front part of the application.

21
00:02:03,590 --> 00:02:10,160
Now to make a web application complete, definitely we need what is called a server.

22
00:02:11,000 --> 00:02:17,420
And the server that we are going to create, we are going to use Node.js to create our own server.

23
00:02:17,870 --> 00:02:23,040
So when a user makes a request, definitely the user is trying to fetch a data.

24
00:02:23,060 --> 00:02:26,480
In that case, we also need a data source.

25
00:02:27,460 --> 00:02:31,300
And we are going to use what is called MongoDB.

26
00:02:31,450 --> 00:02:33,910
Now let's look at the flow.

27
00:02:34,150 --> 00:02:42,640
Let's say that this client over here want to make a request to YouTube to fetch or to view trending

28
00:02:42,640 --> 00:02:43,420
videos.

29
00:02:43,840 --> 00:02:47,750
So the user will enter the URL of our server.

30
00:02:47,770 --> 00:02:49,710
In this case, going to be a looker.

31
00:02:49,880 --> 00:02:54,340
Host In production we're going to get our custom u URL.

32
00:02:54,760 --> 00:02:59,800
So let's say that we have developed this server called YouTube server.

33
00:03:00,400 --> 00:03:08,830
So when a user enter the URL and search for particular video, it means that this particular user is

34
00:03:08,830 --> 00:03:10,720
talking to our server.

35
00:03:11,020 --> 00:03:15,040
Then the server will also make a request to the database.

36
00:03:15,070 --> 00:03:21,130
So at this point, this what we call requests, meaning requesting what you want.

37
00:03:21,790 --> 00:03:26,230
Then after some time the server will be processing the data.

38
00:03:26,260 --> 00:03:28,690
At this point you're going to see loading.

39
00:03:29,320 --> 00:03:38,200
So after the request has completed and the response is ready, then the MongoDB or database source will

40
00:03:38,200 --> 00:03:45,770
send back the actual response to the server and the server will also send the results to the user.

41
00:03:45,790 --> 00:03:48,790
And this is what we call response.

42
00:03:49,270 --> 00:03:57,910
So as a backend developer, before they request get to the server, we are going to implement the code

43
00:03:57,910 --> 00:04:00,040
to handle that request.

44
00:04:00,910 --> 00:04:08,500
And then after the request has been received at this point to we are going to code to make business

45
00:04:08,500 --> 00:04:11,770
logic to fetch a particular video.

46
00:04:12,160 --> 00:04:15,310
So now we are done with the front end.

47
00:04:15,310 --> 00:04:18,350
So we are going to focus on the back end.

48
00:04:18,370 --> 00:04:19,779
That is our server.

49
00:04:20,410 --> 00:04:27,820
And the server comprises of the actual server and data source in this case MongoDB database.

50
00:04:28,120 --> 00:04:32,440
So this is what we are going to talk about to make a complete server.

51
00:04:32,770 --> 00:04:36,970
But let's move step by step and let's focus on a server.

52
00:04:37,000 --> 00:04:45,490
So in the upcoming videos, we are going to use no charges to create our own server whereby a client

53
00:04:45,490 --> 00:04:51,430
can visit our URL and then we will send a user what the person is requesting for.

54
00:04:51,850 --> 00:04:54,280
Let's get into that in the next video.

