From the course: Nest.js Developer Lab 2026: Build a Robust API with Authentication, Articles, and User Profiles
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
Creating user entity - Nest.js Tutorial
From the course: Nest.js Developer Lab 2026: Build a Robust API with Authentication, Articles, and User Profiles
Creating user entity
In previous video, we prepared everything that we need to make our register request. Now, it's time to start working with user. Actually, we always must plan our application by entities. For example, we have an entity tag. In our case, it's even easier because we can always jump here inside our specification and check all entities that we must implement. In our case, for example, we have an entity user, later also profile, and so on. So now we want to create an entity user, and this means that we can operate with this entity. For example, we must create a table where we will store our users. Also, we can get user, of course, save user, this is registration, or maybe update current user. And in our case for this, we're doing exactly the same like we did inside tag. This is why I want here to open our tag entity on the right, and on the left inside user, I will create a new file user entity.ts. And this is where our user lives. And this is the entity by which TypeRM will create a table…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Creating migrations14m 2s
-
(Locked)
Preparing register request9m 44s
-
(Locked)
What is DTO?6m 48s
-
(Locked)
Creating user entity15m 55s
-
(Locked)
Generating JWT token16m 27s
-
(Locked)
Validation pipes8m 57s
-
(Locked)
Login request18m 35s
-
(Locked)
Auth middleware25m 9s
-
(Locked)
User decorator8m 34s
-
(Locked)
Auth guard7m 5s
-
(Locked)
Updating current user11m 9s
-
(Locked)
-
-
-
-