{"id":18485439,"url":"https://github.com/system76/warehouse","last_synced_at":"2025-04-08T19:32:38.302Z","repository":{"id":44651597,"uuid":"318019603","full_name":"system76/warehouse","owner":"system76","description":"A microservice to encapsulate our inventory management functionality","archived":false,"fork":false,"pushed_at":"2023-10-25T23:26:16.000Z","size":151,"stargazers_count":13,"open_issues_count":1,"forks_count":3,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-23T17:45:50.588Z","etag":null,"topics":["broadway","elixir-lang","events","inventory","microservice"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/system76.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-02T23:31:30.000Z","updated_at":"2024-06-28T11:14:56.000Z","dependencies_parsed_at":"2022-09-13T15:42:10.851Z","dependency_job_id":"c77a386a-c4bd-4e58-83a1-7863ccc1ea18","html_url":"https://github.com/system76/warehouse","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"system76/copy_cat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/system76%2Fwarehouse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/system76%2Fwarehouse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/system76%2Fwarehouse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/system76%2Fwarehouse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/system76","download_url":"https://codeload.github.com/system76/warehouse/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247912763,"owners_count":21017044,"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":["broadway","elixir-lang","events","inventory","microservice"],"created_at":"2024-11-06T12:45:14.164Z","updated_at":"2025-04-08T19:32:37.980Z","avatar_url":"https://github.com/system76.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003eWarehouse\u003c/h1\u003e\n  \u003ch3\u003eAn inventory tracking microservice\u003c/h3\u003e\n  \u003cbr\u003e\n  \u003cbr\u003e\n\u003c/div\u003e\n\n---\n\n\u003e **NOTE**: This micro service is not fully written yet, and includes references\n\u003e to database records, processes, and workflows that are not yet implemented in\n\u003e here.\n\nThis repository contains the code that System76 uses to manage it's warehouse of\ncomputer parts. It is responsible for:\n\n- Creating POs with vendors to receive new parts\n- Manage receiving new parts from vendors\n- Manage kitting and the relationship between what we have in inventory and what\n  is requested from the e-commerce orders.\n- Calculating and tracking the demand for different SKUs in our system (available, back ordered, etc)\n\n## Communication\n\nThis micro service works very closely with (and is dependent on)\n[the Assembly service](https://github.com/system76/assembly). The assembly\nservice is responsible for tracking build details. They have a relationship like\nso:\n\n```\nAssembly ------------------------------------------------------------\u003e Warehouse\n\nThis is a gRPC request from Assembly to Warehouse to determine the\n`Warehouse.Schema.Component` quantity available. This is used to determine if a\n`Assembly.Schemas.Build` has all of the needed parts in stock to build. A\nsimilar RabbitMQ message is broadcasted when that quantity changes.\n\nAssembly \u003c------------------------------------------------------------ Warehouse\n\nThis is a gRPC request from Warehouse to Assembly to determine the demand of\n`Warehouse.Schema.Component`. This allows Warehouse to determine the back order\nstatus of a `Warehouse.Schema.Sku` and the quantity we need to order. A similar\nRabbitMQ message is broadcasted when this quantity changes.\n```\n\n## Schemas\n\nThis micro service as a couple of schemas it uses, but two stand out as the\ncornerstones.\n\n```\n        component_1             component_2              \u003c- `Warehouse.Schemas.Component`\n       /           \\           /           \\\n      /             \\         /             \\            \u003c- `Warehouse.Schemas.Kit`\n     /               \\       /               \\\nsku_1                 sku_two                 sku_two    \u003c- `Warehouse.Schemas.Sku`\n```\n\nThe `Warehouse.Schemas.Component` schema connects our e-ecommerce platform and\nassembly system to inventory. Anything that gets sold is a component. When you\npurchase a computer, every component selected (and some hidden components), are\nadded to a build. These components are represented as a very basic, customer\nfacing names like `NVIDIA RTX 3080`.\n\nThe `Warehouse.Schemas.Sku` schema is our lower level inventory system. This\nis a much more specific product that we buy from vendors, like\n`MSI GeForce RTX 3080 GAMING X TRIO 10GB`, or `G3080GXT10`.\n\nThe `Warehouse.Schemas.Kit` schema is how we combine the other two schemas.\nEvery `Warehouse.Schemas.Component` can be fulfilled by any selected\n`Warehouse.Schemas.Sku`, and most `Warehouse.Schemas.Sku`s can be used by\nmultiple `Warehouse.Schemas.Component`s. This comes into play with more complex\nconfigurations like memory. A pseudo example of this:\n\n```\n%Component{id: 1, name: \"32 GB DDR4 @ 3200 MHz Desktop Memory\"}\n\n%Kit{component_id: 1, sku_id: 1, quantity: 4}\n%Sku{sku_id: 1, name: \"Kingston 8 GB DDR4 at 3200 MHz\"}\n\n%Kit{component_id: 1, sku_id: 2, quantity: 4}\n%Sku{sku_id: 2, name: \"Crucial 16 GB DDR4 at 3200 MHz\"}\n\n%Kit{component_id: 1, sku_id: 3, quantity: 2}\n%Sku{sku_id: 3, name: \"Kingston 16 GB DDR4 at 3200 MHz\"}\n```\n\n## Development Setup\n\nFirst, make sure you are running the dependency services with `docker-compose`:\n\n```shell\ndocker-compose up\n```\n\nDependencies are managed via `mix`. In the repo, run:\n\n```shell\nmix deps.get\n```\n\nThen run this to test the project:\n\n```shell\nmix test\n```\n\n### Contributing\n\nThis project makes use of [https://pre-commit.com/](https://pre-commit.com/) to ensure code quality before pushing it to Git. While this is not a requirement, it's encouraged to have `pre-commit` installed with `pip install pre-commit`, and the in this project root, run:\n\n```shell\npre-commit install\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystem76%2Fwarehouse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsystem76%2Fwarehouse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystem76%2Fwarehouse/lists"}