All right.
Enough videos about the design or architecture of our application.
Time to actually start writing some code.
So in this video we're going to start working on our off service.
This all service is going to be in charge of handling sign up signing in and so on.
In total are off service is going to have four different routes assigned to it.
So while the ability to sign up with the post request sign in with the Post sign out with the Post and
also get information about the currently signed end user.
So let's go back over to our terminal right away.
We're going to start to generate some different files we're gonna do some NPM installation get some
modules.
All that kind of stuff for our off service to back at my terminal.
I'm still inside my blog project directory.
I'm gonna change out of that folder so I'm now back inside of a workspace directory and inside if you're
going to generate a new overall folder for all of our different services.
I'm going to call this ticketing.
That is the name of our project ticketing then inside of ticketing.
I'll create a new directory of off and change into it and then inside of this auth directory I'll run
NPM in it.
Dash Y there's our package dot Chase on file then inside of here we're going to first install a couple
of different dependencies.
I'm going to install typescript because remember we are gonna use typescript on this project.
I'm gonna get Tess node Dev which is a tool that we're going to use to actually execute our project
in a development environment.
I'm going to get express I'll get at types slash Express and we'll just do that installation for right
now.
We will come back very shortly and add in many other dependencies into this project.
But that's good enough to get started with so while that is running and then going to open up my code
editor inside of our overall project directory.
So the ticketing folder though looks like that's all done I'll change back out to ticketing and open
up my code editor inside there.
All right.
So now we should see that auth project director right there.
There's our package dot Chase on file then back at my terminal.
I'm gonna change into that auth directory one more time and I'm going to generate a T S config file
inside of here with TSC dash dash in it.
So that's enough to get started with.
I'm gonna go back over to my editor and I'll start writing out some code inside my auth directory.
I'm gonna make a new folder called S.R. c.
We're gonna start placing all of our code inside this our C directory.
I'm going to first begin by creating a app Dot T S or C me index Dot T S to get started with file inside
this index not t s file.
Then throw in some basic syntax and basic imports all that kind of stuff to get an express application
up and running.
So I will do an import Express from Express
or then get my Jason from body dash parser I'm going to create a new app
then I will associate the Jason middleware with it.
So app use Jason.
I'm not going to worry about setting up any root handlers just yet.
And so finally I'll do an app to listen in this time around.
We're gonna do a listen on port three thousand member.
The port doesn't really make a difference once we start making use of Cuban eddies because we're gonna
start to create all these different services.
A Cuban navy service that is that's going to govern access to this off thing that we're putting together.
So right now we'll just use a service sub three thousand because again doesn't really make a big difference.
And then I would will put in a call back with the console log of listening on port three thousand
let's now go over to our package shot Jason File.
We're going to set up a start script inside there.
So inside a package stop.
Jason I'm going to remove the test script I can replace it would start and the command that we're going
to run to start this thing up is test dash node dash dev and we want to run source slash index start
to yes like so
we are going to eventually run this thing inside of Cuban net is about right now let's change into this
auth directory at our terminal.
It just makes sure that we could run NPM start and have our application startup look back at my terminal
I'm inside my auth directory still so I'll do an NPM start and there we go.
Looks like we are all set.
OK.
So just a little bit of boilerplate to get started.
Let's take a pause right here and discuss a couple of different things around this OTT service in just
a moment.