We just got a reminder on the goal of the order service.
So let's get started on putting this thing together.
Here's what we're going to be doing inside of this video and the next one or two in the order service
is going to be extremely similar nature to the ticketing service.
So just about all the code all the topics we have learned in the last couple sections are going to be
100 percent applicable to the order service as well.
This is actually really good news because it means we get to write the order service really quickly.
It's going to come together in a fraction of the time as what we spent on the tickets service.
So here's what we're gonna do.
We're going to duplicate a lot of code out of the ticket service.
We're going to install some dependencies into the order service so we can eventually run some tests
on our local machine.
We'll build an image using Docker read a community's deployment config file setup some file sync options
inside of our scaffold gamble file to make sure all the changes we make inside of orders get sent into
our running pod.
Then finally we're going to set up some routing rules inside the ingress service as well.
That's at let's get started right away.
I'm going to put back over to my editor and inside of my route ticketing directory I'm going to make
a new folder called orders I'm then going to open up my tickets directory and we're going to copy over
a decent number of things inside of here over two orders.
So I'm going to multi select here I'm gonna get my s config file package Jason package the lock Docker
file Docker ignore and we'll just start with those I'm going to copy all that and then paste it into
orders I'm then going to go into each of these files very quickly and just make sure that I change any
references to the tickets service over two orders instead it's going to start inside the docker file.
OK.
No issues here.
I'm going to go in to package Jason.
It looks like we have a name inside of your tickets.
Doesn't really matter.
Nonetheless let's update it to say orders instead.
I don't think there's anything else inside of here that's super relevant.
It's going to save the file and close it.
And then finally the T has config file.
Definitely nothing.
Super projects specific inside of their next up inside of orders.
I'm going to make a new folder called SLC.
We're going to copy over a couple of different things.
So I got a first copy over Nat's wrapper index T.S. and at t us from the tickets as our city directory
gonna copy those three and paste them into orders
if we now open up those three files inside of orders.
We're definitely gonna see a lot of errors throughout these different files.
So for example inside of orders probably can see some errors around this route stuff probably going
to see a error or five inside the index t s file and inside of the Nats wrapper as well.
That's OK.
As soon as we install dependencies allow these errors are going to go away and the ones that don't go
away we're going to fix up on our own.
So that's all we're going to copy over for right now.
We will eventually copy over a couple of other files from tickets but that's good enough for right now.
So on to Step Two we're going to install dependencies into the order service on our local machine.
The reason we're doing this is that we can eventually run some tests inside of here on our local machine
not having to rely upon any OD or Docker stuff or anything like that.
So I will go over to my terminal I can open up a new terminal window inside the ticketing project directory
I'll then change into orders and do an npm install as we install dependencies.
We are going to have to re download that Mongo DB memory server binary which usually takes a couple
of minutes.
Yep there it is right there.
Personally I'm on a pretty slow internet connection so it's gonna take a little bit so while that's
running let's go ahead and open up another terminal window and build an image out of this order service
so I can open up a another terminal window still inside of orders and I'll run a docker build dash t
even greater orders naturally you will want to replace it even greater with your doctor I.D. and then
a doc
that's going to take a moment as well because the image also has to download and install that Mongo
DB binary.
Actually it does not.
I forgot we lock we listed that inside of the dev dependency so that should go a little bit more quickly.
Regardless it is going to take just a moment for both the NPM installs and the docker build right here
to complete.
So I'll take a pause right here and continue in just a minute.