Skip to content

Mongoose Express API. My proudest project so far. Made with unit tests and a ton of abstraction.

Notifications You must be signed in to change notification settings

Pedroscsilva/Mongoose-API

Repository files navigation

Mongoose Typescript CRUD API

This is an Express CRUD API built with Mongoose and incorporates a significant amount of abstraction. One of the aspects that brings me the most satisfaction is the project's highly scalable nature, achieved through the abstraction implemented in all layers.

In addition to the implementation, I have developed comprehensive unit tests using Chai, Jest, and Sinon specifically for the service layer of the API. These tests ensure the reliability and correctness of the functionality.

To enhance the project's deployment and ease of use, I have also utilized Docker. This allows for seamless setup and configuration to achieve the desired functionality and performance.

I am thrilled with the outcomes of this project and the valuable skills I have acquired throughout its development.

Installation

Install this project using docker

  docker-compose up -d

⚠️ This API defaults to your localhost:3001, but you can change it if you are already using this port by editing the docker-compose file.

API Reference

⚠️ The API reference uses the cars routes as an example, but cars and motorcycles work interchangeably.

Get all cars

  GET /cars

Get a specific car

  GET /cars/${id}
Parameter Type Description
id string Required. Id of car to fetch

Create a new car

  POST /cars

Your request body should look like this for cars:

{
  "model": "Marea",
  "year": 2002,
  "color": "Black",
  "status": true,
  "buyValue": 15.990,
  "doorsQty": 4,
  "seatsQty": 5
}

Update an existing car

  PUT /cars/:id
Parameter Type Description
id string Required. Id of car to update

The body of this PUT should look like the POST body.

Contact

If you would like any help executing it or if you have any suggestion on how to improve this code, please reach me out!

[email protected]

+55 24 99243-3741

About

Mongoose Express API. My proudest project so far. Made with unit tests and a ton of abstraction.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published