Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:02,150 --> 00:00:04,560
Now that we built the app for production,
2
00:00:04,560 --> 00:00:07,380
the next step is that we wanna take that code
3
00:00:07,380 --> 00:00:11,980
in the build folder and move it onto a real server.
4
00:00:11,980 --> 00:00:14,770
We wanna upload it to some hosting provider,
5
00:00:14,770 --> 00:00:17,920
to a real server, so that it is made available
6
00:00:17,920 --> 00:00:20,930
to visitors from all over the world.
7
00:00:20,930 --> 00:00:23,228
And now when it comes to uploading that code,
8
00:00:23,228 --> 00:00:27,340
there is one super important thing to realize.
9
00:00:27,340 --> 00:00:29,950
A React Single Page Application
10
00:00:29,950 --> 00:00:32,750
or any Single Page Application actually,
11
00:00:32,750 --> 00:00:36,976
no matter which framework you used, is a static website
12
00:00:36,976 --> 00:00:41,403
which it means that it's only made up of HTML, CSS,
13
00:00:41,403 --> 00:00:44,333
and browser site JavaScript code.
14
00:00:45,200 --> 00:00:48,520
There is no server side code involved.
15
00:00:48,520 --> 00:00:51,670
If we take a look at the output in the build folder
16
00:00:51,670 --> 00:00:54,870
then we have a couple of images and conflict files here
17
00:00:54,870 --> 00:00:58,730
and we have one HTML file, and in the static folder
18
00:00:58,730 --> 00:01:00,970
we have CSS and JavaScript.
19
00:01:00,970 --> 00:01:04,310
And the JavaScript code here is not server side
20
00:01:04,310 --> 00:01:07,580
JavaScript code, it's not node js code,
21
00:01:07,580 --> 00:01:12,240
it is client side, browser side JavaScript code.
22
00:01:12,240 --> 00:01:13,640
And therefore this is code
23
00:01:13,640 --> 00:01:17,275
which executes in the browser, hence the entire build folder
24
00:01:17,275 --> 00:01:20,884
contains no code at all that needed
25
00:01:20,884 --> 00:01:23,630
to be executed on a server.
26
00:01:23,630 --> 00:01:28,560
No node js code, no PHP code, nothing.
27
00:01:28,560 --> 00:01:31,530
You can of course also build your own backend,
28
00:01:31,530 --> 00:01:34,910
your own API instead of Firebase, which we used
29
00:01:34,910 --> 00:01:36,858
as a dummy API in this course,
30
00:01:36,858 --> 00:01:39,260
but that's a totally different story.
31
00:01:39,260 --> 00:01:42,428
I do cover this in my Mern course, for example,
32
00:01:42,428 --> 00:01:45,623
but when it comes to just a react application,
33
00:01:45,623 --> 00:01:49,760
it is just such a static website
34
00:01:49,760 --> 00:01:52,760
and there is no server side code involved.
35
00:01:52,760 --> 00:01:55,430
And therefore, when we want to deploy
36
00:01:55,430 --> 00:01:58,190
such a react single page application,
37
00:01:58,190 --> 00:02:02,030
we need a static side host.
38
00:02:02,030 --> 00:02:04,210
So we need a hosting provider
39
00:02:04,210 --> 00:02:07,720
an offering for hosting a static website.
40
00:02:07,720 --> 00:02:11,320
We don't need a hosting provider that allows us to
41
00:02:11,320 --> 00:02:13,200
run server side code
42
00:02:13,200 --> 00:02:16,090
like no JS or PHP or anything like that.
43
00:02:16,090 --> 00:02:18,540
We don't need that here.
44
00:02:18,540 --> 00:02:20,600
Now, how do you find such a host?
45
00:02:20,600 --> 00:02:22,850
Well, for example, you can simply Google
46
00:02:22,850 --> 00:02:24,550
for a static website hosting provider
47
00:02:24,550 --> 00:02:28,550
and you'll find different comparisons, certainly
48
00:02:28,550 --> 00:02:32,988
also some advertisements and you'll find different results
49
00:02:32,988 --> 00:02:34,839
for hosting providers that help you
50
00:02:34,839 --> 00:02:37,610
with hosting your static site.
51
00:02:37,610 --> 00:02:40,696
For example, Google has a built in service.
52
00:02:40,696 --> 00:02:45,052
AWS has a service that helps you with hosting static sites,
53
00:02:45,052 --> 00:02:48,810
the S free service to be precise.
54
00:02:48,810 --> 00:02:51,413
If you click on here, you can learn more about that.
55
00:02:52,890 --> 00:02:55,410
But here to give you an example, I will go
56
00:02:55,410 --> 00:02:59,610
with Firebase again, but it's just one possible option.
57
00:02:59,610 --> 00:03:02,170
And just because we're using Firebase
58
00:03:02,170 --> 00:03:03,899
as a dummy backend does not mean
59
00:03:03,899 --> 00:03:07,180
that you need to use Firebase for hosting.
60
00:03:07,180 --> 00:03:08,770
You're totally free there.
61
00:03:08,770 --> 00:03:11,330
You can use any hosting provider.
62
00:03:11,330 --> 00:03:14,670
You don't have to use Firebase, not in general
63
00:03:14,670 --> 00:03:17,730
and also not specifically for this demo here.
64
00:03:17,730 --> 00:03:21,060
I simply picked it because it is fairly easy to use
65
00:03:21,060 --> 00:03:23,340
and if we have a look at the pricing,
66
00:03:23,340 --> 00:03:25,680
we can get started for free here
67
00:03:25,680 --> 00:03:28,080
which is also quite nice.
68
00:03:28,080 --> 00:03:30,460
Now to host a site on Firebase,
69
00:03:30,460 --> 00:03:33,130
you need to create an account there, a Google account
70
00:03:33,130 --> 00:03:35,163
and then log into Firebase.
71
00:03:36,070 --> 00:03:38,390
And here I'll use the project we worked on
72
00:03:38,390 --> 00:03:40,193
before in this course already.
73
00:03:41,050 --> 00:03:43,444
And here in that Firebase project,
74
00:03:43,444 --> 00:03:45,520
you can simply create a new one
75
00:03:45,520 --> 00:03:49,378
if you don't have one already, you can pick hosting.
76
00:03:49,378 --> 00:03:51,590
And if you then click on get started,
77
00:03:51,590 --> 00:03:54,140
you'll learn more about how that works.
78
00:03:54,140 --> 00:03:55,294
And it all starts
79
00:03:55,294 --> 00:03:59,643
by installing a certain tool on your system.
80
00:04:00,610 --> 00:04:03,774
So I will just copy that command here,
81
00:04:03,774 --> 00:04:07,560
go back back to my command line here
82
00:04:07,560 --> 00:04:09,380
and then run this command.
83
00:04:09,380 --> 00:04:10,700
On Mac iOS and Linux,
84
00:04:10,700 --> 00:04:13,300
you might need to add pseudo in front of it.
85
00:04:13,300 --> 00:04:16,810
On Windows you don't, to give it the right permissions.
86
00:04:16,810 --> 00:04:20,649
So here I'll add that and enter my password.
87
00:04:20,649 --> 00:04:23,840
And then now this installs this Firebase tools software
88
00:04:23,840 --> 00:04:24,853
on my system.
89
00:04:25,800 --> 00:04:29,770
Now because of dash G, it installs it globally.
90
00:04:29,770 --> 00:04:32,850
So that is now not a project specific tool
91
00:04:32,850 --> 00:04:35,590
and it's also not a react specific tool.
92
00:04:35,590 --> 00:04:39,345
It's just a general piece of software provided by Firebase
93
00:04:39,345 --> 00:04:43,893
for deploying any kind of static site to Firebase.
94
00:04:44,830 --> 00:04:48,070
So let's wait for this installation to finish now
95
00:04:48,070 --> 00:04:49,920
and now that it is finished,
96
00:04:49,920 --> 00:04:53,153
if we go back to Firebase, we can click on next here.
97
00:04:54,930 --> 00:04:56,980
And you see that as a next step
98
00:04:56,980 --> 00:04:58,260
you need to log in.
99
00:04:58,260 --> 00:05:01,930
So you now need to run this command, which should now work.
100
00:05:01,930 --> 00:05:04,889
Now that Firebase tools was installed to log
101
00:05:04,889 --> 00:05:06,943
into your Firebase account.
102
00:05:08,250 --> 00:05:10,510
Now, I am already logged in here.
103
00:05:10,510 --> 00:05:12,690
For you, it might prompt you
104
00:05:12,690 --> 00:05:15,340
for your credentials in the command line here
105
00:05:15,340 --> 00:05:19,270
or it opens a browser tab where you need to log in.
106
00:05:19,270 --> 00:05:21,790
And once you did that, you should also be able to
107
00:05:21,790 --> 00:05:23,883
continue here in the command prompt.
108
00:05:25,830 --> 00:05:30,450
Now once you are logged in, you need to run Firebase in it.
109
00:05:30,450 --> 00:05:34,710
And now this needs to be executed in your project folder
110
00:05:34,710 --> 00:05:37,640
so in this overall react project folder.
111
00:05:37,640 --> 00:05:40,600
Now since I'm using this integrated terminal here,
112
00:05:40,600 --> 00:05:43,050
I am already navigated in there
113
00:05:43,050 --> 00:05:44,883
and hence, I can just run it here.
114
00:05:45,730 --> 00:05:48,230
Now, this command, when you execute it
115
00:05:48,230 --> 00:05:50,410
will ask you a couple of questions.
116
00:05:50,410 --> 00:05:52,010
For example, it will ask us
117
00:05:52,010 --> 00:05:54,800
which Firebase features we want to use
118
00:05:54,800 --> 00:05:57,380
because you can use this Firebase tools
119
00:05:57,380 --> 00:06:02,280
software to administer other Firebase features as well.
120
00:06:02,280 --> 00:06:06,660
But here, we just want to go to hosting and hit space.
121
00:06:06,660 --> 00:06:10,820
The space button on our keyboard to select this option.
122
00:06:10,820 --> 00:06:14,490
And that is the only option we need to select here.
123
00:06:14,490 --> 00:06:17,670
So once you've selected hosting, hit enter
124
00:06:17,670 --> 00:06:19,940
and now you need to choose whether you want to
125
00:06:19,940 --> 00:06:24,390
create a new Firebase project or use an existing one.
126
00:06:24,390 --> 00:06:26,520
And I'll go with an existing one here
127
00:06:26,520 --> 00:06:28,780
and then select this project
128
00:06:28,780 --> 00:06:32,043
which I also opened here in my browser console.
129
00:06:32,950 --> 00:06:36,480
So select that project and hit enter.
130
00:06:36,480 --> 00:06:39,720
And now it asks us a very important question here.
131
00:06:39,720 --> 00:06:43,540
It asks what we want to use as our public directory.
132
00:06:43,540 --> 00:06:44,680
And that simply means
133
00:06:44,680 --> 00:06:47,390
that it wants to know where the files are
134
00:06:47,390 --> 00:06:49,160
that it should deploy.
135
00:06:49,160 --> 00:06:52,094
Now, by default, it uses the public folder here
136
00:06:52,094 --> 00:06:54,060
but that would be wrong here
137
00:06:54,060 --> 00:06:56,865
because public is a folder in our project, but
138
00:06:56,865 --> 00:07:00,160
it is a folder where we can change
139
00:07:00,160 --> 00:07:01,930
the images we use and so on.
140
00:07:01,930 --> 00:07:04,900
The actual output which we want to deploy, lives
141
00:07:04,900 --> 00:07:08,100
in the build folder, as you learned.
142
00:07:08,100 --> 00:07:11,060
So here we don't want to use the default, but instead
143
00:07:11,060 --> 00:07:13,260
manually enter build here
144
00:07:13,260 --> 00:07:17,190
since that's the folder name that contains our files
145
00:07:17,190 --> 00:07:18,350
that should be deployed.
146
00:07:18,350 --> 00:07:20,640
So that's super important.
147
00:07:20,640 --> 00:07:25,070
And if you use another hosting provider like AWS as free
148
00:07:25,070 --> 00:07:27,310
you also want to upload the content
149
00:07:27,310 --> 00:07:30,780
of your build folder to that hosting provider.
150
00:07:30,780 --> 00:07:33,880
Now, as a next step, it conveniently asks us
151
00:07:33,880 --> 00:07:38,280
wherever we want to configure this app as a single page app.
152
00:07:38,280 --> 00:07:41,927
So if you want to rewrite all URLs to index HTML
153
00:07:41,927 --> 00:07:45,190
but that can be a confusing question here.
154
00:07:45,190 --> 00:07:46,330
Why does this matter?
155
00:07:46,330 --> 00:07:47,563
And what is it about?
12317
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.