HealthServiceAPI consists in a REST API based on Oli Saúde backend test. The main functionalities are creating, retrieving, updating and deleting clients of a health service.
This project was developed as a study of APIs and backend, also aiming to establish a clean architecture.
- NestJS
- Typescript
- MongoDB
- Prisma (ORM)
- Jest
- Swagger
- Clone the project repository
$ git clone https://github.com/daviembrito/health-service-api.git
$ cd health-service-api- Download the project dependencies
$ npm install- Set up a environment variable (or .env file) with name DATABASE_URL containing the MongoDB database URL
- Start the server
$ npm run startYou can run the tests with the following command
$ npm run testAll the endpoints and requests examples made with Swagger are available at localhost:3000/api
- GET /client: returns all registered clients
Example:
- GET /client/{id}: returns all atributes of the client with the provided id
Example:
- GET /client/top-health-risk: returns the top 10 clients with highest health risk score and ordered
Example:
- POST /client: creates a new client record on the database based on the properties specified in the body
Example:
- PATCH /client/{id}: updates the client properties based on what the body contains. Only the properties specified are updated.
Example:
- DELETE /client/{id}: deletes the client record on the database
Example:





