In this article, you'll learn how to build CRUD RESTful API with Node.js, ExpressJs, TypeORM, and PostgreSQL. We will define the database schema with TypeORM and run the migration command to push the TypeORM schema to the database. Next, we will create higher-level CRUD function to perform the CRUD operations.
- Node.js, TypeORM, PostgreSQL CRUD RESTful API Overview
- Project Structure
- Model Data with TypeORM and PostgreSQL
- Define a Base Entity
- Add One-to-Many Relationship to User Entity
- Complete User Entity
- Create a Post Entity
- Create Validation Schemas with Zod
- Create Services to Communicate with Database
- Create Route Controllers
- Create a New Post Controller
- Get a Single Post Controller
- Get All Posts Controller
- Update a Single Post Controller
- Delete a Single Post Controller
- Create Routes with Express
- Add the Routes to the Express Middleware Pipeline
- Run Database Migration with TypeORM
Read the entire article here: https://codevoweb.com/node-express-typeorm-postgresql-rest-api
Articles in this series:
API with Node.js + PostgreSQL + TypeORM: Project Setup
API with Node.js + PostgreSQL + TypeORM: JWT Authentication
API with Node.js + PostgreSQL + TypeORM: Send Emails
