Member-only story

Creating a REST API with NestJS — Part 03 — Services, PostgreSQL and TypeORM

Marcos Henrique da Silva
10 min readJan 18, 2021

In this article series, we continue developing our REST API using NestJS as a framework of choice, now implementing our user service, adding real data for our application and storing it in a local PostgreSQL database.

Before we start…

This is the part 03 of a few articles that I am using to create a REST API based with NestJS. If it is your first time here, please check my first article in this link:

What we are going to do?

We are continuing to develop the article from the first episode. If you want to code together, please use my branch from the end of the second article, here.

We already have a scaffold, with the CRUD endpoints set, validating user entries but not dealing with actual data there. What we are going to focus in this article is to implement these CRUD operations and store it in a PostgreSQL with the help of typeORM

Configuring a local PostgreSQL

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Responses (1)

Write a response

Hi Marcos.
Thank you for this beautiful walkthrough.
I have a question : please can I pass 2 entities to InjectRepository decorator or can I pass 2 different InjectRepository decorator in the same service as I want the same service to handle child and parent entity crud.
Thanks in advance.