In the last video we did a little bit of environment setup and now we're ready to start working on our
first project.
So let's talk about what we're going to make.
All right so we're gonna start off with a very simple first little application.
We're gonna make a little tiny application that's just gonna make a network request to some outside
API fetch some data and we're going to try to print that data inside of our terminal and that's it.
Now with this first application I'm not trying to teach you any specific syntax or anything like that.
I just want to show you why we use typescript in general.
So as we write this program we're going to accidentally quote unquote know kind of accidentally introduce
one or two bugs into our application and then we're going to very quickly see that typescript has the
ability to help us catch those bugs while we are writing our code as opposed to when we execute our
code.
So again the point in this application is just to show you the typical workflow of typescript that's
it all right so that mind.
Let's talk about the flow that we're going to go through to actually build this application so step
one we're going to take a look at the API that we're going to use to fetch some data.
After that we're going to create a new project directory.
We're going to create a package dot Jason File inside there and then install axioms as an NPM module
XP exiles is a little module that we're going to use just to make a network request.
If you've never worked with this module before totally fine.
Acciona doesn't really have anything to do with typescript.
We're just going to use it to make a network request.
That's it.
So once we do all that setup then we'll start to write out some code.
All right.
So onto step number one.
Let's take a look at the API that we're going to use to fetch some data so here's a link to the API.
Right here on the screen and this is a fake API.
In other words it serves up fake data that we can use just for like testing or learning purposes.
In other words it's perfect for what we are trying to do right now.
So I going to pull up that documentation inside of a new tab and then scrolling down to a section called
resources.
All right.
So here's resources right here.
So these are all the different types of records so we can make a request to you or attempt to fetch
from this API.
We're going to attempt to fetch this list of to dos right here.
So going to click on that slash to dos link as soon as I do so you're going to see a ton of information
appear on the screen.
You'll notice that on my screen it appears to be very nicely formatted if it looks like a big blob of
text on your screen that's totally fine.
I've got a little chrome extension to automatically format Jace on data for me so if we make a network
request to this you are all right here we're going to get back a big list of fake to do items now we
don't really need this whole list.
I just want to try to fetch like one individual item.
So if that's just this first item off the list or the to do with an idea of one we can modify the URL
up here slightly.
So at the very end of the URL I'll add on slash 1 like so once I visit that link I'll then see a single
to do appear on the screen.
So this is the exact data that we want to fetch.
I want to fetch this data inside of our application and then just try to print out some information
from this to do to our terminal.
Like I said that's it.
All right.
So now that we understand the API we're going to work with we'll now flip on over to our terminal and
create a new project directory over inside my terminal.
I'm inside of a workspace directory of sorts.
You can place this folder anywhere on your machine that you want to I'll make a new project folder inside
of here and I'm going to call it batch.
Jason I'll then change into that directory and then I'm going to generate a new package not just on
file inside of here.
Remember Package dot Jason files are used to record all the different dependencies that we install into
a project.
Normally that's the case for JavaScript projects but this is same thing for typescript as well we record
dependencies inside of a package not just on file so to generate that file.
I'll run NPM in it Dash y
that's going to generate that file and now I can safely install that access module.
Remember Acciona is going to be used just to make that network request.
So to do so I'll run npm install axioms like so
Acciona is really small.
So this should install rather quickly once it's all done well then open up my code editor inside this
folder and we'll start to work on our project.
All right.
So here we go.
I should see inside of here the package dot JS on file and the node modules directory which has that
axis project or module that we just installed.
Now we've got everything set up.
Let's take a quick pause right here and we'll start to write some code in the next video.