{"id":18395685,"url":"https://github.com/romulooliveira94/digital-store-api-rest-v1","last_synced_at":"2026-04-20T09:05:38.799Z","repository":{"id":253706148,"uuid":"844270440","full_name":"RomuloOliveira94/digital-store-api-rest-v1","owner":"RomuloOliveira94","description":"Api Rest with jwt authentication made with Node/Express for a E-commerce Website.","archived":false,"fork":false,"pushed_at":"2024-08-19T16:22:50.000Z","size":60,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T14:47:01.905Z","etag":null,"topics":["expressjs","javascript","jwt","sequelize","sqlite"],"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/RomuloOliveira94.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":"2024-08-18T22:15:11.000Z","updated_at":"2024-08-19T16:22:53.000Z","dependencies_parsed_at":"2024-11-06T02:21:53.152Z","dependency_job_id":null,"html_url":"https://github.com/RomuloOliveira94/digital-store-api-rest-v1","commit_stats":null,"previous_names":["romulooliveira94/digital-store-api-rest-v1"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RomuloOliveira94/digital-store-api-rest-v1","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RomuloOliveira94%2Fdigital-store-api-rest-v1","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RomuloOliveira94%2Fdigital-store-api-rest-v1/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RomuloOliveira94%2Fdigital-store-api-rest-v1/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RomuloOliveira94%2Fdigital-store-api-rest-v1/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RomuloOliveira94","download_url":"https://codeload.github.com/RomuloOliveira94/digital-store-api-rest-v1/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RomuloOliveira94%2Fdigital-store-api-rest-v1/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32040364,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["expressjs","javascript","jwt","sequelize","sqlite"],"created_at":"2024-11-06T02:11:42.709Z","updated_at":"2026-04-20T09:05:38.782Z","avatar_url":"https://github.com/RomuloOliveira94.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\" style=\"font-weight: bold;\"\u003eDigital Store Api 💻\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n \u003ca href=\"#tech\"\u003eTechnologies\u003c/a\u003e •\n \u003ca href=\"#started\"\u003eGetting Started\u003c/a\u003e •\n  \u003ca href=\"#routes\"\u003eAPI Endpoints\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cb\u003eThis project is a REST API for managing products in an ecommerce store. The API manages product categories and users, and also includes authentication via jwt and route protection.\u003c/b\u003e\n\u003c/p\u003e\n\n\u003ch2 id=\"technologies\"\u003e💻 Technologies\u003c/h2\u003e\n\n- Javascript\n- Express\n- NodeJS\n- JsonWebToken\n- Sequelize\n- Sqlite\n\n\u003ch2 id=\"started\"\u003e🚀 Getting started\u003c/h2\u003e\n\n\u003ch3\u003ePrerequisites\u003c/h3\u003e\n\nHere you list all prerequisites necessary for running your project. For example:\n\n- [NodeJS](https://github.com/)\n- [Git 2](https://github.com)\n\n\u003ch3\u003eCloning\u003c/h3\u003e\n\nHow to clone your project\n\n```bash\ngit clone https://github.com/RomuloOliveira94/digital-store-api-rest-v1\n```\n\n\u003ch3\u003eConfig .env variables\u003c/h2\u003e\n\nUse the `.env.example` as reference to create your configuration file `.env`\n\n```yaml\nPORT=3000\nJWT_SECRETE=example\n```\n\n\u003ch3\u003eStarting\u003c/h3\u003e\n\n```bash\ncd digital-store-api-rest-v1\nnpm install\nnode --run dev or npm run dev\n```\n\n\u003ch2 id=\"routes\"\u003e📍 API Endpoints\u003c/h2\u003e\n\n\u003ch3\u003eUser Routes\u003c/h3\u003e\n\n\u003ch3\u003eGET api/user/register\u003c/h3\u003e\n\n**REQUEST**\n\n```json\n{\n  \"firstname\": \"teste\",\n  \"surname\": \"teste\",\n  \"email\": \"test@test.com\"\n}\n```\n\n**RESPONSE**\n\n```json\n{\n  \"firstname\": \"teste\",\n  \"surname\": \"teste\",\n  \"email\": \"test@test.com\"\n}\n```\n\n\u003ch3\u003ePOST api/user/token\u003c/h3\u003e\n\n**REQUEST**\n\n```json\n{\n  \"email\": \"test@test.com\",\n  \"password\": \"test123\"\n}\n```\n\n**RESPONSE**\n\n```json\n{\n  \"token\": \"OwoMRHsaQwyAgVoc3OXmL1JhMVUYXGGBbCTK0GBgiYitwQwjf0gVoBmkbuyy0pSi\"\n}\n```\n\n\u003ch3\u003eGET api/user\u003c/h3\u003e\n\n**RESPONSE**\n\n```json\n[\n  {\n    \"id\": 1,\n    \"firstname\": \"teste2\",\n    \"surname\": \"teste2\",\n    \"email\": \"user2@mail.com\"\n  },\n  {\n    \"id\": 3,\n    \"firstname\": \"teste4\",\n    \"surname\": \"teste4\",\n    \"email\": \"user4@mail.com\"\n  },\n  {\n    \"id\": 4,\n    \"firstname\": \"mudei carai\",\n    \"surname\": \"teste4\",\n    \"email\": \"user4@mail.com\"\n  },\n  {\n    \"id\": 5,\n    \"firstname\": \"teste4\",\n    \"surname\": \"teste4\",\n    \"email\": \"user4@mail.com\"\n  }\n]\n```\n\n\u003ch3\u003eGET api/user/1\u003c/h3\u003e\n\n**RESPONSE**\n\n```json\n{\n  \"firstname\": \"teste\",\n  \"surname\": \"teste\",\n  \"email\": \"test@test.com\"\n}\n```\n\n\u003ch3\u003ePUT api/user/1\u003c/h3\u003e\n\n**REQUEST**\n\n```json\n{\n   \"firstname\": \"teste2\",\n  \"password: \"112233\"\n}\n```\n\n**RESPONSE**\n\n```json\n{\n  \"firstname\": \"teste2\",\n  \"surname\": \"teste\",\n  \"email\": \"test@test.com\"\n}\n```\n\n\u003ch3\u003eDELETE api/user/1\u003c/h3\u003e\n\n**RESPONSE**\n\n```json\n{\n  \"message\": \"Usuário deletado com sucesso\"\n}\n```\n\n\u003ch3\u003eProduct Routes\u003c/h3\u003e\n\n\u003ch3\u003eGET /api/product/search\u003c/h3\u003e\n\n\u003ch4\u003eParams:\u003c/h4\u003e\n\n\u003cul\u003e\n  \u003cli\u003elimit (int)\u003c/li\u003e\n  \u003cli\u003epage (int)\u003c/li\u003e\n  \u003cli\u003efields (string)\u003c/li\u003e\n  \u003cli\u003ematch (string)\u003c/li\u003e\n  \u003cli\u003ecategory_ids (string)\u003c/li\u003e\n  \u003cli\u003eprice_range (string)\u003c/li\u003e\n  \u003cli\u003eoption (string)\u003c/li\u003e\n\u003c/ul\u003e\n\n**REQUEST**\n\n/api/product/search?limit=-1\u0026page=1\u0026fields=name\u0026match=produto1\u0026price_range=0-100\u0026category_ids=1,2\u0026option=GG,PP\n\n**RESPONSE**\n\n```json\n{\n  \"data\": [\n    {\n      \"name\": \"Produto 01\",\n      \"categories\": [\n        {\n          \"id\": 1,\n          \"name\": \"teste 1\",\n          \"slug\": \"teste-1\",\n          \"use_in_menu\": false,\n          \"createdAt\": \"2024-08-18T23:22:45.453Z\",\n          \"updatedAt\": \"2024-08-18T23:22:45.453Z\",\n          \"category_product\": {\n            \"createdAt\": \"2024-08-18T23:34:02.304Z\",\n            \"updatedAt\": \"2024-08-18T23:34:02.304Z\",\n            \"productId\": 10,\n            \"categoryId\": 1\n          }\n        }...\n      ],\n      \"images\": [\n        {\n          \"id\": 11,\n          \"enabled\": false,\n          \"url\": \"base64 da imagem 2\",\n          \"createdAt\": \"2024-08-18T23:34:02.278Z\",\n          \"updatedAt\": \"2024-08-18T23:34:02.278Z\",\n          \"productId\": 10\n        }...\n      ],\n      \"product_options\": [\n        {\n          \"id\": 1,\n          \"title\": \"Cor\",\n          \"shape\": \"square\",\n          \"radius\": \"4px\",\n          \"type\": \"text\",\n          \"values\": \"PP, GG, M\",\n          \"createdAt\": \"2024-08-18T23:34:02.279Z\",\n          \"updatedAt\": \"2024-08-18T23:34:02.279Z\",\n          \"productId\": 10\n        }\n      ]\n    },\n    ...\n  ],\n  \"limit\": \"-1\",\n  \"page\": \"1\",\n  \"total\": 2\n}\n```\n\n\u003ch3\u003eGET /api/product/1\u003c/h3\u003e\n\n**RESPONSE**\n\n```json\n{\n  \"id\": 7,\n  \"enabled\": true,\n  \"name\": \"Produto 01\",\n  \"slug\": \"produto-01\",\n  \"use_in_menu\": false,\n  \"stock\": 10,\n  \"description\": \"Descrição do produto 01\",\n  \"price\": 120,\n  \"price_with_discount\": 99.9,\n  \"createdAt\": \"2024-08-18T23:31:23.898Z\",\n  \"updatedAt\": \"2024-08-18T23:31:23.898Z\",\n  \"categories\": [\n    {\n      \"id\": 1,\n      \"name\": \"teste 1\",\n      \"slug\": \"teste-1\",\n      \"use_in_menu\": false,\n      \"createdAt\": \"2024-08-18T23:22:45.453Z\",\n      \"updatedAt\": \"2024-08-18T23:22:45.453Z\",\n      \"category_product\": {\n        \"createdAt\": \"2024-08-18T23:31:23.928Z\",\n        \"updatedAt\": \"2024-08-18T23:31:23.928Z\",\n        \"productId\": 7,\n        \"categoryId\": 1\n      }\n    },\n    {\n      \"id\": 2,\n      \"name\": \"teste 2\",\n      \"slug\": \"teste-2\",\n      \"use_in_menu\": true,\n      \"createdAt\": \"2024-08-18T23:22:47.543Z\",\n      \"updatedAt\": \"2024-08-18T23:22:47.543Z\",\n      \"category_product\": {\n        \"createdAt\": \"2024-08-18T23:31:23.928Z\",\n        \"updatedAt\": \"2024-08-18T23:31:23.928Z\",\n        \"productId\": 7,\n        \"categoryId\": 2\n      }\n    }\n  ],\n  \"images\": [\n    {\n      \"id\": 2,\n      \"enabled\": false,\n      \"url\": \"base64 da imagem 2\",\n      \"createdAt\": \"2024-08-18T23:31:23.910Z\",\n      \"updatedAt\": \"2024-08-18T23:31:23.910Z\",\n      \"productId\": 7\n    },\n    {\n      \"id\": 3,\n      \"enabled\": false,\n      \"url\": \"base64 da imagem 3\",\n      \"createdAt\": \"2024-08-18T23:31:23.910Z\",\n      \"updatedAt\": \"2024-08-18T23:31:23.910Z\",\n      \"productId\": 7\n    },\n    {\n      \"id\": 1,\n      \"enabled\": true,\n      \"url\": \"base64 da imagem 1\",\n      \"createdAt\": \"2024-08-18T23:31:23.910Z\",\n      \"updatedAt\": \"2024-08-18T23:31:23.910Z\",\n      \"productId\": 7\n    }\n  ],\n  \"product_options\": []\n}\n```\n\n\u003ch3\u003ePOST /api/product\u003c/h3\u003e\n\n**REQUEST**\n\n```json\n{\n    \"enabled\": true,\n    \"name\": \"Produto 01\",\n    \"slug\": \"produto-01\",\n    \"stock\": 10,\n    \"description\": \"Descrição do produto 01\",\n    \"price\": 119.90,\n    \"price_with_discount\": 99.90,\n    \"categories\": [1,2],\n    \"images\": [ \n      {\n        \"enabled\": true,\n        \"url\": \"base64 da imagem 1\" \n      },\n      {\n        \"enabled\": false,\n        \"url\": \"base64 da imagem 2\" \n      },\n      {\n        \"enabled\": false,\n        \"url\": \"base64 da imagem 3\" \n      }\n    ],\n    \"product_options\": [\n      {\n        \"title\": \"Cor\",\n        \"shape\": \"square\",\n        \"radius\": \"4px\",\n        \"type\": \"text\",\n        \"values\": \"PP, GG, M\"\n      },\n      {\n        \"title\": \"Tamanho\",\n        \"shape\": \"circle\",\n        \"type\": \"color\",\n        \"values\": \"#000, #333\"\n      }\n    ]\n  }\n```\n\n**RESPONSE**\n\n```json\n{\n  \"id\": 7,\n  \"enabled\": true,\n  \"name\": \"Produto 01\",\n  \"slug\": \"produto-01\",\n  \"use_in_menu\": false,\n  \"stock\": 10,\n  \"description\": \"Descrição do produto 01\",\n  \"price\": 120,\n  \"price_with_discount\": 99.9,\n  \"createdAt\": \"2024-08-18T23:31:23.898Z\",\n  \"updatedAt\": \"2024-08-18T23:31:23.898Z\",\n  \"categories\": [\n    {\n      \"id\": 1,\n      \"name\": \"teste 1\",\n      \"slug\": \"teste-1\",\n      \"use_in_menu\": false,\n      \"createdAt\": \"2024-08-18T23:22:45.453Z\",\n      \"updatedAt\": \"2024-08-18T23:22:45.453Z\",\n      \"category_product\": {\n        \"createdAt\": \"2024-08-18T23:31:23.928Z\",\n        \"updatedAt\": \"2024-08-18T23:31:23.928Z\",\n        \"productId\": 7,\n        \"categoryId\": 1\n      }\n    },\n    {\n      \"id\": 2,\n      \"name\": \"teste 2\",\n      \"slug\": \"teste-2\",\n      \"use_in_menu\": true,\n      \"createdAt\": \"2024-08-18T23:22:47.543Z\",\n      \"updatedAt\": \"2024-08-18T23:22:47.543Z\",\n      \"category_product\": {\n        \"createdAt\": \"2024-08-18T23:31:23.928Z\",\n        \"updatedAt\": \"2024-08-18T23:31:23.928Z\",\n        \"productId\": 7,\n        \"categoryId\": 2\n      }\n    }\n  ],\n  \"images\": [\n    {\n      \"id\": 2,\n      \"enabled\": false,\n      \"url\": \"base64 da imagem 2\",\n      \"createdAt\": \"2024-08-18T23:31:23.910Z\",\n      \"updatedAt\": \"2024-08-18T23:31:23.910Z\",\n      \"productId\": 7\n    },\n    {\n      \"id\": 3,\n      \"enabled\": false,\n      \"url\": \"base64 da imagem 3\",\n      \"createdAt\": \"2024-08-18T23:31:23.910Z\",\n      \"updatedAt\": \"2024-08-18T23:31:23.910Z\",\n      \"productId\": 7\n    },\n    {\n      \"id\": 1,\n      \"enabled\": true,\n      \"url\": \"base64 da imagem 1\",\n      \"createdAt\": \"2024-08-18T23:31:23.910Z\",\n      \"updatedAt\": \"2024-08-18T23:31:23.910Z\",\n      \"productId\": 7\n    }\n  ],\n  \"product_options\": []\n}\n```\n\n\u003ch3\u003ePUT /api/product/1\u003c/h3\u003e\n\n**REQUEST**\n\n```json\n{\n    \"enabled\": true,\n    \"name\": \"Produto 3\",\n    \"slug\": \"produto-03\",\n  }\n```\n\n**RESPONSE**\n\n```json\n{\n  \"id\": 1,\n  \"enabled\": true,\n  \"name\": \"Produto 3\",\n  \"slug\": \"produto-03\",\n  \"use_in_menu\": false,\n  \"stock\": 10,\n  \"description\": \"Descrição do produto 01\",\n  \"price\": 20,\n  \"price_with_discount\": 99.9,\n  \"createdAt\": \"2024-08-18T23:18:56.176Z\",\n  \"updatedAt\": \"2024-08-19T16:13:24.184Z\"\n}\n```\n\n\u003ch3\u003eDELETE /api/product/1\u003c/h3\u003e\n\n```json\n{ \"message\": \"Produto deletado com sucesso\" }\n```\n\n\u003ch3\u003eCategory Routes\u003c/h3\u003e\n\n\u003ch3\u003eGET /api/category/search\u003c/h3\u003e\n\n\u003ch4\u003eParams:\u003c/h4\u003e\n\n\u003cul\u003e\n  \u003cli\u003elimit (int)\u003c/li\u003e\n  \u003cli\u003epage (int)\u003c/li\u003e\n  \u003cli\u003efields (string)\u003c/li\u003e\n  \u003cli\u003euse_in_menu (boolean)\u003c/li\u003e\n\u003c/ul\u003e\n\n**REQUEST**\n\n/api/category/search?limit=3\u0026page=1\u0026fields=name\n\n**RESPONSE**\n\n```json\n{\n  \"data\": [\n    {\n      \"name\": \"teste 1\"\n    },\n    {\n      \"name\": \"teste 2\"\n    },\n    {\n      \"name\": \"teste 3\"\n    }\n  ],\n  \"limit\": \"3\",\n  \"page\": \"1\",\n  \"total\": 3\n}\n```\n\n\u003ch3\u003eGET /api/category/1\u003c/h3\u003e\n\n**RESPONSE**\n\n```json\n{\n  \"id\": 1,\n  \"name\": \"teste 1\",\n  \"slug\": \"teste-1\",\n  \"use_in_menu\": true,\n  \"createdAt\": \"2024-08-18T23:22:45.453Z\",\n  \"updatedAt\": \"2024-08-18T23:22:45.453Z\"\n}\n```\n\n\u003ch3\u003ePOST /api/category\u003c/h3\u003e\n\n**REQUEST**\n\n```json\n{\n  \"id\": 6,\n  \"name\": \"teste 5\",\n  \"slug\": \"teste-5\",\n  \"use_in_menu\": true\n}\n```\n\n**RESPONSE**\n\n```json\n{\n  \"id\": 6,\n  \"name\": \"teste 5\",\n  \"slug\": \"teste-5\",\n  \"use_in_menu\": true,\n  \"updatedAt\": \"2024-08-19T14:10:46.514Z\",\n  \"createdAt\": \"2024-08-19T14:10:46.514Z\"\n}\n```\n\n\u003ch3\u003ePUT /api/category/1\u003c/h3\u003e\n\n**REQUEST**\n\n```json\n{\n  \"id\": 6,\n  \"name\": \"teste 5.1\",\n  \"slug\": \"teste-5\",\n  \"use_in_menu\": false\n}\n```\n\n**RESPONSE**\n\n```json\n{\n  \"id\": 6,\n  \"name\": \"teste 5.1\",\n  \"slug\": \"teste-5\",\n  \"use_in_menu\": false,\n  \"updatedAt\": \"2024-08-19T14:10:46.514Z\",\n  \"createdAt\": \"2024-08-19T14:10:46.514Z\"\n}\n```\n\n\u003ch3\u003eDELETE /api/category/1\u003c/h3\u003e\n\n```json\n{ \"message\": \"Categoria deletada com sucesso\" }\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromulooliveira94%2Fdigital-store-api-rest-v1","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fromulooliveira94%2Fdigital-store-api-rest-v1","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromulooliveira94%2Fdigital-store-api-rest-v1/lists"}