1 00:00:00,940 --> 00:00:01,320 All right. 2 00:00:01,330 --> 00:00:04,600 Enough videos about the design or architecture of our application. 3 00:00:04,600 --> 00:00:06,480 Time to actually start writing some code. 4 00:00:06,520 --> 00:00:09,650 So in this video we're going to start working on our off service. 5 00:00:09,700 --> 00:00:14,470 This all service is going to be in charge of handling sign up signing in and so on. 6 00:00:14,470 --> 00:00:18,390 In total are off service is going to have four different routes assigned to it. 7 00:00:18,430 --> 00:00:24,310 So while the ability to sign up with the post request sign in with the Post sign out with the Post and 8 00:00:24,310 --> 00:00:27,380 also get information about the currently signed end user. 9 00:00:27,580 --> 00:00:29,670 So let's go back over to our terminal right away. 10 00:00:29,740 --> 00:00:34,750 We're going to start to generate some different files we're gonna do some NPM installation get some 11 00:00:34,750 --> 00:00:35,290 modules. 12 00:00:35,290 --> 00:00:41,760 All that kind of stuff for our off service to back at my terminal. 13 00:00:41,830 --> 00:00:44,350 I'm still inside my blog project directory. 14 00:00:44,350 --> 00:00:49,560 I'm gonna change out of that folder so I'm now back inside of a workspace directory and inside if you're 15 00:00:49,630 --> 00:00:53,610 going to generate a new overall folder for all of our different services. 16 00:00:53,650 --> 00:00:55,560 I'm going to call this ticketing. 17 00:00:55,730 --> 00:01:01,540 That is the name of our project ticketing then inside of ticketing. 18 00:01:01,560 --> 00:01:09,910 I'll create a new directory of off and change into it and then inside of this auth directory I'll run 19 00:01:10,030 --> 00:01:11,040 NPM in it. 20 00:01:11,120 --> 00:01:18,450 Dash Y there's our package dot Chase on file then inside of here we're going to first install a couple 21 00:01:18,450 --> 00:01:21,680 of different dependencies. 22 00:01:21,740 --> 00:01:26,910 I'm going to install typescript because remember we are gonna use typescript on this project. 23 00:01:26,910 --> 00:01:32,400 I'm gonna get Tess node Dev which is a tool that we're going to use to actually execute our project 24 00:01:32,400 --> 00:01:35,290 in a development environment. 25 00:01:35,400 --> 00:01:43,800 I'm going to get express I'll get at types slash Express and we'll just do that installation for right 26 00:01:43,800 --> 00:01:44,130 now. 27 00:01:44,130 --> 00:01:48,300 We will come back very shortly and add in many other dependencies into this project. 28 00:01:48,300 --> 00:01:54,050 But that's good enough to get started with so while that is running and then going to open up my code 29 00:01:54,050 --> 00:01:56,740 editor inside of our overall project directory. 30 00:01:56,750 --> 00:02:02,500 So the ticketing folder though looks like that's all done I'll change back out to ticketing and open 31 00:02:02,500 --> 00:02:04,320 up my code editor inside there. 32 00:02:06,680 --> 00:02:06,910 All right. 33 00:02:06,920 --> 00:02:09,420 So now we should see that auth project director right there. 34 00:02:09,470 --> 00:02:14,460 There's our package dot Chase on file then back at my terminal. 35 00:02:14,480 --> 00:02:20,380 I'm gonna change into that auth directory one more time and I'm going to generate a T S config file 36 00:02:20,380 --> 00:02:25,990 inside of here with TSC dash dash in it. 37 00:02:26,080 --> 00:02:27,780 So that's enough to get started with. 38 00:02:28,040 --> 00:02:34,580 I'm gonna go back over to my editor and I'll start writing out some code inside my auth directory. 39 00:02:34,580 --> 00:02:37,970 I'm gonna make a new folder called S.R. c. 40 00:02:38,090 --> 00:02:41,690 We're gonna start placing all of our code inside this our C directory. 41 00:02:41,690 --> 00:02:48,450 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 42 00:02:48,450 --> 00:02:49,960 this index not t s file. 43 00:02:50,000 --> 00:02:55,230 Then throw in some basic syntax and basic imports all that kind of stuff to get an express application 44 00:02:55,290 --> 00:02:56,670 up and running. 45 00:02:56,670 --> 00:03:00,410 So I will do an import Express from Express 46 00:03:03,110 --> 00:03:11,130 or then get my Jason from body dash parser I'm going to create a new app 47 00:03:14,640 --> 00:03:17,080 then I will associate the Jason middleware with it. 48 00:03:17,100 --> 00:03:21,470 So app use Jason. 49 00:03:21,720 --> 00:03:24,790 I'm not going to worry about setting up any root handlers just yet. 50 00:03:24,870 --> 00:03:27,930 And so finally I'll do an app to listen in this time around. 51 00:03:27,930 --> 00:03:30,570 We're gonna do a listen on port three thousand member. 52 00:03:30,570 --> 00:03:34,520 The port doesn't really make a difference once we start making use of Cuban eddies because we're gonna 53 00:03:34,530 --> 00:03:36,420 start to create all these different services. 54 00:03:36,450 --> 00:03:41,930 A Cuban navy service that is that's going to govern access to this off thing that we're putting together. 55 00:03:42,030 --> 00:03:47,080 So right now we'll just use a service sub three thousand because again doesn't really make a big difference. 56 00:03:47,830 --> 00:03:54,050 And then I would will put in a call back with the console log of listening on port three thousand 57 00:03:57,040 --> 00:03:59,390 let's now go over to our package shot Jason File. 58 00:03:59,410 --> 00:04:02,080 We're going to set up a start script inside there. 59 00:04:02,210 --> 00:04:03,310 So inside a package stop. 60 00:04:03,310 --> 00:04:10,520 Jason I'm going to remove the test script I can replace it would start and the command that we're going 61 00:04:10,520 --> 00:04:18,100 to run to start this thing up is test dash node dash dev and we want to run source slash index start 62 00:04:18,130 --> 00:04:19,250 to yes like so 63 00:04:22,650 --> 00:04:27,030 we are going to eventually run this thing inside of Cuban net is about right now let's change into this 64 00:04:27,060 --> 00:04:28,450 auth directory at our terminal. 65 00:04:28,590 --> 00:04:34,120 It just makes sure that we could run NPM start and have our application startup look back at my terminal 66 00:04:35,050 --> 00:04:41,450 I'm inside my auth directory still so I'll do an NPM start and there we go. 67 00:04:41,450 --> 00:04:43,350 Looks like we are all set. 68 00:04:43,570 --> 00:04:43,820 OK. 69 00:04:43,850 --> 00:04:46,120 So just a little bit of boilerplate to get started. 70 00:04:46,160 --> 00:04:50,000 Let's take a pause right here and discuss a couple of different things around this OTT service in just 71 00:04:50,000 --> 00:04:50,330 a moment.