🇺🇸 English
Node.js and Express.js project developed by Raphael Martins at the end of Unit 23 (Back-end Development Module) of Trybe's Web Development course. I was approved with 100% of the mandatory and optional requirements met.
We had to create a RESTful API using MSC (Model-Service-Controller) architecture and implement unit tests with Mocha, Chai and Sinon.
🇧🇷 Português
Projeto Node.js e Express.js desenvolvido por Raphael Martins ao final do Bloco 23 (Módulo Desenvolvimento Back-end) do curso de Desenvolvimento Web da Trybe. Fui aprovado com 100% dos requisitos obrigatórios e opcionais atingidos.
Tivemos que criar uma API RESTful usando a arquitetura MSC (Model-Service-Controller) e implementar testes unitários com Mocha, Chai e Sinon.
🇺🇸 English
- Create an Express.js application
- Create a RESTful API using MSC (Model-Service-Controller) architecture
- Validate requests' data with the Joi library
- Implement unit tests with Mocha, Chai and Sinon
🇧🇷 Português
- Criar uma aplicação Express.js
- Criar uma API RESTful usando arquitetura MSC (Model-Service-Controller)
- Validar dados das requisições com a biblioteca Joi
- Implementar testes unitários com Mocha, Chai e Sinon
- Node.js
- Express.js
- Express Rescue
- DotEnv
- Joi
- Mocha.js
- Chai.js
- Sinon.js
- Docker
- MySQL
🇺🇸 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.
git clone [email protected]:raphaelalmeidamartins/store-manager.git
docker-compose up -d --buid
Connect to the MySQL server running on the 3306 port using a MySQL client of your choice. With the following credentials:
- host:
db
- user:
root
- password:
password
Then, in the client, run the scripts in the migration.sql
and seed.sql
files.
docker exec -it store_manager bash
Install the dependencies:
npm install
Run the application:
npm start
Access the route http://localhost:3000/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.
npm run test:mocha
🇧🇷 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.
git clone [email protected]:raphaelalmeidamartins/store-manager.git
docker-compose up -d --build
Conecte ao servidor MySQL rodando na porta 3306 usando um cliente MySQL de sua preferência. Utilize as seguintes credenciais:
- host:
db
- user:
root
- password:
password
Então, no cliente, execute os scripts que estão nos arquivos migration.sql
e seed.sql
.
docker exec -it store_manager bash
Instalando dependências:
npm install
Executando aplicação:
npm start
Acesse a rota http://localhost:3000/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.
npm run test:mocha
🇺🇸 English
With the application running, enter the http://localhost:3000/docs/en route on your browser to see the English documentation.
🇧🇷 Português
Com a aplicação em execução, acesse a rota http://localhost:3000/docs/br no navegador para ver a documentação em português.