1 00:00:00,890 --> 00:00:03,390 In the last video he started up scaffolds for the first time. 2 00:00:03,540 --> 00:00:08,670 Just so you know after building my images I started to be prompted with some eerie messages like the 3 00:00:08,670 --> 00:00:09,460 ones you see right here. 4 00:00:09,480 --> 00:00:13,470 Cynthia says manifest unknown not sure but tightly sure why this came up. 5 00:00:13,470 --> 00:00:18,000 I solved it by just ending scaffold with control C and then starting up scaffold Dev. 6 00:00:18,030 --> 00:00:22,740 Once again when I rebooted scaffold all these error messages went away so you might want to try doing 7 00:00:22,740 --> 00:00:29,270 the same thing on your own as well after starting up scaffold the second time let me scroll down here 8 00:00:29,300 --> 00:00:30,210 a little bit. 9 00:00:31,420 --> 00:00:35,770 I started to see some output from each of the different pods that are created. 10 00:00:35,770 --> 00:00:44,560 So here is some output from client from query comments moderation event bus posts and client again. 11 00:00:44,570 --> 00:00:48,800 I think client was stirred up one time got killed and then restarted again. 12 00:00:48,890 --> 00:00:52,700 The nice thing about scaffold first nice thing is that it's going to take all the logs coming out these 13 00:00:52,700 --> 00:00:56,080 pods and print them up easily read inside of our terminal. 14 00:00:56,120 --> 00:00:57,940 That's kind of a nice thing. 15 00:00:58,110 --> 00:01:03,430 We should still be able to access our application by trying to go to post dot com so I should build 16 00:01:03,480 --> 00:01:04,140 to refresh. 17 00:01:04,140 --> 00:01:05,430 Yep looks good. 18 00:01:05,430 --> 00:01:09,540 Do you remember that all of our data is stored in memory right now so every single time that we restart 19 00:01:09,540 --> 00:01:13,010 these different services we essentially are dumping all of our data. 20 00:01:13,020 --> 00:01:15,080 We'll fix that up on our next project for right now. 21 00:01:15,090 --> 00:01:16,560 That's just the reality. 22 00:01:16,800 --> 00:01:19,320 Now in theory we should be able to open up our code. 23 00:01:19,320 --> 00:01:23,670 Ed go over to some sub project like let's say client. 24 00:01:23,670 --> 00:01:30,060 I'll open up the s RC folder then the app dot J.S. file and maybe I'll make a change the each one right 25 00:01:30,060 --> 00:01:33,660 here so I'll put in create post with a bunch of exclamations. 26 00:01:33,920 --> 00:01:37,610 I'll then save that file and then go back over to my terminal and see what happens. 27 00:01:38,740 --> 00:01:44,800 You'll notice that we got a little bit of output right here from scaffold it saying OK it detected that 28 00:01:44,800 --> 00:01:46,070 one file is changed. 29 00:01:46,240 --> 00:01:52,610 It took that file and threw it into our client pod the client pod then automatically sorted that file 30 00:01:52,610 --> 00:01:56,210 changed and it rebuilt our ReACT application. 31 00:01:56,210 --> 00:02:01,310 So I should yield to go back over to my browser now and see those exclamations like so now I do have 32 00:02:01,340 --> 00:02:03,020 a very important note here. 33 00:02:03,020 --> 00:02:09,930 Something super critical for you to understand are recreate racked up application is setup through all 34 00:02:09,930 --> 00:02:12,540 to create react up magic and all that stuff. 35 00:02:12,580 --> 00:02:17,280 Anytime it sees a file change like create react up in general anytime it sees a file change it's going 36 00:02:17,280 --> 00:02:20,850 to rebuild the react application and refresh your browser for you. 37 00:02:20,910 --> 00:02:23,940 That is something that is built into create react up. 38 00:02:24,030 --> 00:02:29,040 In addition all these different nodes services we put together such as comments are all being executed 39 00:02:29,040 --> 00:02:35,280 with node man and Node man as a tool to restart your project any time it sees a change to a file inside 40 00:02:35,280 --> 00:02:36,970 of a given directory. 41 00:02:37,020 --> 00:02:42,360 So right now all of our different pods the containers inside them are using tools that are going to 42 00:02:42,420 --> 00:02:48,900 restart the given primary process whenever it sees a change to a file inside of that pod. 43 00:02:48,900 --> 00:02:52,380 There's kind of like two levels of restarting or change detection here. 44 00:02:52,380 --> 00:02:57,840 First off if we make a change to one of these files right here scaffold is going to see that kick in. 45 00:02:57,840 --> 00:03:01,470 Take the updated file and throw it into a pod and then inside the pod. 46 00:03:01,470 --> 00:03:03,240 Or more specifically inside the container. 47 00:03:03,240 --> 00:03:08,490 We are running very specific processes like create react up or node bond that are seeing changes to 48 00:03:08,490 --> 00:03:16,440 the files inside of that container and then restarting the primary process of that container. 49 00:03:16,440 --> 00:03:21,990 Long story short if you start to write out some node applications or if you have some other kind of 50 00:03:21,990 --> 00:03:26,940 front end application that does not use something like node wants something to automatically restart 51 00:03:26,940 --> 00:03:27,880 your application. 52 00:03:27,990 --> 00:03:33,150 If you just run this directly with node for example then even if scaffold throws an updated file into 53 00:03:33,150 --> 00:03:36,200 your pod it's not going to do you any good inside the pod. 54 00:03:36,210 --> 00:03:41,190 You still have to have something that's going to see the update file arrive in the pod and then restart 55 00:03:41,190 --> 00:03:42,820 the primary process. 56 00:03:42,970 --> 00:03:46,800 Now we usually do that with node with something like node Bonn or if you're using react. 57 00:03:46,980 --> 00:03:53,340 Yeah you just use create react app or something similar although this refresh stuff is very handy you 58 00:03:53,340 --> 00:03:55,380 set to make sure you take care of your part of the deal. 59 00:03:56,430 --> 00:04:02,120 OK so let's try making maybe a change when these nodes services all open up posts indexed at J.S. then 60 00:04:02,120 --> 00:04:03,700 maybe down here at the bottom. 61 00:04:03,770 --> 00:04:08,330 Remember we've got that old console log of fifty five was changed it to version 1000. 62 00:04:08,330 --> 00:04:15,560 How about I'll save that look back over to my terminal and there's the 1000 right there. 63 00:04:15,570 --> 00:04:21,040 The thing I want to mention very briefly is that using change detection or file change detection inside 64 00:04:21,050 --> 00:04:24,910 of Docker containers traditionally has been a little bit finicky. 65 00:04:24,950 --> 00:04:30,890 There are some file watchers so stuff like node bond or create react up where they will not always detect 66 00:04:30,890 --> 00:04:35,480 changes to files inside of a create react app or a docker container. 67 00:04:35,660 --> 00:04:39,740 So there will be scenarios where you start to change files and you don't see any output whatsoever from 68 00:04:39,740 --> 00:04:40,490 scaffold. 69 00:04:40,610 --> 00:04:44,810 You might see that scaffold says oh I'm going to sync a file but then you might not have anything coming 70 00:04:44,810 --> 00:04:51,920 out the pod set that says like oh I compiled successfully or I restarted the server or whatever else. 71 00:04:51,920 --> 00:04:55,980 That is a problem that we're probably enough to deal with on this next application we build on and so 72 00:04:56,000 --> 00:04:58,300 I'll give you a couple more notes on that on how to solve it. 73 00:04:58,310 --> 00:05:01,760 I just want to throw it out there right now that if you ever feel like you're making changes but they're 74 00:05:01,760 --> 00:05:06,590 not being reflected it's probably tied to the fact that we sometimes have challenges detecting file 75 00:05:06,590 --> 00:05:09,380 changes inside of containers all right. 76 00:05:09,400 --> 00:05:13,310 So those are just a couple of caveats I wanna throw out there really quickly but without a doubt we 77 00:05:13,310 --> 00:05:15,190 can run our application we can make changes to it. 78 00:05:15,230 --> 00:05:19,100 We don't have to rebuild the image update the deployment or any of that stuff manually. 79 00:05:20,520 --> 00:05:25,020 So now any sign that we want to say go work on another project or something. 80 00:05:25,140 --> 00:05:31,150 We are just going to stop scaffold we're gonna stop scaffold by hitting control see as soon as I do 81 00:05:31,150 --> 00:05:35,590 so as I mentioned scaffold is going to take a look at all those different config files we point it to 82 00:05:36,160 --> 00:05:39,030 it's gonna delete all the objects associated with them. 83 00:05:39,070 --> 00:05:44,500 So now if I do a UFC DL get pods we're gonna have no pods found. 84 00:05:44,780 --> 00:05:53,920 We could do a get deployments services and we only have the default Cuban 80s service right there. 85 00:05:54,080 --> 00:05:58,760 So this is fantastic for stopping all that stuff running when you don't want to use it anymore. 86 00:05:58,940 --> 00:06:06,120 And naturally if we ever want to start development again a simple scaffold dev and we are good to go. 87 00:06:06,310 --> 00:06:11,680 All right well this is a fantastic little tool that we're definitely going to use on our next big application. 88 00:06:11,680 --> 00:06:14,170 Well at this point I think we're all done with this first app. 89 00:06:14,170 --> 00:06:17,230 I don't have a lot of other things to tell you about it. 90 00:06:17,270 --> 00:06:18,910 We're gonna start to take a pause right here. 91 00:06:18,910 --> 00:06:23,380 We're gonna come back the next video we're gonna start to reflect on some of the really big lessons 92 00:06:23,380 --> 00:06:24,820 learned around this application. 93 00:06:24,910 --> 00:06:28,690 We can start to take a look at the next app that we're gonna put together so quick balls and I'll see 94 00:06:28,690 --> 00:06:29,730 you in just a minute.