https://github.com/raphaelalmeidamartins/mongodb-car-shop
RESTful API project developed at the end of Unit 30 (Back-end Development Module) of the Trybe's Web Development course
https://github.com/raphaelalmeidamartins/mongodb-car-shop
chai express mocha mongodb mongoose nodejs sinn testing typescript
Last synced: about 2 months ago
JSON representation
RESTful API project developed at the end of Unit 30 (Back-end Development Module) of the Trybe's Web Development course
- Host: GitHub
- URL: https://github.com/raphaelalmeidamartins/mongodb-car-shop
- Owner: raphaelalmeidamartins
- Created: 2022-09-19T15:01:26.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-19T23:07:17.000Z (over 2 years ago)
- Last Synced: 2025-01-18T15:36:17.511Z (3 months ago)
- Topics: chai, express, mocha, mongodb, mongoose, nodejs, sinn, testing, typescript
- Language: TypeScript
- Homepage:
- Size: 715 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# :red_car: MongoDB Car Shop :motorcycle:

## :page_with_curl: About/Sobre
:us: English
MongoDB, Node.js, Express.js, TypeScript, OOP (Object-Oriented Programming) and SOLID project developed by [Raphael Martins](https://www.linkedin.com/in/raphaelameidamartins/) at the end of Unit 30 ([Back-end Development Module](https://github.com/raphaelalmeidamartins/trybe_exercicios/tree/main/3_Desenvolvimento-Back-end)) of Trybe's Web Development course. I was approved with 100% of the mandatory and optional requirements met.
We had to develop a RESTful API for a Car shop using OOP (Object-Oriented Programming) and SOLID principles with a MongoDB database. We also had to implement unit tests.
:brazil: Português
Projeto de MongoDB, Node.js, Express.js, TypeScript, POO (Programação Orientada a Objetos) e SOLID desenvolvido por [Raphael Martins](https://www.linkedin.com/in/raphaelameidamartins/) ao final do Bloco 30 ([Módulo Desenvolvimento Back-end](https://github.com/raphaelalmeidamartins/trybe_exercicios/tree/main/3_Desenvolvimento-Back-end)) do curso de Desenvolvimento Web da Trybe. Fui aprovado com 100% dos requisitos obrigatórios e opcionais atingidos.
Tivemos que desenvolver uma API RESTful para uma loja de veículos utilizando POO (Programação Orientada a Objetos) e princípios de SOLID com um banco de dados MongoDB. Também tivemos que implementar testes unitários.
## :man_technologist: Developed Skills/Habilidades Desenvolvidas
:us: English
* Create classes
* Define types and interfaces
* Use OOP concepts such as Abstraction, Encapsulation, Inheritance, Composition and Polymorfism
* Use SOLID principles, such as Single Responsability, Open/Closed, Dependency Inversion, Substitution (Liskov) and Interface Segregation
* Develop a Express.js application with TypeScript
* Use a MongoDB database
* Use Mongoose.js with TypeScript
* Create a RESTful API
* Implement unit tests:brazil: Português
* Criar classes
* Definir types e interfaces
* Utilizar conceitos de POO como: Abstração, Encapsulamento, Herança, Composição e Polimorfismo
* Utilizar princípios de SOLID como: Responsabilidade Única, Aberto/Fechado, Inversão de dependência, Substituição de Liskov e Segragação de Interfaces
* Desenvolver uma aplicação Express.js com TypeScript
* Utilizar um banco de dados MongoDB
* Utilizar o Mongoose.js com TypeScript
* Criar uma API RESTful
* Implementar testes unitários## :hammer_and_wrench: Tools/Ferramentas
* TypeScript
* Node.js
* Express.js
* Mongoose.js
* MongoDB
* Mocha.js
* Chai.js
* Sinon.js
* Docker
* OOP (Object-Oriented Programming)
* SOLID## :hammer_and_wrench: Installation and execution/Instalação e execução
:us: English
To run this application you need to have **Git**, **Docker** and **Docker Compose** installed on your machine. Docker Compose needs to be at **1.29** version or superior.
### 1 - Clone the repository and enter the application folder
```sh
git clone [email protected]:raphaelalmeidamartins/mongodb-car-shop.git && cd mongodb-car-shop
```### 2 - Run the containers by running the command below in the application folder
```sh
docker-compose up -d --buid
```### 3 - Access the documentation and make requests to the server running on the port 3001
Access the route http://localhost:3001/docs/en to see the English documentation and try the API. If you prefer, you can use a HTTP requests client of your choice (Insomnia, Thunder Client, etc) to make requests.
:brazil: Português
Para rodar está aplicação é necessário ter **Git**, **Docker** e o **Docker Compose** instalados no seu computador. O Docker Compose precisa estar na versão **1.29** ou superior.
### 1 - Clone o repositório e entre na pasta da aplicação
```sh
git clone [email protected]:raphaelalmeidamartins/mongodb-car-shop.git && cd mongodb-car-shop
```### 2 - Rode os containers executando o comando abaixo na pasta raiz da aplicação
```sh
docker-compose up -d --build
```### 3 - Acesse a documentação e faça requisições para o servidor aberto na porta 3001
Acesse a rota http://localhost:3001/docs/br para acessar a documentação em português e testar a API. Se preferir, utilize um cliente de requisições HTTP de sua preferência (Insomnia, Thunder Client, etc) para fazer as requisições.
## :books: Documentation/Documentação
:us: English
With the application running, enter the http://localhost:3001/docs/en route on your browser to see the English documentation.
:brazil: Português
Com a aplicação em execução, acesse a rota http://localhost:3001/docs/br no navegador para ver a documentação em português.
## :test_tube: Tests coverage/Cobertura de testes
:us: English
Run the following command in the root directory of the project to check the tests coverage:
```sh
npm run test:coverage
```
:brazil: Português
Execute o comando abaixo no diretório raiz do projeto para verificar a cobertura de testes.
```sh
npm run test:coverage
```
## :trophy: Grade/Nota
