1 00:00:01,250 --> 00:00:05,540 With our common library all put together we're now going to start on our tickets service for real this 2 00:00:05,540 --> 00:00:06,220 time. 3 00:00:06,250 --> 00:00:09,590 Don't let's take a look at a couple of diagrams and understand how we're going to design and build this 4 00:00:09,590 --> 00:00:10,590 thing. 5 00:00:10,700 --> 00:00:10,950 All right. 6 00:00:10,990 --> 00:00:15,290 So first off listing of the different routes we're going to build into this micros service in total 7 00:00:15,410 --> 00:00:16,760 for different routes. 8 00:00:16,760 --> 00:00:21,440 One route to retrieve all tickets one to get a tick with a specific I.D. one to create a ticket and 9 00:00:21,440 --> 00:00:23,320 one to update a ticket. 10 00:00:23,390 --> 00:00:28,130 You'll notice on creating and updating a ticket I've said that we're going to include a body that has 11 00:00:28,130 --> 00:00:31,330 a title that is a string and a price that is a string as well. 12 00:00:31,490 --> 00:00:32,570 That is not a mistake. 13 00:00:32,570 --> 00:00:34,580 Our price is going to be communicated as a string. 14 00:00:34,650 --> 00:00:37,010 There is a specific reason for this and I'll show you why. 15 00:00:37,010 --> 00:00:43,290 As we get closer to actually building this ticket creation and update functionality as we start to build 16 00:00:43,290 --> 00:00:48,270 out the service we are going to need some location to store all this ticket data so the information 17 00:00:48,300 --> 00:00:53,910 about the title of the event that we are trying to sell access to the price of the ticket and who owns 18 00:00:53,910 --> 00:00:54,830 this ticket. 19 00:00:54,960 --> 00:00:58,800 So our ticket service is going to have its own individual copy of Mongo DB. 20 00:00:59,280 --> 00:01:04,430 This is 100 percent separate from the Mongo to be instance we are created for that auth service earlier. 21 00:01:04,530 --> 00:01:08,010 Inside there will probably end up with some kind of tickets collection. 22 00:01:08,100 --> 00:01:12,840 And right now I anticipate that for every ticket we store will probably want to store the title the 23 00:01:12,840 --> 00:01:17,640 price and the idea of the user who created this ticket and presumably owns it. 24 00:01:17,640 --> 00:01:21,870 We're going to eventually add in some additional properties to every ticket but these extra properties 25 00:01:21,870 --> 00:01:27,600 aren't going to make sense until we start to add in one or two other services into our application. 26 00:01:27,760 --> 00:01:29,330 How are we going to actually create the thing. 27 00:01:29,330 --> 00:01:34,150 Well it's going to be very similar overall to the off service they're going to create a package based 28 00:01:34,150 --> 00:01:34,960 on file. 29 00:01:34,960 --> 00:01:37,210 We're gonna install a ton of dependencies. 30 00:01:37,210 --> 00:01:42,610 We'll write out a docker file start to build the implementation building an image push it to Docker 31 00:01:42,610 --> 00:01:43,680 Hub. 32 00:01:43,840 --> 00:01:48,340 We're going to write out some McCain aides file to create the deployment and the service or our ticketing 33 00:01:48,340 --> 00:01:49,530 stuff. 34 00:01:49,620 --> 00:01:53,550 We're gonna make sure we update that scaffold file to do that file sinking stuff. 35 00:01:53,580 --> 00:01:59,370 Then finally we'll also create a case file or cabinet his file for the Mongo e deployment and the service 36 00:01:59,400 --> 00:02:00,900 as well. 37 00:02:00,940 --> 00:02:04,640 So this is what we would normally go through just about every time we want to create a new service. 38 00:02:04,750 --> 00:02:09,270 But in this course just to save ourselves a little bit time and a little bit of headache. 39 00:02:09,310 --> 00:02:13,810 Well actually a lot of time to be honest with you we're going to kind of skip the first three steps 40 00:02:13,810 --> 00:02:16,390 or so let me tell you what I mean. 41 00:02:16,390 --> 00:02:22,890 These first three steps we essentially already have done inside of our op service so rather than creating 42 00:02:22,920 --> 00:02:28,260 a raw package based on file listing on all dependencies doing the docker file and then putting together 43 00:02:28,290 --> 00:02:32,440 all the code from scratch to create an express server while middleware and so on. 44 00:02:32,580 --> 00:02:37,830 We're going to pretty much just copy a lot of code directly from our auth service just to save ourselves 45 00:02:37,890 --> 00:02:42,920 a little bit of time so we're really going to do a little bit of copying and then we're going to resume 46 00:02:42,920 --> 00:02:43,680 from right here. 47 00:02:43,730 --> 00:02:49,120 We'll build out an initial image then we'll do the Cuban neti stuff the scaffold stuff and so on. 48 00:02:50,160 --> 00:02:55,290 So again just to save some time on an oral project we may or may not do this really depends on what 49 00:02:55,290 --> 00:02:58,950 you're building but it's definitely in to save us time in our case. 50 00:02:59,020 --> 00:03:00,420 So now we understand what we're gonna do. 51 00:03:00,420 --> 00:03:01,210 Quick pause here. 52 00:03:01,230 --> 00:03:02,630 Let's get to work in the next video.