{"id":24665883,"url":"https://github.com/rafaelmoraes003/blogs-api","last_synced_at":"2026-04-08T16:32:06.878Z","repository":{"id":132548104,"uuid":"529418366","full_name":"rafaelmoraes003/blogs-api","owner":"rafaelmoraes003","description":"CRUD API for blog production using MySQL database with Sequelize.","archived":false,"fork":false,"pushed_at":"2023-02-14T02:49:50.000Z","size":266,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T10:52:46.090Z","etag":null,"topics":["express","http","javascript","jsonwebtoken","mysql","node","nodejs","orm","sequelize"],"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/rafaelmoraes003.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":"2022-08-26T22:15:51.000Z","updated_at":"2022-12-19T17:17:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"1947ae9a-2054-413a-9e98-b0d66cbc6e1b","html_url":"https://github.com/rafaelmoraes003/blogs-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rafaelmoraes003/blogs-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelmoraes003%2Fblogs-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelmoraes003%2Fblogs-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelmoraes003%2Fblogs-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelmoraes003%2Fblogs-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rafaelmoraes003","download_url":"https://codeload.github.com/rafaelmoraes003/blogs-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelmoraes003%2Fblogs-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31564898,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["express","http","javascript","jsonwebtoken","mysql","node","nodejs","orm","sequelize"],"created_at":"2025-01-26T07:13:58.452Z","updated_at":"2026-04-08T16:32:06.865Z","avatar_url":"https://github.com/rafaelmoraes003.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"left\"\u003eBlogs API\u003c/h1\u003e\n\n###\n\n\u003cp align=\"left\"\u003eIn this project an API and a database were created for the production of content for a blog.\u003cbr\u003e\u003cbr\u003eThe application was developed in Node.js using the Sequelize package with a MySQL database to make a CRUD of posts following the principles of REST.\u003cbr\u003e\u003cbr\u003eIn it, it is possible to access endpoints that bring information about users, publications and categories of publication themes, in addition to being possible to create new data about them, update them and delete them. los.\u003cbr\u003e\u003cbr\u003eThe objective of the project was to be able to use Sequelize to create, populate, perform read, create, update and delete operations in the database and create relationships between tables\u003cbr\u003e\u003cbr\u003eTo to guarantee the security and integrity of the application, the authentication and authorization of the endpoints were done through the JSON Web Token.\u003c/p\u003e \n\n###\n\n\u003ch2 align=\"left\"\u003eTechnologies used\u003c/h2\u003e\n\n###\n\n\u003cdiv align=\"left\"\u003e\n  \u003cimg src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/javascript/javascript-original.svg\" height=\"50\" width=\"62\" alt=\"javascript logo\"  /\u003e\n  \u003cimg src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/nodejs/nodejs-original.svg\" height=\"50\" width=\"62\" alt=\"nodejs logo\"  /\u003e\n  \u003cimg src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/sequelize/sequelize-original.svg\" height=\"50\" width=\"62\" alt=\"sequelize logo\"  /\u003e\n  \u003cimg src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/express/express-original.svg\" height=\"50\" width=\"62\" alt=\"express logo\"  /\u003e\n  \u003cimg src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/mysql/mysql-original.svg\" height=\"50\" width=\"62\" alt=\"mysql logo\"  /\u003e\n\u003c/div\u003e\n\n###\n\n\u003ch2 align=\"left\"\u003eHow to use the application\u003c/h2\u003e\n\n###\n\nClone the application using the `git clone` command. After that, enter the project folder using the `cd blogs-api` command and run the `npm install` command. After installation, use the `npm start` command and enter port 3000 in your browser.\n\n###\n\n\u003ch2 align=\"left\"\u003eAbout the database\u003c/h2\u003e\n\n- Delete the database\n\n`npm run drop`\n\n- Create the database and generate the tables\n\n`npm run prestart`\n\n- Insert data/populate tables\n\n`npm run seed`\n\n###\n\n\u003ch2 align=\"left\"\u003eEndpoints\u003c/h2\u003e\n\n###\n\n\u003ch2 align=\"left\"\u003eLogin\u003c/h2\u003e\n\n| Method | Functionality | URL |\n|---|---|---|\n| `POST` | Login with an existing user | http://localhost:3001/login |\n\n\u003ch4\u003eThe object to login must have the following format:\u003c/h4\u003e\n\n```JavaScript\n{\n  email: \"username@email.com\",\n  password: \"123456\"\n}\n```\n\n###\n\n\u003ch2 align=\"left\"\u003eUser\u003c/h2\u003e\n\n| Method | Functionality | URL |\n|---|---|---|\n| `GET` | List all users | http://localhost:3001/user |\n| `GET` | List a user based on its id | http://localhost:3001/user/:id |\n| `POST` | Create a new user | http://localhost:3001/user |\n| `DELETE` | Delete the user who owns the session | http://localhost:3001/user/ME |\n\n\u003ch4\u003eThe object to create a new user must have the following format:\u003c/h4\u003e\n\n```JavaScript\n{\n  displayName: \"username\",\n  email: \"username@email.com\",\n  password: \"123456\",\n  image: /* image url for user profile */\n}\n```\n\n###\n\n\u003ch2 align=\"left\"\u003ePost\u003c/h2\u003e\n\n| Method | Functionality | URL |\n|---|---|---|\n| `GET` | List all posts | http://localhost:3001/post |\n| `GET` | Lists the post (or posts) that have a certain term included in their title or content | http://localhost:3001/post/search?q |\n| `GET` | List a post based on its id | http://localhost:3001/post/:id |\n| `POST` | Create a new post | http://localhost:3001/post |\n| `PUT` | Update an existing post based on its id if the user in session owns that post | http://localhost:3001/post/:id |\n| `DELETE` | Delete a post based on its id if the user in session owns that post | http://localhost:3001/post/:id |\n\n\u003ch4\u003eThe object to create a new post must have the following format:\u003c/h4\u003e\n\n```JavaScript\n{\n  title: \"My Post\",\n  content: \"Women in Tech\",\n  categoryIds: [2, 5],\n}\n```\n\n###\n\n\u003ch2 align=\"left\"\u003eCategories\u003c/h2\u003e\n\n| Method | Functionality | URL |\n|---|---|---|\n| `GET` | List all categories | http://localhost:3001/categories |\n| `POST` | Create a new category | http://localhost:3001/categories |\n\n\u003ch4\u003eThe object to create a new category must have the following format:\u003c/h4\u003e\n\n```JavaScript\n{\n  name: \"Tech\"\n}\n```\n\n###\n\n\u003ch2 align=\"left\"\u003eCOMMENTS\u003c/h2\u003e\n\nAll endpoints (`except` `POST` ( `/login` and `/user`) require authorization through `JWT`. To acquire this token, it is necessary to create a user or log in with an existing user and place this token in the Authorization header of the request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafaelmoraes003%2Fblogs-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frafaelmoraes003%2Fblogs-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafaelmoraes003%2Fblogs-api/lists"}