This project was generated using NestJs.
This is a simple NestJs app that create a CRUD for the users entity and resolve the following problem:
- Create an endpoint to create new user (check if the user exist)
- Create an endpoint to provide full user info by id (check if the user exist)
- Create an endpoint to get users with queries parameter:
pageIndex
,pageSize
,search
,sort
The User entity has this fields: id, name, middleName, surname, birthPlace, birthDate. The middleName is optional and the format of the birthDate is ISO 8601.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
You need to install these packages:
For install all deps you need to perform this command:
yarn
or
npm install
This NestJs uses some environments variables. To let you coding without set them on your local machine you can simple copy the file .env.example
into .env
.
This porject use Jest as testing tools. To run all test use this command:
yarn test
or
npm run test
If you would like to run test while you are coding you can use the command:
yarn test:watch
or
npm run test:watch
Before to run this NestJs app you need a postgres db. You can have an instance of postgres db with docker and running this command:
docker compose up
NB: the first time it may take a while, please, patient.
You can run this project in development mode with these command:
yarn start:dev
or
npm run start:dev
If you do not need run this is in development mode you can simply run:
yarn start
or
npm run start
After the start up, you can find Swagger doc of the backend at http://localhost:3000/docs.
- @donny88 - Initial work