A software engineer develops a new notification microservice in a NestJS project. The process includes configuring Docker files, updating environment variables, establishing event-based communication patterns for emailing users, and refactoring the existing payment service to integrate and trigger notifications after successful transactions.
Length 14:15
Captions English (Generated), Spanish (Auto-translated), French (Auto-translated), Korean (Auto-translated), Portuguese (Auto-translated), Vietnamese (Auto-translated) #microservices #nest.js #docker #event-driven #backend #typescript #api #notifications #software engineering #coding
0:00 Okay, so we're ready to generate our final 0:01 microservice, which will be our 0:03 notification service, which we'll use to notify the users 0:07 after we have successfully charged their card and created their reservation. 0:11 So let's go ahead, and in the terminal, we'll go ahead and 0:15 use the Nest CLI to generate a new app, and we'll go ahead and 0:18 call this application notifications. 0:23 So we've gone ahead and created our new app here. 0:25 So we'll start off by creating a new Docker file, as we've 0:29 done before, in the root of the notification service. 0:33 And I'll go ahead and copy over the Docker file from the 0:36 payment service 0:37 and paste this in here, just swapping out the last line 0:41 where we go in, into the notifications folder to start 0:44 this service 0:45 up. 0:46 So after we've added our Docker file, we can go into our Docker 0:50 Compose, and we will go ahead and copy the 0:53 payments set up here and paste it once again, 0:57 and we're gonna swap this out for the notification 1:01 service. So we'll keep everything the same, 1:04 except we'll change the 1:05 path to the Docker file here. 1:07 And of course, we'll make sure we start the notification 1:10 service with the command 1:11 here. And for our env file, we will also look for the 1:15 notifications env. Now, I don't need to expose any ports here, 1:19 and we also don't need to expose ports on the payment service 1:23 either because this is only exposed over TCP. 1:26 So I'll get rid of this section here, but I will go ahead and create a 1:30 .env in the notifications 1:33 f- root directory as well here so that we can actually provide 1:37 environment variables to this service. 1:39 But this should be everything we need to actually start up our notification 1:42 service. So let's go back in our terminal
The rest of the transcript is for members.
Sign in