Backend overview

Presenting the current module's plan, highlighting crucial backend details for the frontend to illustrate the problem domain.

Project Source Code

Get the project source code below, and follow along with the lesson material.

Download Project Source Code

To set up the project on your local machine, please follow the directions provided in the README.md file. If you run into any issues with running the project source code, then feel free to reach out to the author in the course's Discord channel.

This lesson preview is part of the Next-Level Angular Apps with NX course and can be unlocked immediately with a \newline Pro subscription or a single-time purchase. Already have access to this course? Log in here.

This video is available to students only
Unlock This Course

Get unlimited access to Next-Level Angular Apps with NX, plus 70+ \newline books, guides and courses with the \newline Pro subscription.

Thumbnail for the \newline course Next-Level Angular Apps with NX
  • [00:00 - 00:33] I have prepared for you a backend application that we will use to migrate it to nxmonorepo and then we will write two front-end applications that we will use that backend application. In this lesson we will do a short overview what we have inside how to start this application and so on. The application is using an sjs as backend framework if you have never heard about it, no worries it's very similar to Angela so it will look familiar for you. Let's start with SRC folder so let's open it and similar to Angela we have main.ts file so let's open it.

    [00:34 - 01:37] As you can see we have putstrap function and similar to Angela we have app module so let's check what is inside app module. In the app module we have two imports, two rooms and meetings modules, app controller and two providers, app service and fake database latency service . So let's check what is inside app controller first. Controls are very simple so first of all you have that hello here it means that the endpoint will be exposed as hello and then I have one method called get so I will have get hello endpoint that will return a simple string. Let's go back to the app module and let's check what is inside rooms and meetings modules. So let's check room module first. As you can see we have a new module that imports fake database module. It has one controller, rooms controller and few providers. So let's start again with controllers.

    [01:38 - 03:06] It's a bit more complicated so we have endpoint called rooms. It has two methods get and post. We've got you can get the list of all rooms. Room is described by room dto which we'll check in a moment and the post one is used to create a new room. So let's check what is inside room dto. So our room will have ID, name and image. Let's go back to app module again and let check what is inside meetings module. So let's check meetings controller and as you can see again it's very simple we have two methods we have get and post again to get all the meetings for room so it's a query parameter room ID and post to create a new meeting and we have a meeting dto here it contains ID room ID name of the room house date from and date to. Let's go back to the meetings module and check what is inside providers. So we have two providers we have meeting dto converter service and meeting converters service. So meeting dto converter service is a very simple service that converts meeting to meeting dto and the second service does the same thing but you know in reverse direction so we are mapping meeting dto to meeting starting the app is very simple.

    [03:07 - 03:41] First of all we need to install all necessary dependencies so we are install and then yarn start. As you can see we have our endpoints exposed so we have our hello rooms that contains get and post meetings that contains get and post and basically that's it it's a very simple application with in-memory database so nothing really complicated and I want to encourage you to explore netjs because if you like angular I bet you will like netjs.