Skip to content

Latest commit

 

History

History
167 lines (139 loc) · 3.93 KB

README.md

File metadata and controls

167 lines (139 loc) · 3.93 KB

CAR SHOP 🚗

📄 Sobre | About

PT
API com CRUD para gerenciar uma concessionária de veículos utilizando o banco de dados MongoDB

🎯 O objetivo foi aplicar os princípios de Programação Orientada a Objetos (POO)

🧪 A API foi testada usando Sinon, Mocha e Chai.

EN
CRUD API to manage a car dealership with MongoDB database

🎯 The goal was to apply the principles of Object Oriented Programming (OOP)

🧪 The API is tested using Sinon, Mocha and Chai.


🛠️ Ferramentas | Tools



✨Rotas | Routes

Feature Route
Create a car POST /cars
List cars GET /cars
Get car by ID GET /cars/:id
Update a car PUT /cars/:id
Delete a car DELETE /cars/:id
Create a motorcycles POST /motorcycles
List motorcycles GET /motorcycles
Get motorcycles by ID GET /motorcycles/:id
Update a motorcycles PUT /motorcycles/:id
Delete a motorcycles DELETE /motorcycles/:id

⚒️ Como rodar a aplicação | How to run the application

PT

Faça Download:

git clone [email protected]:queite/car-shop.git

Entre na pasta rauz:

cd car-shop

Rode os serviços node e mongodb:

docker-compose up -d

⚠ Esses serviços irão inicializar um container chamado car_shop e outro chamado car_shop_db.

Entre no container:

docker exec -it car_shop bash

Instale as dependências:

npm install

⚠ Caso opte por utilizar o Docker, TODOS os comandos disponíveis no package.json (npm start, npm test, npm run dev, ...) devem ser executados DENTRO do container.

EN

Download the code:

git clone [email protected]:queite/car-shop.git

Enter the root folder:

cd car-shop

Run the services node and mongodb:

docker-compose up -d

⚠ These services are going to start a container called car_shop and another called car_shop_db.

Enter the container:

docker exec -it car_shop bash

Install dependencies:

npm install

⚠ If you choose to use Docker, ALL commands available in package.json (npm start, npm test, npm run dev, ...) must be executed WITHIN the container.


🧪 Testes | Tests

Test coverage

⚙️ Rode os testes | Run the tests

EN
Unit tests were created for 100% coverage of this API.

Run tests

npm run test:dev

Run tests coverage

npm run test:coverage
PT
Foram criados testes unitários para uma cobertura de 100% desta API.

Rode os testes

npm run test:dev

Rode a cobertura de testes

npm run test:coverage

PT
Projeto desenvolvido durante o módulo de back-end na Trybe.
Todos os projetos da Trybe usam linters, Git and GitHub.

EN
Project developed in the back-end module at the Trybe course.
All Trybe projects use linters, Git and GitHub.