1 00:00:01,450 --> 00:00:04,010 We just got a reminder on the goal of the order service. 2 00:00:04,030 --> 00:00:06,260 So let's get started on putting this thing together. 3 00:00:06,280 --> 00:00:10,600 Here's what we're going to be doing inside of this video and the next one or two in the order service 4 00:00:10,630 --> 00:00:14,140 is going to be extremely similar nature to the ticketing service. 5 00:00:14,140 --> 00:00:18,610 So just about all the code all the topics we have learned in the last couple sections are going to be 6 00:00:18,670 --> 00:00:21,710 100 percent applicable to the order service as well. 7 00:00:21,730 --> 00:00:26,240 This is actually really good news because it means we get to write the order service really quickly. 8 00:00:26,260 --> 00:00:32,310 It's going to come together in a fraction of the time as what we spent on the tickets service. 9 00:00:32,350 --> 00:00:33,410 So here's what we're gonna do. 10 00:00:33,790 --> 00:00:36,620 We're going to duplicate a lot of code out of the ticket service. 11 00:00:36,670 --> 00:00:40,420 We're going to install some dependencies into the order service so we can eventually run some tests 12 00:00:40,450 --> 00:00:41,800 on our local machine. 13 00:00:42,070 --> 00:00:49,160 We'll build an image using Docker read a community's deployment config file setup some file sync options 14 00:00:49,160 --> 00:00:53,930 inside of our scaffold gamble file to make sure all the changes we make inside of orders get sent into 15 00:00:53,930 --> 00:00:55,590 our running pod. 16 00:00:55,610 --> 00:00:59,660 Then finally we're going to set up some routing rules inside the ingress service as well. 17 00:00:59,660 --> 00:01:02,920 That's at let's get started right away. 18 00:01:02,940 --> 00:01:07,000 I'm going to put back over to my editor and inside of my route ticketing directory I'm going to make 19 00:01:07,030 --> 00:01:15,260 a new folder called orders I'm then going to open up my tickets directory and we're going to copy over 20 00:01:15,290 --> 00:01:18,990 a decent number of things inside of here over two orders. 21 00:01:19,130 --> 00:01:25,880 So I'm going to multi select here I'm gonna get my s config file package Jason package the lock Docker 22 00:01:25,880 --> 00:01:31,970 file Docker ignore and we'll just start with those I'm going to copy all that and then paste it into 23 00:01:32,270 --> 00:01:39,240 orders I'm then going to go into each of these files very quickly and just make sure that I change any 24 00:01:39,240 --> 00:01:44,730 references to the tickets service over two orders instead it's going to start inside the docker file. 25 00:01:44,780 --> 00:01:45,050 OK. 26 00:01:45,060 --> 00:01:46,370 No issues here. 27 00:01:46,600 --> 00:01:48,660 I'm going to go in to package Jason. 28 00:01:48,660 --> 00:01:50,880 It looks like we have a name inside of your tickets. 29 00:01:50,880 --> 00:01:51,900 Doesn't really matter. 30 00:01:51,900 --> 00:01:55,990 Nonetheless let's update it to say orders instead. 31 00:01:56,050 --> 00:01:58,710 I don't think there's anything else inside of here that's super relevant. 32 00:01:58,760 --> 00:02:00,520 It's going to save the file and close it. 33 00:02:00,670 --> 00:02:02,560 And then finally the T has config file. 34 00:02:02,620 --> 00:02:03,340 Definitely nothing. 35 00:02:03,370 --> 00:02:07,780 Super projects specific inside of their next up inside of orders. 36 00:02:07,790 --> 00:02:10,850 I'm going to make a new folder called SLC. 37 00:02:11,030 --> 00:02:14,010 We're going to copy over a couple of different things. 38 00:02:14,200 --> 00:02:21,800 So I got a first copy over Nat's wrapper index T.S. and at t us from the tickets as our city directory 39 00:02:23,310 --> 00:02:26,820 gonna copy those three and paste them into orders 40 00:02:30,390 --> 00:02:32,840 if we now open up those three files inside of orders. 41 00:02:32,880 --> 00:02:35,720 We're definitely gonna see a lot of errors throughout these different files. 42 00:02:35,730 --> 00:02:41,460 So for example inside of orders probably can see some errors around this route stuff probably going 43 00:02:41,460 --> 00:02:48,040 to see a error or five inside the index t s file and inside of the Nats wrapper as well. 44 00:02:48,220 --> 00:02:48,930 That's OK. 45 00:02:48,970 --> 00:02:53,830 As soon as we install dependencies allow these errors are going to go away and the ones that don't go 46 00:02:53,830 --> 00:02:58,750 away we're going to fix up on our own. 47 00:02:58,780 --> 00:03:00,520 So that's all we're going to copy over for right now. 48 00:03:00,550 --> 00:03:05,460 We will eventually copy over a couple of other files from tickets but that's good enough for right now. 49 00:03:07,070 --> 00:03:13,660 So on to Step Two we're going to install dependencies into the order service on our local machine. 50 00:03:13,670 --> 00:03:17,420 The reason we're doing this is that we can eventually run some tests inside of here on our local machine 51 00:03:17,680 --> 00:03:22,040 not having to rely upon any OD or Docker stuff or anything like that. 52 00:03:22,130 --> 00:03:28,710 So I will go over to my terminal I can open up a new terminal window inside the ticketing project directory 53 00:03:30,340 --> 00:03:36,930 I'll then change into orders and do an npm install as we install dependencies. 54 00:03:36,940 --> 00:03:41,980 We are going to have to re download that Mongo DB memory server binary which usually takes a couple 55 00:03:41,980 --> 00:03:42,720 of minutes. 56 00:03:42,730 --> 00:03:44,430 Yep there it is right there. 57 00:03:44,440 --> 00:03:49,000 Personally I'm on a pretty slow internet connection so it's gonna take a little bit so while that's 58 00:03:49,000 --> 00:03:54,880 running let's go ahead and open up another terminal window and build an image out of this order service 59 00:03:57,280 --> 00:04:06,040 so I can open up a another terminal window still inside of orders and I'll run a docker build dash t 60 00:04:06,820 --> 00:04:14,120 even greater orders naturally you will want to replace it even greater with your doctor I.D. and then 61 00:04:14,150 --> 00:04:14,490 a doc 62 00:04:19,920 --> 00:04:24,640 that's going to take a moment as well because the image also has to download and install that Mongo 63 00:04:24,640 --> 00:04:25,450 DB binary. 64 00:04:25,480 --> 00:04:26,260 Actually it does not. 65 00:04:26,380 --> 00:04:31,270 I forgot we lock we listed that inside of the dev dependency so that should go a little bit more quickly. 66 00:04:31,420 --> 00:04:36,520 Regardless it is going to take just a moment for both the NPM installs and the docker build right here 67 00:04:36,520 --> 00:04:37,190 to complete. 68 00:04:37,240 --> 00:04:39,450 So I'll take a pause right here and continue in just a minute.