{"id":26921503,"url":"https://github.com/odevthomas/blog-api-fastify","last_synced_at":"2025-06-12T11:37:37.400Z","repository":{"id":284405889,"uuid":"954842705","full_name":"odevthomas/Blog-Api-Fastify","owner":"odevthomas","description":"Uma API RESTful para um blog, onde usuários podem criar posts, comentar e curtir.","archived":false,"fork":false,"pushed_at":"2025-03-25T17:49:45.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T18:40:14.796Z","etag":null,"topics":[],"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/odevthomas.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-25T17:44:23.000Z","updated_at":"2025-03-25T17:50:55.000Z","dependencies_parsed_at":"2025-03-25T18:50:49.553Z","dependency_job_id":null,"html_url":"https://github.com/odevthomas/Blog-Api-Fastify","commit_stats":null,"previous_names":["odevthomas/blog-api-fastify"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odevthomas%2FBlog-Api-Fastify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odevthomas%2FBlog-Api-Fastify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odevthomas%2FBlog-Api-Fastify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odevthomas%2FBlog-Api-Fastify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/odevthomas","download_url":"https://codeload.github.com/odevthomas/Blog-Api-Fastify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246730059,"owners_count":20824393,"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":[],"created_at":"2025-04-01T23:34:39.865Z","updated_at":"2025-04-01T23:34:40.457Z","avatar_url":"https://github.com/odevthomas.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📝 API para Blog com Fastify  \n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/lucide-icons/lucide/main/icons/server.svg\" alt=\"API Blog\" width=\"100\" height=\"100\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eUma API RESTful para um blog, onde usuários podem criar posts, comentar e curtir.\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#funcionalidades\"\u003eFuncionalidades\u003c/a\u003e •\n  \u003ca href=\"#tecnologias\"\u003eTecnologias\u003c/a\u003e •\n  \u003ca href=\"#como-usar\"\u003eComo Usar\u003c/a\u003e •\n  \u003ca href=\"#estrutura\"\u003eEstrutura\u003c/a\u003e •\n  \u003ca href=\"#licenca\"\u003eLicença\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Fastify-5.2.1-blue?logo=fastify\" alt=\"Fastify\"/\u003e\n  \u003cimg src=\"https://img.shields.io/badge/PostgreSQL-14-blue?logo=postgresql\" alt=\"PostgreSQL\"/\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Version-1.0.0-success\" alt=\"Version\"/\u003e\n\u003c/p\u003e\n\n---\n\n## ⚙️ Funcionalidades  \n\n- 📌 **Listar Posts**: Qualquer usuário pode visualizar as postagens.  \n- 📝 **Criar Post**: Usuário pode criar um post informando **nome** e **título**.  \n- 💬 **Comentar Post**: Usuário pode comentar em um post informando **nome** e **conteúdo do comentário**.  \n- 👍 **Dar Like no Post**: Usuário pode curtir um post.  \n- ❌ **Excluir Post**: Usuário pode deletar um post.  \n\n---\n\n## 🚀 Tecnologias  \n\nEste projeto utiliza as seguintes tecnologias:  \n\n- [Fastify](https://www.fastify.io/) - Framework web para Node.js.  \n- [PostgreSQL](https://www.postgresql.org/) - Banco de dados relacional.  \n- [JWT (jsonwebtoken)](https://github.com/auth0/node-jsonwebtoken) - Autenticação baseada em token.  \n- [Dotenv](https://github.com/motdotla/dotenv) - Gerenciamento de variáveis de ambiente.  \n- [Pino Pretty](https://github.com/pinojs/pino-pretty) - Logger para Fastify.  \n- [Request](https://github.com/request/request) - Realizar requisições HTTP.  \n\n---\n\n## 🛠️ Como Usar  \n\n### 1️⃣ Clonar o repositório  \n\n```bash\ngit clone https://github.com/seu-usuario/seu-repo.git\ncd seu-repo\n```\n\n### 2️⃣ Criar e configurar o arquivo `.env`  \n\nCrie um arquivo `.env` na raiz do projeto e adicione as seguintes variáveis:  \n\n```env\nDB_USER=postgres\nDB_PASSWORD=postgres\nDB_NAME=blogdb\nDB_HOST=localhost\nPORT=3000\nJWT_SECRET=seuSegredoSuperSecreto\n```\n\n### 3️⃣ Instalar as dependências  \n\n```bash\nnpm install\n```\n\n### 4️⃣ Iniciar o servidor  \n\n```bash\nnpm start\n```\n\nA API estará disponível em **http://localhost:3000**.  \n\n---\n\n## 📂 Estrutura  \n\n```\n/src\n  /controllers\n    postController.js\n    commentController.js\n  /models\n    Post.js\n    Comment.js\n    index.js\n  /routes\n    postRoutes.js\n    commentRoutes.js\n  /config\n    database.js\nserver.js\nDockerfile\ndocker-compose.yml\npackage.json\n.env\n```\n\n---\n\n## 📝 Licença  \n\nEste projeto está licenciado sob a **MIT License**. Veja o arquivo [LICENSE](./LICENSE) para mais detalhes.  \n\n---\n\n\u003cp align=\"center\"\u003e\n  Desenvolvido por \u003cstrong\u003e odevthomas | Thomas   \u003c/strong\u003e 🚀\n\u003c/p\u003e\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fodevthomas%2Fblog-api-fastify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fodevthomas%2Fblog-api-fastify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fodevthomas%2Fblog-api-fastify/lists"}