Let’s create a CRUD rest API in JavaScript, using:
- Node.js
- Express
- Sequelize
- Postgres
- Docker
- Docker Compose
If you prefer a video version:
Here is a schema of the architecture of the application we are going to create:
We will create 5 endpoints for basic CRUD operations:
- Create
- Read all
- Read one
- Update
- Delete
We will create a Node.js application using:
- Express as a framework
- Sequelize as an ORM
-
We will Dockerize the Node.js application
-
We will have a Postgres istance, we will test it with Tableplus
-
We will create a docker compose file to run both the services
-
We will test the APIs with Postman
Here is a step-by step guide.
create a new folder
mkdir node-crud-api
step into it
cd node-crud-api
initialize a new npm project
npm init -y
