Introduction to NestJS
NestJS is a progressive Node.js framework designed for building efficient, reliable, and scalable server-side (backend) applications. It is built with TypeScript natively and combines elements of Object-Oriented Programming (OOP), Functional Programming (FP), and Functional Reactive Programming (FRP).
First Steps with NestJS
NestJS structures backend applications using a modular architecture inspired by enterprise-grade patterns. In this hands-on guide, you will learn how to install the CLI, bootstrap a new project, understand its internal layout, and build your own modules, controllers, and services.
TypeORM Configuration and Entities
In the previous guide, we built a users module using in-memory data storage. However, in a production environment, persistent storage within a relational database is required. TypeORM serves as the bridge between our TypeScript code in NestJS and the PostgreSQL database engine. This guide explains how to translate Entity-Relationship (ER) diagrams into decorated TypeScript entities and configure local database infrastructure using Docker Compose.
Dependency Injection and Providers
In the previous guides, we explored NestJS fundamentals, built controllers and services with in-memory storage, and modeled relational entities using TypeORM and PostgreSQL. However, for all these parts to function cohesively in an enterprise-grade backend, understanding how layers communicate is essential: Inversion of Control (IoC), Dependency Injection (DI), and Providers.
Repositories and Queries with TypeORM
Once our database entities have been modeled and providers configured in NestJS, the next essential step is interacting with persisted data. Rather than writing manual SQL statements across our services, NestJS and TypeORM implement the Repository Pattern—an object-oriented abstraction allowing you to query, insert, update, and delete records via safe, strongly typed methods.
Slides of the Week
Official presentation slides corresponding to Week 5: Introduction to NestJS, HTTP Request Lifecycle, Layered Architecture, Inversion of Control (IoC), Modules, and Persistence with TypeORM.