Scalable Application Development with NestJS - Pacifique Linjanja - E-Book

Scalable Application Development with NestJS E-Book

Pacifique Linjanja

0,0
28,99 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

In this book, Pacifique Linjanja, a globally recognized software engineer and open-source contributor, shares his deep technical expertise and practical insights from his extensive experience delivering enterprise-level applications to unpack the full potential of NestJS, the cutting-edge Node.js framework.
This book covers the core concepts, design patterns, and best practices for building scalable, high-performance applications with NestJS. You’ll learn REST API and GraphQL implementations, harness the power of microservices, and explore real-world case studies, including e-commerce, social networking, and ERP systems. The chapters provide step-by-step guidance for setting up your development environment with TypeScript and npm, structuring projects effectively, and using the Apollo Federation architecture to create efficient GraphQL APIs. This book offers hands-on guidance for testing and debugging APIs, handling exceptions, and validating data using pipes and guards, all while helping you build a complete NestJS application from scratch.
By the end, you'll be ready to apply DevOps principles for continuous integration and deployment, as well as secure your NestJS applications using advanced techniques.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 697

Veröffentlichungsjahr: 2025

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Scalable Application Development with NestJS

Leverage REST, GraphQL, microservices, testing, and deployment for seamless growth

Pacifique Linjanja

Scalable Application Development with NestJS

Copyright © 2025 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

The author acknowledges the use of cutting-edge AI, such as ChatGPT, with the sole aim of enhancing the language and clarity within the book, thereby ensuring a smooth reading experience for readers. It’s important to note that the content itself has been crafted by the author and edited by a professional publishing team.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

Group Product Manager: Kaustubh Manglurkar

Publishing Product Manager: Chayan Majumdar

Book Project Manager: Srinidhi Ram

Senior Content Development Editor: Feza Shaikh

Technical Editor: Simran Ali

Copy Editor: Safis Editing

Indexer: Tejal Soni

Production Designer: Ponraj Dhandapani

DevRel Marketing Coordinator: Nivedita Pandey

First published: January 2025

Production reference: 1051224

Published by Packt Publishing Ltd.

Grosvenor House

11 St Paul’s Square

Birmingham

B3 1RB, UK.

ISBN 978-1-83546-860-9

www.packtpub.com

To my parents, my sisters, and my brothers for their love and support.

– Pacifique Linjanja

Contributors

About the author

Pacifique Linjanja is a skilled software engineer known for building enterprise-level applications with technologies such as NestJS. He has led diverse development teams globally, delivering scalable, efficient software solutions across multiple projects. In addition to his work, Pacifique actively contributes to open source communities, sharing his expertise and insights through technical talks and coding workshops. He enjoys mentoring new developers and continues to broaden his knowledge by exploring various fields beyond technology, believing in the importance of learning and giving back to the tech community.

I want to thank the people who have been close to me and supported me, especially my brother Ansima and my parents.

About the reviewer

Piyush Kacha is the co-founder of Anwit, where technology becomes a canvas for creativity and innovation is the brush. He graduated with a Bachelor of Engineering from Gujarat Technological University in 2019. While still in college, he joined Kevit Technologies in 2018 as a backend engineer and advanced to team lead over four years. In 2022, driven by an entrepreneurial spirit, he co-founded Anwit to craft IT solutions that not only work but also bring joy. A lifelong learner, he is currently exploring Gleam, a functional programming language designed to eliminate runtime errors. Piyush is passionate about transforming challenges into opportunities, continually pushing the boundaries of innovation in the tech world.

I owe my deepest gratitude to my family and colleagues for their unwavering support and belief in my vision. Your encouragement has been the cornerstone of my journey, inspiring me to overcome challenges and strive for excellence. A heartfelt thank you to the incredible teams at Kevit Technologies and Anwit for fostering an environment where innovation thrives. This accomplishment would not have been possible without all of you.

Table of Contents

Preface

Part 1: Introduction to NestJS and Scalable Application Architecture

1

Overview of NestJS

Technical requirements

Introduction to NestJS

Historical context

Problem statement – the need for NestJS

NestJS versus other frameworks – a comparative analysis

Key advantages of using NestJS

The power of TypeScript

Why TypeScript?

The value proposition – what does TypeScript offer?

Code snippet – TypeScript in action

TypeScript and NestJS – a perfect synergy

Code snippet – NestJS with TypeScript

Key features of NestJS

Modularity

Dependency injection

Decorators

Guards

Exception filters

Pipes

Interceptors

The ecosystem of NestJS

Third-party modules

Nest CLI

Community support

Why choose NestJS?

Summary

2

Understanding Scalable Application Architecture Principles and Design Patterns

Technical requirements

Principles of Scalable Application Architecture

Your app as a growing city

The three Ss of scalability

The importance of modular design – a double-edged sword

Statelessness – the cornerstone of horizontal scaling

Database scalability – sharding, replication, and partitioning

The social network of microservices – event-driven architecture

Load balancing and horizontal scaling

Caching strategies for performance optimization

Types of caching – knowing your tools

The ABCs of caching strategies

Caching in the NestJS universe

Design patterns for building scalable NestJS applications

Why design patterns matter

The singleton pattern for managing global state

The factory pattern for object creation

Dependency injection for loose coupling

The decorator pattern for extending functionality in NestJS

Why decorators make NestJS outstanding

Understanding asynchronous programming for scalability

What is asynchronous programming?

Why asynchrony is important for scalability

Improved user experience

Asynchronous programming in NestJS

Event loop and non-blocking I/O

Best practices for building scalable applications

Code organization is key

Optimizing data storage and retrieval

Embracing microservices for decoupling

Automating testing and deployment

Making use of middleware and interceptors

Don’t neglect security

Leveraging load balancing

Using application metrics for insights

Summary

3

Setting Up Your NestJS Environment and Exploring NestJS – Building a Robust App

Technical requirements

Installing Node.js and NestJS

Step 1 – Install Node.js

Step 2 – Install the NestJS CLI

Scaffolding a new NestJS project

Creating a new NestJS project

The birth of a NestJS project

Understanding the NestJS project structure

Why is NestJS’s project structure important?

The src/ directory

The dist/ directory

The node_modules/ directory

The test/ directory

Configuration files – tsconfig.json and nest-cli.json

Creating and managing modules

What are modules in NestJS?

The role of the root module

Creating a new module

Managing modules

Building controllers for handling requests

What is a controller in NestJS?

Crafting your first controller

Handling requests with decorators

Dynamic routes and parameters

Implementing providers for business logic

What is a provider in NestJS?

Crafting your first provider

Dependency injection – the magic behind providers

Custom providers – beyond classes

Handling exceptions with exception filters

What are exception filters?

Crafting a basic exception filter

Validating data with pipes and guards

Pipes – transforming and validating

Guards – protecting routes

Summary

4

Advanced Concepts – Modules, Controllers, Providers, Exception Filters, Pipes, Guards, and Decorators

Technical requirements

Diving deeper into modules

The essence of modular thinking

Why it’s more than just organization

The fundamental role of modules in NestJS

Creating and initializing a module

The application module graph

Sharing modules across the application

Modular organization for large-scale applications

NestJS controller essentials and advanced practices

Creating your first controller

Basic routing in controllers

Parameterized routes

Scaling your controllers

Refined request handling

Advanced Data Transfer Objects and validation pipelines

Response transformation – interceptors in action

Middleware – the uncelebrated controller companions

Deep dive into route guards

Streaming data with NestJS controllers

Advanced WebSocket patterns

Understanding providers in depth

Brief recap – providers and modules

What constitutes a provider in NestJS?

Injecting providers into modules, controllers, and other providers

Custom providers

Asynchronous providers

Exporting providers from modules

Enhancers as a special kind of provider

Advanced techniques and best practices

Understanding request lifecycle

Summary

Part 2: REST APIs and GraphQL in NestJS

5

Building and Optimizing REST APIs with NestJS

Technical requirements

Introduction to REST APIs in NestJS

Building a basic REST API

Setting up your REST API project

Designing your first RESTful endpoint

Integrating advanced concepts into your API

Reflecting on REST API best practices

Versioning your API

Context for v2

Introduction to API versioning concepts

Setting up the version 2 infrastructure

Robust error handling in REST APIs

Understanding error handling

Key aspects of robust error handling

Implementing error handling in the user management API

Best practices for client-friendly errors

Documenting your API

The importance of API documentation

Key components of effective API documentation

Implementing documentation in the user management API

Adding Swagger annotations to DTOs and entities

Setting up Swagger in the controller

Generating Swagger documentation

Keeping documentation up to date

Example – complete user management API Swagger documentation

Best practices for maintaining API documentation

Summary

6

Unleashing the Power of GraphQL and the Apollo Federation Architecture in NestJS

Technical requirements

Understanding GraphQL fundamentals in NestJS

What is GraphQL?

GraphQL and NestJS – a perfect match

Advantages of using GraphQL with NestJS

Big companies using GraphQL in production

Building and optimizing a GraphQL API with NestJS

Contextualizing our application

Two approaches to GraphQL with NestJS

Code-first approach

Schema-first approach

Learning about GraphQL subscriptions

Implementing and testing subscriptions in NestJS

Securing GraphQL – authentication and authorization

Understanding the differences

Authentication in GraphQL

Authorization in GraphQL

Introduction to Apollo Federation

Federation in microservices architecture

What is Apollo Federation?

Summary

Part 3: Testing and Debugging APIs in NestJS

7

Testing and Debugging REST APIs in NestJS

Technical requirements

Understanding the importance of testing

The painful cost of skipping tests

The powers of testing in NestJS

Unit testing in NestJS

Identifying units in the existing application

Writing unit tests for the users’ service

Test coverage

Integration testing in NestJS

Preparation for integration testing

Overview of the user management application

Preparing the test environment

Simulating HTTP requests and asserting responses

Testing controller files

Testing guards, interceptors, and middleware

Testing MockAuthguard

Testing the response interceptor

Testing middleware

Debugging REST APIs

Understanding the issue

Leveraging debugging tools

Enhancing debugging with environment variables

Leveraging NestJS DevTools for a streamlined development experience

Real-world debugging scenario revisited

Common pitfalls and how to address them

Debugging in action – a step-by-step example

Summary

8

Testing and Debugging GraphQL APIs in NestJS

Technical requirements

Unit testing for GraphQL resolvers

Setting up for testing

Writing unit tests for resolvers

Mocking dependencies

Testing resolver logic

E2E testing in GraphQL

Debugging GraphQL APIs

Understanding debugging challenges for GraphQL APIs

Leveraging debugging with built-in NestJS tools

Using exception filters for enhanced error handling

Apollo Server debugging tools

Best practices for debugging GraphQL APIs in production

Summary

Part 4: Scaling with Microservices and NestJS

9

Deep Dive into Microservices: Concepts and Architectural Styles

Technical requirements

Understanding microservices

What are microservices?

Benefits of microservices architecture

Microservices architectural styles

Key microservices architectural styles

EDA

Database per service

API Gateway

Command-Query Responsibility Segregation (CQRS)

Saga pattern

API composition

Best practices and considerations

Summary

10

Building Scalable Microservices with NestJS

Technical requirements

Defining and implementing microservices in NestJS

Setting up a new project

Setting up a new microservice project

Overview of the microservices package in NestJS

Introduction to @nestjs/microservices

Key features and advantages

Implementing a simple communication example

Inter-service communication and data integrity in NestJS

Key features of the application

The order service

API gateway, our gatekeeper

Service discovery with Consul in NestJS

Best practices for building microservices with NestJS

Structure and modularization

Configuration management

Inter-service communication

Resilience and error handling

Data management

Logging and monitoring

Testing and CI/CD

API Gateway and security

Troubleshooting and debugging microservices

Centralized logging

Tracing and monitoring

Service health and resilience

Debugging techniques

Version control and rollback

Dependency management

Service isolation and testing

Documentation and knowledge sharing

Summary

11

Testing and Debugging Microservices in NestJS

Technical requirements

Unit testing for microservices

Testing createOrder in the order service

Integration testing for microservices

Integration testing for order creation and inventory update

Emitting events and testing inventory processing

Debugging common issues and solutions in microservices testing

Issue 1 – microservices failing to connect

Issue 2 – unreliable event emission between microservices

Issue 3 – inconsistent data between microservices

Issue 4 – slow performance in inter-service communication

Best practices for testing and debugging microservices

Isolating microservices for unit testing

Using environment variables for configurations

Leveraging integration testing for cross-service communication

Enabling retry mechanisms for robustness

Using NestJS DevTools for real-time debugging

Monitoring and tracing distributed systems

Using sagas for distributed transactions

Summary

Part 5: Real-World Application Examples and Case Studies

12

Case Study 1 - E-commerce Application

Technical requirements

Understanding the requirements of an e-commerce application

Identifying user needs

Defining functional requirements

Setting performance requirements

Designing the application architecture and data modeling

Steps to design a REST API

Creating resource URIs

Representing resources

Assigning HTTP methods

Writing APIs

Implementing REST APIs for products and orders

Setting up the development environment

Database setup and configuration

Implementing the product API endpoints

Implementing the Order API endpoints

Common logic and interceptors

User authentication and authorization in an e-commerce context

Setting up the User module

Creating the User entity

Implementing the service file

Route handlers and the controller file

Authentication module

Authentication controllers

Authentication guard

Summary

13

Case Study 2 – Social Networking Platform

Technical requirements

Understanding the requirements of a social networking platform

Users’ needs

Functional requirements

Non-functional requirements

Designing the application structure for social networking

Object model

Relationships between objects

Database schema design

API design

Implementing GraphQL APIs for users, posts, and interactions

Setting up the project

Creating the Users module

Creating the Posts module

Creating the Interaction module

Creating the Reactions module

User relationships and social features

Adding social features

Implementing these features

Posting real-time updates and notifications in a social networking context

Customizing notifications based on user preferences

Summary

14

Case Study 3 – Enterprise Resource Planning System

Technical requirements

Understanding the requirements of an ERP system

Functional requirements

Non-functional requirements

Designing the system architecture for an ERP system

High-level architecture overview

Microservices architecture design

Database design and data management

API gateway and communication patterns

Implementing microservices for scalability and modularity

Creating individual microservices

Setting up communication between microservices

Ensuring scalability and modularity

Example code for a complete microservice

Complete guide to Dockerizing microservices

Deploying microservices to Kubernetes

Implementing security best practices

Data synchronization and consistency in an ERP context

Understanding data consistency models

Data synchronization strategies

Implementing data synchronization in an ERP system

Handling complex business processes and workflows

Understanding business processes and workflows

Modeling business processes

Orchestrating business processes

Automating business processes

Error handling in workflows

Integrating with external systems

Monitoring and managing workflows

Summary

Part 6: Deployment, DevOps, and Beyond

15

Deploying NestJS Applications

Technical requirements

Configuring a local server for production-like testing

Preparing your NestJS application for deployment

Setting up a local server (NGINX, Apache, etc.)

Configuring SSL for HTTPS

Basic monitoring and logging

Deployment using Docker

Creating a Dockerfile for your NestJS application

Building and running your Docker container

Optimizing your Docker image for production

Deployment on Cloud platforms

Deploying to AWS Elastic Beanstalk

Deploying to Google Cloud Run

Deploying to Azure App Service

Post-deployment best practices

Monitoring and logging

Security and updates

Backup and disaster recovery

Scaling and load balancing

Summary

Further reading

16

Embracing DevOps: Continuous Integration and Continuous Deployment for NestJS

Understanding continuous integration and continuous deployment

Continuous integration

Continuous deployment

Why is CI/CD important for your NestJS application?

Choosing your CI/CD tools

Criteria to consider when selecting CI/CD tools

Popular CI/CD tools

Setting up a CI/CD pipeline for NestJS

Writing CI/CD actions in GitHub

Deploying to staging

CI/CD best practices

Summary

17

NestJS Performance Optimization

Technical requirements

Understanding performance optimization

Code optimization techniques

Efficient data handling

Reduce middleware and route complexity

Optimizing dependency management

Memory management

Database optimization techniques

Optimizing database queries

Caching strategies for NestJS

In-memory caching with cache-manager

Distributed caching with Redis

HTTP caching with @CacheKey and @CacheTTL

Cache busting

Profiling and load testing

Profiling a NestJS application

Load testing a NestJS application

Best practices for performance optimization

Monitor and benchmark regularly

Optimize resource allocation

Leverage asynchronous programming and non-blocking I/O

Minimize payload sizes

Implement efficient logging

Summary

18

NestJS Security Best Practices

Technical requirements

Understanding application security

The importance of application security

Common security challenges

Risks of unsecured applications

Defense-in-depth – a layered approach to security

Data security in NestJS

Securing data in transit

Securing data at rest

Access control

Authentication and authorization in NestJS

A quick review – authentication

Strengthening authorization mechanisms

Best practices for authentication and authorization

Preventing common security threats

Overview of common security threats

XSS prevention

SQL injection mitigation

CSRF prevention

Defending against DoS and DDoS attacks

Protecting against MitM attacks

Security best practices in NestJS

Secure development practices

Secure configuration management

Access control and least privilege

Secure data handling

Regular security audits and penetration testing

Incident response planning

Summary

Appendix

Concluding Remarks and Next Steps

Key takeaways from the book

Mastering the NestJS core concepts

Building robust APIs with NestJS

Implementing security best practices

Embracing testing and validation

Scaling applications for the real world

Exploring the NestJS ecosystem further

Diving into official modules and libraries

Integrating with third-party tools

Contributing to the NestJS community

Keeping up with NestJS updates and best practices

Following the official NestJS repository

Participating in NestJS conferences and meetups

Continuous learning and experimentation

Other useful resources

Books and online courses

Blogs and tutorials

Official and community forums

Real-world success stories with NestJS

Avoiding common pitfalls

Final words

Embrace lifelong learning

Stay connected with the community

Your journey ahead

Index

Other Books You May Enjoy

Preface

NestJS is a powerful framework for building efficient, scalable, and maintainable server-side applications. With its modular architecture and native TypeScript support, NestJS allows developers to streamline the process of building REST APIs, GraphQL APIs, and microservices. This book, Scalable Application Development with NestJS, is a complete guide to using NestJS to develop robust applications that can grow with your business needs. Through practical examples, you’ll learn how to integrate testing strategies, deploy seamlessly with CI/CD pipelines, and scale effortlessly in production environments.

Who this book is for

If you are a software engineer, developer, or tech lead aiming to gain a deeper understanding of how to build scalable applications using NestJS, REST, GraphQL, and microservices, this book is for you. Whether you’re new to NestJS or a seasoned developer, this guide provides a comprehensive approach to leverage NestJS for your next big project. It’s also ideal for project managers and other IT professionals seeking insights into enterprise-level efficient development, testing strategies, and deployment processes. Even technology enthusiasts will find this book enlightening.

What this book covers

Chapter 1, Overview of NestJS, is an introduction to what NestJS NestJS is and what it is capable of.

Chapter 2, Understanding Scalable Application Architecture Principles and Design Patterns, dives into the principles of scalable application architecture and the essential design patterns and best practices used for building scalable applications in NestJS. This chapter covers the fundamental concepts of scalability, such as load balancing, caching, and horizontal scaling.

Chapter 3, Setting Up Your NestJS Environment and Exploring NestJS – Building a Robust App, is a comprehensive guide to setting up the development environment for NestJS and exploring the framework by building a robust application. It covers the installation of NestJS and NestJS, along with the configuration of essential tools such as npm and TypeScript.

Chapter 4, Advanced Concepts – Modules, Controllers, Providers, Exception Filters, Pipes, Guards, and Decorators, delves deeper into NestJS and its advanced features. You will discover modules, controllers, providers, exception filters, pipes, guards, and decorators – all crucial components for building scalable and efficient NestJS applications.

Chapter 5, Building and Optimizing REST APIs with NestJS, covers the process of building and optimizing REST APIs using NestJS. You will gain an understanding of best practices when designing REST APIs, including versioning, pagination, and error handling.

Chapter 6, Unleashing the Power of GraphQL and the Apollo Federation Architecture in NestJS, explores the powerful world of GraphQL and explains how to build efficient GraphQL APIs using NestJS. This chapter will also cover the Apollo Federation architecture, enabling the creation of scalable and modular GraphQL APIs in a microservices-friendly environment.

Chapter 7, Testing and Debugging REST APIs in NestJS, covers various strategies, techniques, and tools for testing and debugging REST APIs developed in NestJS, providing them with the skills necessary to ensure the robustness of their APIs.

Chapter 8, Testing and Debugging GraphQL APIs in NestJS, covers testing and debugging strategies for GraphQL APIs in NestJS. It covers unit testing, end-to-end (E2E) testing, and common debugging techniques for GraphQL.

Chapter 9, Deep Dive into Microservices: Concepts and Architectural Styles, dives into microservices, introducing key concepts and architectural styles. You will learn about the benefits and challenges of microservices and gain an understanding of key architectural styles such as event-driven, database per service, and API gateway.

Chapter 10, Building Scalable Microservices with NestJS, shows how to use NestJS to build scalable microservices. You will learn how to define and implement microservices, how to communicate between microservices, and how to use the NestJS Microservices package.

Chapter 11, Testing and Debugging Microservices in NestJS, provides insights into testing and debugging microservices built with NestJS. You will learn how to write unit and integration tests for microservices, how to debug microservices, and how to handle common issues in a microservices environment.

Chapter 12, Case Study 1: E-commerce Application, explores a case study of building an e-commerce application using NestJS. It covers architectural considerations, data modeling, implementing REST APIs, handling user authentication, and integrating payment gateways.

Chapter 13, Case Study 2 - Social Networking Platform, presents a case study of building a social networking platform using NestJS. It covers designing the application structure, implementing GraphQL APIs, managing user relationships, integrating real-time features, and handling user-generated content.

Chapter 14, Case Study 3 - Enterprise Resource Planning System, provides a case study of building an Enterprise Resource Planning (ERP) system using NestJS. It covers designing the system architecture, implementing microservices, managing data synchronization, and handling complex business processes.

Chapter 15, Deploying NestJS Applications, explains how to deploy NestJS applications to various environments, including local servers, Docker, and cloud platforms such as AWS, Google Cloud, and Render.

Chapter 16, Embracing DevOps: Continuous Integration and Continuous Deployment for NestJS, discusses Continuous Integration and Continuous Deployment (CI/CD) in the context of NestJS. You will learn about various CI/CD tools, and how to implement a CI/CD pipeline for a NestJS application.

Chapter 17, NestJS Performance Optimization, delves into performance optimization for NestJS applications, discussing techniques for improving speed, efficiency, and reliability.

Chapter 18, NestJS Security Best Practices, deals with security best practices for NestJS applications. It discusses strategies for ensuring data security, handling authentication and authorization, and preventing common security threats.

Appendix, Concluding Remarks and Next Steps, offers a summary of key concepts learned throughout the book and suggests the next steps if you want to continue your journey with NestJS.

To get the most out of this book

Chapter 3 explains how to install all the required software and packages. You will need to have NestJS installed on your computer – any version above 16.0.0 – to get started. All code examples have been tested using NestJS 10 on macOS. However, they should work on any operating system where NestJS 10 and future version releases are installed.

Software/hardware covered in the book

Operating system requirements

NestJS 10

Windows, macOS, or Linux

TypeScript 4.0 and above

Client Application (Postman or a Web browser)

If you are using the digital version of this book, we advise you to type the code yourself or access the code from the book’s GitHub repository (a link is available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.

Download the example code files

You can download the example code files for this book from GitHub at https://github.com/PacktPublishing/Scalable-Application-Development-with-NestJS. If there’s an update to the code, it will be updated in the GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Conventions used

There are a number of text conventions used throughout this book.

Code in text: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “Inside your src/ directory, create a new sub-directory named users.”

A block of code is set as follows:

// ... existing imports import { UsersModule } from './users/user.module'; // ... existing code imports: [UsersModule], // Add this line // ... the rest of the code

Any command-line input or output is written as follows:

$ nest new user-management-graphql

Bold: Indicates a new term, an important word, or words that you see onscreen. For instance, words in menus or dialog boxes appear in bold. Here is an example: “Create a new environment, choose Web Server Environment, and select Docker as the platform“

Tips or important notes

Appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, email us at [email protected] and mention the book title in the subject of your message.

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata and fill in the form.

Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Share Your Thoughts

Once you’ve read Scalable Application Development with NestJS, we’d love to hear your thoughts! Please click here to go straight to the Amazon review page for this book and share your feedback.

Your review is important to us and the tech community and will help us make sure we’re delivering excellent quality content.

Download a free PDF copy of this book

Thanks for purchasing this book!

Do you like to read on the go but are unable to carry your print books everywhere?

Is your eBook purchase not compatible with the device of your choice?

Don’t worry, now with every Packt book you get a DRM-free PDF version of that book at no cost.

Read anywhere, any place, on any device. Search, copy, and paste code from your favorite technical books directly into your application.

The perks don’t stop there, you can get exclusive access to discounts, newsletters, and great free content in your inbox daily

Follow these simple steps to get the benefits:

Scan the QR code or visit the link below

https://packt.link/free-ebook/978-1-83546-860-9

Submit your proof of purchaseThat’s it! We’ll send your free PDF and other benefits to your email directly

Part 1: Introduction to NestJS and Scalable Application Architecture

This part introduces you to the NestJS world and helps you understand the spirit behind the framework, its architecture, and the design pattern used internally.

This part includes the following chapters:

Chapter 1, Overview of NestJSChapter 2, Understanding Scalable Application Architecture Principles and Design PatternsChapter 3, Setting Up Your NestJS Environment and Exploring NestJS – Building a Robust AppChapter 4, Advanced Concepts – Modules, Controllers, Providers, Exception Filters, Pipes, Guards, and Decorators