{"id":20814684,"url":"https://github.com/raphaelalmeidamartins/blogs-api","last_synced_at":"2025-08-16T11:47:07.621Z","repository":{"id":46324091,"uuid":"515023440","full_name":"raphaelalmeidamartins/blogs-api","owner":"raphaelalmeidamartins","description":"RESTful API developed with Node.js, Express.js and Sequelize.js at the end of Unit 24 (Back-end Development Module) of the Trybe's Web Development course ","archived":false,"fork":false,"pushed_at":"2022-07-25T03:03:05.000Z","size":830,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-03-03T23:28:41.939Z","etag":null,"topics":["docker","docker-compose","expressjs","joi-validation","mysql","nodejs","sequelize","swagger"],"latest_commit_sha":null,"homepage":"https://blogs-api-24072022.herokuapp.com/docs/en/","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-18T03:34:15.000Z","updated_at":"2022-11-10T18:11:20.000Z","dependencies_parsed_at":"2022-08-30T05:53:08.055Z","dependency_job_id":null,"html_url":"https://github.com/raphaelalmeidamartins/blogs-api","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelalmeidamartins%2Fblogs-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelalmeidamartins%2Fblogs-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelalmeidamartins%2Fblogs-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelalmeidamartins%2Fblogs-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raphaelalmeidamartins","download_url":"https://codeload.github.com/raphaelalmeidamartins/blogs-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225091423,"owners_count":17419493,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["docker","docker-compose","expressjs","joi-validation","mysql","nodejs","sequelize","swagger"],"created_at":"2024-11-17T21:17:45.531Z","updated_at":"2024-11-17T21:17:46.042Z","avatar_url":"https://github.com/raphaelalmeidamartins.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :computer: Blogs API :writing_hand:\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 24 ([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 blog RESTful API using MSC (Model-Service-Controller) architecture. We must use the Sequelize.js ORM to connect with the database, and handle authentication with Json Web Token.\n\n[Click here](https://blogs-api-24072022.herokuapp.com/docs/en/) to check out the final version of the project on your browser.\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, Express.js e Sequelize.js desenvolvido por [Raphael Martins](https://www.linkedin.com/in/raphaelameidamartins/) ao final do Bloco 24 ([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 de blog usando a arquitetura MSC (Model-Service-Controller). A conexão com o banco de dados precisou ser feita com o ORM Sequelize e a autenticação com Json Web Token.\n\n[Clique aqui](https://blogs-api-24072022.herokuapp.com/docs/br/) para conferir a versão final do projeto no seu navegador.\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 authentication with Json Web Token (JWT)\n* Use the Sequelize.js ORM to connect with the database and perform queries\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 autenticação por Json Web Token (JWT)\n* Usar o ORM Sequelize.js para fazer a conexão e queries no banco de dados\n\u003cbr /\u003e\n\u003c/details\u003e\n\n## :hammer_and_wrench: Tools/Ferramentas\n\n* Node.js\n* Express.js\n* Sequelize.js\n* Express Rescue\n* Json Web Tokens\n* DotEnv\n* Joi\n* Docker\n* MySQL\n\n## :whale2: Installation and execution with Docker/Instalação e execução com Docker\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 https://github.com/raphaelalmeidamartins/blogs-api\n```\n\n### 2 - Run the containers by running the command below in the application folder\n```sh\ndocker-compose up -d --build\n```\n\n### 3 - Run this command to attach the container to your terminal\n```sh\ndocker exec -it blogs_api bash\n```\n\n### 4 - 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### 5 - 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\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/blogs-api.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 - Rode o comando para abrir o terminal do container blogs_api\n```sh\ndocker exec -it blogs_api bash\n```\n\n### 4 - 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### 5 - 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\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. If you prefer, [checkout the deploy on Heroku](https://blogs-api-24072022.herokuapp.com/docs/en/)\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. Se preferir, [acesse o deploy no Heroku](https://blogs-api-24072022.herokuapp.com/docs/br/).\n\u003cbr /\u003e\n\u003c/details\u003e\n\n## :trophy: Grade/Nota\n\n![My grade of the project - Minha nota no projeto](./nota.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphaelalmeidamartins%2Fblogs-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraphaelalmeidamartins%2Fblogs-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphaelalmeidamartins%2Fblogs-api/lists"}