Skip to content

API that manages a vehicle concessionaire πŸš—

Notifications You must be signed in to change notification settings

ImVictorM/Auto-Shop

Repository files navigation

Auto Shop 🏎️

Project Context πŸ’‘

API that manages a vehicle concessionaire using the four basic CRUD operations. I designed the project architecture with a layered approach based on Domain-Driven Design (DDD), incorporating Object-Oriented Programming (OOP) and SOLID principles. To ensure correctness, I developed unit and integration tests to cover almost 99% of the project's functionalities.

Acquired Knowledge πŸ“–

In this project, I was able to:

  • Create an API CRUD using OOP and SOLID principles;
  • Use MongoDB;
  • Use Mongoose ODM;
  • Create unit tests;
  • Create Integration tests.

Main Technologies 🧰

Development

TypeScript Express Mongoose Node.JS MongoDB Docker Insomnia
typescript express mongoose nodejs mongodb docker insomnia

Test

Mocha Chai Sinon
mocha-js chai-js sinon-js

Running the application βš™οΈ

  1. Clone the repository and enter it
git clone [email protected]:ImVictorM/Auto-Shop.git && cd Auto-Shop

Methods

πŸ‹ Running with docker (recommended)

You must have docker and docker-compose installed

  1. Get the containers running
docker-compose up -d

πŸ–₯️ Running locally

You must have node on version 16 and MongoDB installed

  1. Install the dependencies
npm install
  1. Rename the file .env.example to .env

  2. Start the server

npm run dev

Testing πŸ› οΈ

Note: if you're running the app using docker, you must use the following commands inside the car_shop container. To enter the container, type:

docker exec -it car_shop bash

Running all tests:

npm test

Running integration tests:

npm run test:integration

Running unit tests:

npm run test:unit

Run all tests and see its coverage:

npm run test:coverage

Endpoints 🌐

Click here to export automatically:

Run in Insomnia}

Or just import the file insomniaRoutes.json inside your environment: https://docs.insomnia.rest/insomnia/import-export-data