
Explore NestJS, a progressive node framework for building scalable server-side REST APIs. Learn controllers, services, interceptors, pipes, guards, authentication, authorization, testing, and aurum integration with cloud Postgres.
Explore how a rest api powers data access between a client and a server, using endpoints and verbs like get, post, put, and delete to manage home data.
Set up your local environment for Nest JS by installing node.js, using Visual Studio Code, verifying with node -v, and cloning the GitHub repo to start the first project.
Build the API for an expense app to track incomes and expenses, storing reports in a database and practicing NestJS fundamentals with CRUD endpoints for income and expense records.
Install the nest CLI globally to scaffold a boilerplate nest app, create a new project with nest new, and run in development to verify a hello world endpoint on localhost:3000.
Learn to implement a NestJS endpoint using a controller and get decorator that returns a hardcoded empty array of income reports. Understand that later this will connect to a database.
Update the NestJS route paths by applying a base path in the controller or a specific path on a method, such as /report/income, to return an array.
Explore how to implement dynamic path parameters in NestJS by creating routes like /reports/:type/:id, handling income and expense reports, and validating types to prevent invalid requests.
Implement post, put, and delete endpoints for income reports using decorators, creating, updating, and deleting reports at /reports/income and /report/income/{id}, tested with postman.
Learn to implement a local database for NestJS reports using TypeScript, define a typed data model with interfaces and an enum for income or expense, and ensure type safety.
Learn to use param decorators to extract a path parameter named type and route income or expense reports in Nest JS, then filter data accordingly.
Extracts two path parameters, type and id, then filters reports by type and finds a matching id to return the report object or nothing when there is a mismatch.
extract data from the request body in a NestJS post endpoint using a body decorator to create a new report with source, amount, and a type from the path.
Learn to implement update logic for a nest js put request by extracting type, id, and body, locating the target report, and updating its fields.
Complete the delete logic for reports in NestJS by locating the target with findIndex, removing it with splice, and returning a no content 204 status via http code decorator.
Address flaws by extracting business logic from controllers and implementing robust validation for IDs and request bodies to prevent invalid payloads and unintended updates.
Place business logic in services rather than controllers by creating an app service class. The controller calls service methods like get all reports, using an enum type, to separate concerns.
Learn to inject the app service into the controller using NestJS modules to manage dependencies, declare injectable services, and wire imports, providers, and controllers.
Refactor all business logic into the app service, add get reports by income or expense type and id, and create reports with a report data interface for reuse and testing.
Perform a manual test of api endpoints, verify get requests for reports and income, and practice create, update, and delete operations while diagnosing and applying a fix via app service.
Learn to validate incoming requests in NestJS by checking UUIDs, validating body fields like amount and source, and enforcing type values as income or expense.
Explore validating and transforming path parameters in NestJS with pipes, using parse int and uuid pipes to enforce numbers or UUIDs and trigger 400 errors on invalid input.
Demonstrate validating a type as income or expense with the enum validation pipe in NestJS, instantiate the pipe to prevent errors, and prepare body validation with a DTO.
Validate NestJS request bodies using DTOs with class-validator and class-transformer; create a create reports DTO with amount and source, ensuring positive numbers, and enable a global validation pipe.
Implement optional properties in a NestJS DTO by applying the isOptional decorator, validating positive numbers, and preventing extra fields during report updates.
Set the validation pipe to whitelist by default to remove any properties not defined in the DTO, ensuring clean request bodies and stronger security.
Explore transforming outgoing responses in NestJS by converting snake_case data to camelCase, selectively returning only chosen properties, and applying DTOs and interceptors for the outgoing response.
Create a report response dto with class-transformer decorators, using exclude and exposed to omit updated at, and wire it through controllers and services to return an array of report responses.
Learn to wrap and transform responses with a DTO by instantiating a reports response DTO, using partial types, and mapping results in the service and controller.
Learn how to enable object transformation in NestJS by configuring an interceptor, wiring app interceptor providers, and using a class to transform snake case to camel case.
Apply the expose decorator to rename and expose a property, supplying a name option and a transform that returns the value, while excluding the original field for camel case output.
Explore how an interceptor sits between client requests and server responses to modify data. Apply the built-in class serializer interceptor to all endpoints and try a custom one for learning.
Create a custom interceptor in NestJS by implementing the NestInterceptor interface. Intercept method uses execution context and map in a pipe to transform responses.
Create a new summary endpoint at /summary that calculates total expenses, total income, and net income, using a dedicated summary controller and service wired into the app module.
Move report logic into its own directory by creating a report module, controller, and service, refactoring code, updating imports, and testing endpoints for income and expense reports.
Inject the summary service from the reports module into the summary controller, expose a get summary endpoint, and compute income, expenses, and net income.
Implement the summary endpoint by using the report service to compute total expenses and total income with reduce, then derive net income as income minus expenses.
Build a realtor app backend with authentication, authorization, middleware, testing, interceptors, and api documentation; implement endpoints to list, view, create, update, delete homes and handle inquiries with role-based access.
Create a brand new nest project, install dependencies, and open the app in vscode, then clean up unnecessary files and begin implementing the first feature.
Learn how to move from a local in-memory store to a cloud Postgres database using Heroku, creating a production-ready Postgres instance and retrieving connection credentials.
Connect your cloud database to a Nest app using Prisma, the easy Node.js ORM today. Query and mutate data with Prisma without SQL, supporting Postgres, MySQL, SQL Server, SQLite, MongoDB.
Install prisma in a Nest project, initialize prisma, configure a Postgres data source with environment variables, and visualize the database with Prisma Studio, paving the way to create models.
Model homes, images, users, and messages with Prisma map to database tables, using an incrementing id and properties like address, city, price, bedrooms, bathrooms, and a residential or condo type.
Learn to finish database schemas in nest js bootcamp by modeling images, users with id and contact fields, timestamps, and user type, plus a simple message model and relationships.
Explore one-to-many relationships by linking images to a home using primary keys and foreign keys. Describe how a home belongs to a realtor and how to declare relations in Prisma.
Explore one-to-many and one-to-one relationships between homes, realtors (users), buyers, and messages, using foreign keys and related arrays in Nest JS.
Push your models to the connected database with prisma db push, then open prisma studio to explore models and their columns and interact with the real database.
Implement authentication in the nest js bootcamp by building sign-up, sign-in, and identity flows for buyers, realtors, and admins with codes.
Validate user data against a name, phone, email, and password schema and reject invalid input. Ensure the email is unique, hash the password, and store the user in the database.
Build a NestJS user module with an auth controller and sign up route, then validate sign up input using a DTO and class-validator with a global validation pipe.
Validate that the provided email is not already in use by querying the database via a Prisma service, returning a conflict exception if a user exists, and proceeding otherwise.
Learn why plain text passwords are unsafe and why hashing with salt rounds is preferred, since hashing is one-way and does not require a decryption key.
Hash passwords in the Nest JS bootcamp by installing bcrypt, importing it, and hashing with 10 salt rounds before saving the user to the database.
Store a new user in the database using Prisma, supplying email, name, phone, and a hashed password, with a default user type buyer, and return the created user.
Explore how to secure client–server requests with JSON web tokens, including header, payload, and signature, verify user identity, and store tokens for logged-in actions like sending messages.
Generate and return a json web token with jsonwebtoken, using a payload of user name and id, and sign it with a secret from environment variables, with expires in property.
Implements sign-in logic by validating email and password via a sign-in DTO, verifying the user with prisma, comparing passwords with bcrypt, and issuing a JSON web token.
Implement a product key endpoint in the NestJS bootcamp, routing sign-up by user type and generating a unique key tied to email and user type via a service.
Validate realtor and admin signups by enforcing a product key through an enum-typed user type, implemented in the controller and wired to a reusable signup service.
Create a Nest module, controller, and service for a home resource, exposing five endpoints: get all homes, get a home by id, create, update, and delete.
Design and implement a NestJS get homes endpoint with Prisma service to fetch all homes, map to a DTO, and present camel-case API output.
Define the response dto for the homes search by selecting id, address, city, price, bathrooms, bedrooms, and a single image URL using Prisma relationships.
Learn how to filter home listings using query parameters by city, min and max price, and property type, extracting values with a query decorator for precise database filtering.
Explore filtering specific homes using query params in a Prisma and NestJS setup, including city, price range, and property type, with error handling for no matches.
Implement get and post endpoints for home data, validate input with a create home dto, and use a home response dto and nested image validation to ensure clean, typed listings.
Develop and wire a NestJS create home service using Prisma to save a home and related images, validating input, handling realtor id, and returning the created home.
Update the home by id using an optional fields dto, fetch the target with find unique, throw not found if missing, update via the service, and note an images endpoint.
Delete the home by id using the delete endpoint, via the Prisma service, first removing related images to satisfy the foreign key constraint, then returning no content after deletion.
Identify the requesting user to replace hard-coded realtor ids, enabling realtor-only updates by using a custom decorator to extract the user id in the controller and pass it to the service.
Create a custom param decorator in NestJS using createParamDecorator from @nestjs/common, place it under decorators, export it, and return a user object with id and name for controller use.
Explore how to access the user object by extracting a JSON Web Token from the authorization header, decoding it, and attaching the user to the request through an interceptor.
Create a nest interceptor to extract a JWT from the authorization header, decode it, and attach the authenticated user to every request for downstream endpoints.
Wrap up by extracting the request inside a custom decorator using the execution context to return request.user, enabling downstream services to access the authenticated user's data.
Enforce that only the creator realtor can update or delete a home by verifying the home's realtor id with the user decorator and Prisma service.
Create a get /me endpoint in the auth controller to identify the current user by returning the user info through the user decorator.
As someone that utilizes NestJS on a daily basis at work and beyond, I'd love to share everything that I've learned in this course. This is the most comprehensive NestJS course on Udemy and if you don't think so, you can request a full refund.
NestJS is a progressive NodeJS framework that will allow us to build reliable scalable, and maintainable server-side backend applications with incredible ease.
In this course, you will be building two professional applications. The first will be an Expense App, where you will learn:
The fundamentals of NestJS
Different NestJS entities, like controllers, services, interceptors, pipes, and modules
NestJS best practices
In the second project, the Realtor App, we will learn about:
Interacting with a Postgress database with an ORM (Prisma)
Creating a database model and performing CRUD operations
How to authenticate and identify a user
How to authorize certain endpoints for specific users
How to properly write automated tests for our services and controllers
How to create custom param decorators
Learn about advanced NestJS entities like guards and interceptors
I am very proud of this course and I really hope you take and enjoy it. If you ever need any sort of help, please send me a message on Udemy and I will always answer your questions.