{"id":27405006,"url":"https://github.com/maze1377/manager-vending-machine","last_synced_at":"2026-04-24T16:02:54.295Z","repository":{"id":188255550,"uuid":"624751341","full_name":"maze1377/manager-vending-machine","owner":"maze1377","description":"Our project is a vending system managed by a Grpc server written in Golang. It offers easy setup and maintenance, fast and reliable communication, and efficient management of vending operations.","archived":false,"fork":false,"pushed_at":"2023-04-12T12:29:28.000Z","size":143,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T05:49:18.099Z","etag":null,"topics":["centralized","dicen","golang","grpc","grpc-go","management","state-pattern","vending-machine"],"latest_commit_sha":null,"homepage":"","language":"Go","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/maze1377.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}},"created_at":"2023-04-07T07:07:15.000Z","updated_at":"2023-04-07T11:28:49.000Z","dependencies_parsed_at":"2023-08-14T15:22:34.264Z","dependency_job_id":null,"html_url":"https://github.com/maze1377/manager-vending-machine","commit_stats":null,"previous_names":["maze1377/manager-vending-machine"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/maze1377/manager-vending-machine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maze1377%2Fmanager-vending-machine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maze1377%2Fmanager-vending-machine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maze1377%2Fmanager-vending-machine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maze1377%2Fmanager-vending-machine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maze1377","download_url":"https://codeload.github.com/maze1377/manager-vending-machine/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maze1377%2Fmanager-vending-machine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32230421,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"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":["centralized","dicen","golang","grpc","grpc-go","management","state-pattern","vending-machine"],"created_at":"2025-04-14T05:49:00.797Z","updated_at":"2026-04-24T16:02:54.263Z","avatar_url":"https://github.com/maze1377.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Manager Vending Machines\n\nThe Manager Vending Machine is a centrally managed vending system that uses a GRPC server written in Golang. It offers\neasy setup and maintenance, fast and reliable communication, and efficient vending operations management.\n\n### Running Vending Machines\n\nTo test the vending machine, follow these steps:\n\n1- Compile the code:\n\n```bash\nmake dependencies\nmake vendingd\n```\n\n2- Run the vending machine (you can change the config-file and run multiple machines):\n\n```bash\n./vendingd machine -c  local.vending.1.yaml\n./vendingd machine -c  local.vending.2.yaml\n```\n\n3- Run the manager to attach to the machine:\n\n```bash\n./vendingd manager -c local.sample.yaml\n```\n\n4- Send a command by example (uncomment the command type and change it):\n\n```bash\ngo run ./examples/client.go -b localhost:10000\ngo run ./examples/client.go -b localhost:10001\n```\n\n### Testing and Linting\n\nBefore creating a pull request, make sure you run these commands:\n\n```bash\nmake lint-fix \u0026\u0026 make lint-get \u0026\u0026 make lint\nmake test\nmake race\n```\n\n### Running the Project with Docker Compose\n\nTo simplify the process of running our project, we have included a docker-compose.yml file that defines the required\nservices and configurations. To start the project, simply run the following command in your terminal:\n\n```bash\ndocker-compose up\n```\n\nThis will start all the necessary services and dependencies, allowing you to interact with the program.\n\nTo send commands to the program, you can use the client.go file located in the examples directory. Uncomment the command\ntype that you want to use and change the -b flag to the appropriate address.\n\nFor example, to send a command to a server running on localhost port 10000, you would run:\n\n```bash\ngo run ./examples/client.go -b localhost:10000\n```\n\n### Design Patterns and Architecture\n\nThe following design patterns and architecture used for managing a distributed vending machine:\n\n1-Microservices Architecture: A microservices architecture can be used to decompose the vending machine system into\nsmall,\nindependent services that can communicate with each other using APIs. This architecture can improve scalability, fault\ntolerance, and maintainability.\n\n2-Command Design Pattern: The Command design pattern can be used to encapsulate actions taken by the vending machine\nsystem in a command object. Each command can represent a specific action, such as adding an item to the inventory,\nprocessing a payment, or dispensing an item. This pattern can provide a flexible and extensible way to manage the\nvending machine's behavior.\n\n3-Observer Design Pattern: The Observer design pattern can be used to notify the vending machine system when an event\noccurs, such as a payment being processed or an item being dispensed. This pattern can provide a decoupled way to manage\nthe vending machine's behavior and improve maintainability.\n\n4-State Design Pattern: The state pattern can be used to model the different states that a vending machine can be in,\nsuch\nas \"idle,\" \"dispensing,\" and \"payment.\" Each state would be represented by a separate class, and the vending machine\nobject would transition between states as it performs different operations.\n\n5-Domain-Driven Design: Domain-Driven Design (DDD) can be used to model the vending machine system based on its domain\nconcepts, such as items, payments, and dispensing. This approach can help to create a clear understanding of the\nsystem's behavior and requirements and can guide the design of the system's architecture and APIs.\n\n\n6-Load Balancing: Load balancing can be used to distribute the workload across multiple instances of the vending machine\nsystem. This can improve scalability and fault tolerance by ensuring that the system can handle a large number of\nrequests and can recover from failures without affecting the user experience.\n\n7-GRPC Service: GRPC is a communication framework that allows vending machines to communicate with a central server or\nset\nof servers. The GRPC service would define the messages and operations that the server can perform on the vending\ndevices, such as dispensing products and updating inventory.\n\nThese design patterns and architecture can provide a flexible and maintainable way to manage the complex stateful\nsystems of distributed vending machines.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaze1377%2Fmanager-vending-machine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaze1377%2Fmanager-vending-machine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaze1377%2Fmanager-vending-machine/lists"}