{"id":22239555,"url":"https://github.com/bohdan-mykhailenko/api_inventory-app","last_synced_at":"2026-04-11T09:43:49.998Z","repository":{"id":193241960,"uuid":"688346550","full_name":"bohdan-mykhailenko/api_inventory-app","owner":"bohdan-mykhailenko","description":"An API for the inventory app with database and files storage.","archived":false,"fork":false,"pushed_at":"2023-11-02T12:47:43.000Z","size":3464,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-30T03:08:20.159Z","etag":null,"topics":["express","nodejs","postgresql","sequelize","socket-io"],"latest_commit_sha":null,"homepage":"https://inventory-backend-mu.vercel.app","language":"TypeScript","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/bohdan-mykhailenko.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":"2023-09-07T06:55:10.000Z","updated_at":"2024-08-03T09:41:52.000Z","dependencies_parsed_at":"2023-09-07T10:41:59.475Z","dependency_job_id":"9fa8e128-7fe4-4d9a-8c0d-3c01aed57fb4","html_url":"https://github.com/bohdan-mykhailenko/api_inventory-app","commit_stats":null,"previous_names":["bohdan-mykhailenko/inventory-backend","bohdan-mykhailenko/api_inventory-app"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bohdan-mykhailenko/api_inventory-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bohdan-mykhailenko%2Fapi_inventory-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bohdan-mykhailenko%2Fapi_inventory-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bohdan-mykhailenko%2Fapi_inventory-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bohdan-mykhailenko%2Fapi_inventory-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bohdan-mykhailenko","download_url":"https://codeload.github.com/bohdan-mykhailenko/api_inventory-app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bohdan-mykhailenko%2Fapi_inventory-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31676210,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T08:18:19.405Z","status":"ssl_error","status_checked_at":"2026-04-11T08:17:08.892Z","response_time":54,"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":["express","nodejs","postgresql","sequelize","socket-io"],"created_at":"2024-12-03T03:19:58.254Z","updated_at":"2026-04-11T09:43:49.983Z","avatar_url":"https://github.com/bohdan-mykhailenko.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Inventory API\n\n## Overview\n* [**Demo Link**](https://bohdan-mykhailenko.github.io/inventory/)\n* [**Frontend Repo**](https://github.com/bohdan-mykhailenko/inventory)\n\n## Description\n\nThis repository contains the source code for the Inventory-API project, which serves as the backend for the inventory application. The API is based on **_Node.js_**, **_Express.js_** and **_Socket.io_**, and it interacts with a **_PostgreSQL_** database using the **_Sequelize ORM_**.\n\n## Features\n\n**The API provides the following features:**\n\n- **Get data:** Get orders and products with certain criteria.\n- **Post data:** Create a new order or product.\n- **Delete data**: Delete any required order or product.\n- **Count active sessions:** Using the web-socket server the app count sessions.\n\n**Additional features:**\n\n- **Image upload:** Store image files and use the static feature.\n- **Filtering:** Filtering products and orders by query or type(for products).\n\n## Technologies\n\n- [TypeScript](https://www.typescriptlang.org/)\n- [Node.js](https://nodejs.org/en)\n- [Express](https://expressjs.com/)\n- [Socket.io](https://socket.io/)\n- [Sequelize](https://sequelize.org/)\n- [Sequelize CLI](https://sequelize.org/docs/v7/cli/)\n- [PostgreSQL](https://www.postgresql.org/)\n- [Multer](https://github.com/expressjs/multer)\n\n## Getting Started\n\nTo get started with the Online-Store-API, follow these steps:\n\n1. Clone the repository:\n\n```shell\nhttps://github.com/\u003cyour-username\u003e/inventory-backend.git\n```\n\n2. Install dependencies:\n\n```shell\nnpm install\n```\n\n3. Set up PostgreSQL Database:\n - Open the **database/config.ts** file and add your PostgreSQL database configuration.\n\n```\nexport const config = {\n  DB_HOST: 'host',\n  DB_NAME: 'name',\n  DB_USERNAME: 'username',\n  DB_PASSWORD: 'password',\n};\n```\n\n4. Run migrates:\n\n```shell\nnpm run migrate\n```\n\n5. Run seeds:\n\n```shell\nnpm run seeds\n```\n\n6. Start the server:\n\n```shell\nnpm run dev\n```\n\n\n## Endpoints\n\nThe base URL for the API is: **https://inventory-backend-production-324c.up.railway.app**\n\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003cth\u003e\n        \tMethod\n        \u003c/th\u003e\n        \u003cth\u003e\n        \tEndpoint\n        \u003c/th\u003e\n        \u003cth\u003e\n        \tDescription\n        \u003c/th\u003e\n        \u003cth\u003e\n        \tBody\n        \u003c/th\u003e\n    \u003c/tr\u003e\n    \t\u003ctr\u003e\n        \u003cth colspan=\"4\"\u003eProducts\u003c/th\u003e\n    \t\u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n        \tGET\n        \u003c/td\u003e\n        \u003ctd\u003e\n        \t\t/products/:productId\n        \u003c/td\u003e\n        \u003ctd\u003e\n        \tGet product with certain id.\n        \u003c/td\u003e\n        \u003ctd\u003e\n        \tNULL\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n        \tGET\n        \u003c/td\u003e\n        \u003ctd\u003e\n        \t\t/products?query=query\u0026type=type\n        \u003c/td\u003e\n        \u003ctd\u003e\n        \tGet all products with filtering by query and type\n        \u003c/td\u003e\n        \u003ctd\u003e\n        \tNULL\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n        \tGET\n        \u003c/td\u003e\n        \u003ctd\u003e\n        \t/products/order/orderId\n        \u003c/td\u003e\n        \u003ctd\u003e\n        \tGet all products for certain order.\n        \u003c/td\u003e\n        \u003ctd\u003e\n        \tNULL\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n        \tPOST\n        \u003c/td\u003e\n        \u003ctd\u003e\n          /products\n        \u003c/td\u003e\n        \u003ctd\u003e\n        \tCreate new product with all required fields connected to existed order.\n        \u003c/td\u003e\n        \u003ctd\u003e\n\u003cpre\u003e\n{\n serialNumber: string,\n isNew: boolean,\n isRepairing: boolean,\n photo: Blob,\n title: string,\n type: string,\n specification: string,\n guarantee: JSON.Stringify({\n   start: string,\n   end: string,\n }),\n price: JSON.Stringify({\n   value: number,\n   symbol: string,\n   isDefault: number,\n  },\n  {\n   value: number,\n   symbol: string,\n   isDefault: number,\n });\n date: string,\n}\n\u003cpre\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n        \tDELETE\n        \u003c/td\u003e\n        \u003ctd\u003e\n        \t/products/:productId\n        \u003c/td\u003e\n        \u003ctd\u003e\n        \tDelete product with certain id.\n        \u003c/td\u003e\n        \u003ctd\u003e\n        \tNULL\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003cth colspan=\"4\"\u003eOrders\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n        \tGET\n        \u003c/td\u003e\n        \u003ctd\u003e\n        \t\t/orders/:orderId\n        \u003c/td\u003e\n        \u003ctd\u003e\n        \tGet orderwith certain id.\n        \u003c/td\u003e\n        \u003ctd\u003e\n        \tNULL\n        \u003c/td\u003e\n    \u003c/tr\u003e\n\u003ctr\u003e\n        \u003ctd\u003e\n        \tGET\n        \u003c/td\u003e\n        \u003ctd\u003e\n        \t/orders?query=query\n        \u003c/td\u003e\n        \u003ctd\u003e\n        \tGet all orders filtering by query.\n        \u003c/td\u003e\n        \u003ctd\u003e\n        \tNULL\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n        \tPOST\n        \u003c/td\u003e\n        \u003ctd\u003e\n        \t/orders\n        \u003c/td\u003e\n        \u003ctd\u003e\n        \tCreate new order with all required fields.\n        \u003c/td\u003e\n        \u003ctd\u003e\n        \t\u003cpre\u003e\n{\n title: string,\n date: string,\n description: string,\n}\n       \u003c/pre\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n        \tDELETE\n        \u003c/td\u003e\n        \u003ctd\u003e\n        \t/orders/:orderId\n        \u003c/td\u003e\n        \u003ctd\u003e\n        \tDelete order with certain id and all connected products.\n        \u003c/td\u003e\n        \u003ctd\u003e\n        \tNULL\n        \u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbohdan-mykhailenko%2Fapi_inventory-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbohdan-mykhailenko%2Fapi_inventory-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbohdan-mykhailenko%2Fapi_inventory-app/lists"}