{"id":14967415,"url":"https://github.com/raphaelalmeidamartins/store-manager","last_synced_at":"2026-03-02T01:33:08.103Z","repository":{"id":43895307,"uuid":"510464046","full_name":"raphaelalmeidamartins/store-manager","owner":"raphaelalmeidamartins","description":"RESTful API developed with Node.js and Express.js at the end of Unit 23 (Back-end Development Module) of the Trybe's Web Development course","archived":false,"fork":false,"pushed_at":"2022-08-05T00:11:11.000Z","size":671,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T10:02:01.123Z","etag":null,"topics":["chai","docker","docker-compose","expressjs","joi-validation","mochajs","mysql","nodejs","sinonjs","swagger"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raphaelalmeidamartins.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-04T18:25:19.000Z","updated_at":"2024-10-24T20:36:29.000Z","dependencies_parsed_at":"2022-08-28T18:33:01.568Z","dependency_job_id":null,"html_url":"https://github.com/raphaelalmeidamartins/store-manager","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/raphaelalmeidamartins/store-manager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelalmeidamartins%2Fstore-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelalmeidamartins%2Fstore-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelalmeidamartins%2Fstore-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelalmeidamartins%2Fstore-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raphaelalmeidamartins","download_url":"https://codeload.github.com/raphaelalmeidamartins/store-manager/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelalmeidamartins%2Fstore-manager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29989014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T22:42:38.399Z","status":"ssl_error","status_checked_at":"2026-03-01T22:41:51.863Z","response_time":124,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chai","docker","docker-compose","expressjs","joi-validation","mochajs","mysql","nodejs","sinonjs","swagger"],"created_at":"2024-09-24T13:38:01.587Z","updated_at":"2026-03-02T01:33:08.084Z","avatar_url":"https://github.com/raphaelalmeidamartins.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :shopping_cart: Store Manager :department_store:\n\n![cover](./cover.png)\n\n## :page_with_curl: About/Sobre\n\n\u003cdetails\u003e\n  \u003csummary markdown=\"span\"\u003e\u003cstrong\u003e:us: English\u003c/strong\u003e\u003c/summary\u003e\u003cbr /\u003e\n\nNode.js and Express.js project developed by [Raphael Martins](https://www.linkedin.com/in/raphaelameidamartins/) at the end of Unit 23 ([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.\n\nWe had to create a RESTful API using MSC (Model-Service-Controller) architecture and implement unit tests with Mocha, Chai and Sinon.\n\u003cbr /\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary markdown=\"span\"\u003e\u003cstrong\u003e:brazil: Português\u003c/strong\u003e\u003c/summary\u003e\u003cbr /\u003e\n\nProjeto Node.js e Express.js desenvolvido por [Raphael Martins](https://www.linkedin.com/in/raphaelameidamartins/) ao final do Bloco 23 ([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.\n\nTivemos que criar uma API RESTful usando a arquitetura MSC (Model-Service-Controller) e implementar testes unitários com Mocha, Chai e Sinon.\n\u003cbr /\u003e\n\u003c/details\u003e\n\n## :man_technologist: Developed Skills/Habilidades Desenvolvidas\n\n\u003cdetails\u003e\n  \u003csummary markdown=\"span\"\u003e\u003cstrong\u003e:us: English\u003c/strong\u003e\u003c/summary\u003e\u003cbr /\u003e\n\n* Create an Express.js application\n* Create a RESTful API using MSC (Model-Service-Controller) architecture\n* Validate requests' data with the Joi library\n* Implement unit tests with Mocha, Chai and Sinon\n\u003cbr /\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary markdown=\"span\"\u003e\u003cstrong\u003e:brazil: Português\u003c/strong\u003e\u003c/summary\u003e\u003cbr /\u003e\n\n* Criar uma aplicação Express.js\n* Criar uma API RESTful usando arquitetura MSC (Model-Service-Controller)\n* Validar dados das requisições com a biblioteca Joi\n* Implementar testes unitários com Mocha, Chai e Sinon\n\u003cbr /\u003e\n\u003c/details\u003e\n\n## :hammer_and_wrench: Tools/Ferramentas\n\n* Node.js\n* Express.js\n* Express Rescue\n* DotEnv\n* Joi\n* Mocha.js\n* Chai.js\n* Sinon.js\n* Docker\n* MySQL\n\n## :hammer_and_wrench: Installation and execution/Instalação e execução\n\n\u003cdetails\u003e\n  \u003csummary markdown=\"span\"\u003e\u003cstrong\u003e:us: English\u003c/strong\u003e\u003c/summary\u003e\u003cbr /\u003e\n\nTo 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.\n\n### 1 - Clone the repository\n```sh\ngit clone git@github.com:raphaelalmeidamartins/store-manager.git\n```\n\n### 2 - Run the containers by running the command below in the application folder\n```sh\ndocker-compose up -d --buid\n```\n\n### 3 - Run the SQL Script to create the database\n\nConnect to the MySQL server running on the 3306 port using a MySQL client of your choice. With the following credentials:\n\n* host: `db`\n* user: `root`\n* password: `password`\n\nThen, in the client, run the scripts in the `migration.sql` and `seed.sql` files.\n\n### 4 - Run this command to attach the container to your terminal\n```sh\ndocker exec -it store_manager bash\n```\n\n### 5 - On the attached container, install the dependencies and run the application\n\nInstall the dependencies:\n```sh\nnpm install\n```\n\nRun the application:\n```sh\nnpm start\n```\n\n### 6 - Access the documentation and make requests to the server running on the port 3000\n\nAccess 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.\n\n### 7 - Check the tests coverage by running the following command on the attached terminal\n```sh\nnpm run test:mocha\n```\n\u003cbr /\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary markdown=\"span\"\u003e\u003cstrong\u003e:brazil: Português\u003c/strong\u003e\u003c/summary\u003e\u003cbr /\u003e\n\nPara 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.\n\n### 1 - Clone o repositório\n```sh\ngit clone git@github.com:raphaelalmeidamartins/store-manager.git\n```\n\n### 2 - Rode os containers executando o comando abaixo na pasta raiz da aplicação\n```sh\ndocker-compose up -d --build\n```\n\n### 3 - Execute os scripts SQL para criar o banco de dados\n\nConecte ao servidor MySQL rodando na porta 3306 usando um cliente MySQL de sua preferência. Utilize as seguintes credenciais:\n\n* host: `db`\n* user: `root`\n* password: `password`\n\nEntão, no cliente, execute os scripts que estão nos arquivos `migration.sql` e `seed.sql`.\n\n### 4 - Rode o comando para abrir o terminal do container store_manager\n```sh\ndocker exec -it store_manager bash\n```\n\n### 5 - No terminal do container, installe as dependências e execute a aplicação\n\nInstalando dependências:\n```sh\nnpm install\n```\n\nExecutando aplicação:\n```sh\nnpm start\n```\n\n### 6 - Acesse a documentação e faça requisições para o servidor aberto na porta 3000\n\nAcesse 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.\n\n### 7 - Rode o seguinte comando no terminal do container para verificar a cobertura dos testes\n```sh\nnpm run test:mocha\n```\n\u003cbr /\u003e\n\u003c/details\u003e\n\n## :books: Documentation/Documentação\n\n\u003cdetails\u003e\n  \u003csummary markdown=\"span\"\u003e\u003cstrong\u003e:us: English\u003c/strong\u003e\u003c/summary\u003e\u003cbr /\u003e\n\nWith the application running, enter the http://localhost:3000/docs/en route on your browser to see the English documentation.\n\u003cbr /\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary markdown=\"span\"\u003e\u003cstrong\u003e:brazil: Português\u003c/strong\u003e\u003c/summary\u003e\u003cbr /\u003e\n\nCom a aplicação em execução, acesse a rota http://localhost:3000/docs/br no navegador para ver a documentação em português.\n\u003cbr /\u003e\n\u003c/details\u003e\n\n## :test_tube: Tests Coverage/Cobertura de Testes\n\n![Test Coverage - Cobertura dos testes](./test-coverage.png)\n\n## :trophy: Grade/Nota\n\n![My grade of the project - Minha nota no projeto](./nota2.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphaelalmeidamartins%2Fstore-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraphaelalmeidamartins%2Fstore-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphaelalmeidamartins%2Fstore-manager/lists"}