WEBVTT

00:00.240 --> 00:04.480
So let's say we created a default react app using

00:06.160 --> 00:09.760
this command in the terminal and then

00:10.260 --> 00:14.160
when we go to this folder we will see pretty default setup

00:14.560 --> 00:16.800
and let's see if it works.

00:19.840 --> 00:23.040
I would need to start it in a different port because my packet is started

00:23.540 --> 00:26.000
on 3,000 and probably yours. If you follow up with the course,

00:26.770 --> 00:30.930
we will see that our app is running on localhost 3002.

00:31.430 --> 00:34.850
In this specific case. What I want to do on top of that

00:35.350 --> 00:39.090
is actually go back to the index file

00:39.170 --> 00:44.130
and ask GitHub Copilot to add React

00:44.370 --> 00:48.050
query provider Because React query is the tool I want to use to

00:48.550 --> 00:52.170
make a request and save the state with the backend. Let's see

00:52.670 --> 00:56.210
what it will suggest me to do. So it will import react

00:56.710 --> 01:00.370
query, it will create a client and set it up. In order for this

01:00.870 --> 01:03.290
to work I would need to first of all check if everything is all right.

01:03.770 --> 01:08.730
So I will need to fix this mistake and then I will need to install

01:10.010 --> 01:13.450
react Query in order for this

01:13.950 --> 01:17.770
application to work. What I will do is

01:17.850 --> 01:21.610
actually create a new file. I will

01:22.110 --> 01:26.090
call it companies and I will ask GitHub Copilot

01:26.590 --> 01:30.370
to create a react functional component

01:30.610 --> 01:34.370
with React query. Fetching data

01:35.810 --> 01:40.450
from company's API generated

01:40.950 --> 01:44.370
the default component for us. We will need to check if

01:44.870 --> 01:48.600
the API is correct, so let's accept it.

01:49.800 --> 01:53.040
Definitely the URL is incorrect here,

01:53.540 --> 01:57.120
so we would need to change it to our backend API which

01:57.620 --> 02:01.800
is localhost 3000 API version 1 and

02:01.880 --> 02:05.960
let's see if that works. Let's start our client.

02:06.920 --> 02:15.460
We should replace it with companies and

02:15.960 --> 02:19.620
we have a company sleep from our backend. So in this specific very short

02:20.120 --> 02:23.420
front end introduction, I also wanted to show you that you can pretty easily use

02:23.920 --> 02:27.220
GitHub Copilot for the front end development. Let's say I

02:27.720 --> 02:31.700
want to adjust the CSS as well for this file and

02:32.200 --> 02:36.980
even though I have some I don't know companies list

02:38.590 --> 02:41.870
you will see it will give me a suggestion how typically list are implemented.

02:42.350 --> 02:47.150
Let's say I want to use it and I will edit the proper

02:47.550 --> 02:48.590
class names here.

02:56.190 --> 02:59.870
Let's see if it's helped. So now you see that our header

03:00.110 --> 03:03.350
is on the separate side from our list which will

03:03.850 --> 03:08.660
have it even suggests you the default properties which is most common 0

03:09.160 --> 03:15.220
parent 0 marring and list l none. I want the company's list companies

03:16.340 --> 03:19.940
list direct descendants

03:20.100 --> 03:23.220
list items to be, let's say

03:23.720 --> 03:28.580
to have some margin and then maybe have some border of

03:29.220 --> 03:33.790
2 pixels solid gray.

03:33.870 --> 03:37.590
Let it be great. So let's see if it works and I will see the

03:38.090 --> 03:41.750
CSS properly defined. I do not want to go deeper with

03:42.250 --> 03:45.950
the CSS because you can do all sorts of things, but that would be a

03:46.110 --> 03:47.230
completely different story.
