Sample REST API service to coordinate vaccination records.
REST API with CRUD functionality using NestJS
, CQRS
and typeORM
.
The core technology stack in this project is based on NestJS framework.
node
: version 18.9.1npm
: version 8.19.1nestjs
: version 9.0.0
pg
: PostgreSQL client for node.js.@nestjs/typeorm
: Object Relational Mapper (ORM) available for TypeScript.
For the complete list of dependencies refer to Package.json
file.
In this section, you will see the tools required and steps to setup development environment for this project.
Download the Installer: https://nodejs.org/en/download/
- Verify the Node.js installation using terminal window and enter the following command:
node --version
- Clone the project repository
git clone git@github.com:eromerodev/vaccination-api.git
- Go into the project folder
cd vaccination-api
- Install project dependencies
npm i
- Inside this project go to the
docker/postgres
folder - Then run the following command:
# make sure you are inside docker/postgres folder
$ docker-compose up --build
- After the container is up and running you can visit http://localhost:5050 to login to pgAdmin.
user
: pg@admin.compass
: admin
NOTE: the docker-compose automatically will create the database schema using the the db.sql file
If the database is running you can start the project with the following command:
# development
$ npm run start:dev
Unit testing is testing the smallest testable unit of an application.
# unit tests
$ npm run test
In this example we are gonna testing the signup use-case
, where a user is created successfully in the database.
The API is documented using the Swagger OpenAPI Specification.
Also you can download an insomnia collection to import it into your local environment.
MIT