{"id":20543961,"url":"https://github.com/drewmoore/vending","last_synced_at":"2026-04-16T21:06:50.010Z","repository":{"id":78372614,"uuid":"23092016","full_name":"drewmoore/vending","owner":"drewmoore","description":null,"archived":false,"fork":false,"pushed_at":"2014-08-20T18:53:48.000Z","size":12412,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-16T15:37:13.103Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/drewmoore.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}},"created_at":"2014-08-19T01:09:18.000Z","updated_at":"2020-03-16T10:06:16.000Z","dependencies_parsed_at":"2023-02-25T00:15:18.095Z","dependency_job_id":null,"html_url":"https://github.com/drewmoore/vending","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drewmoore%2Fvending","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drewmoore%2Fvending/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drewmoore%2Fvending/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drewmoore%2Fvending/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drewmoore","download_url":"https://codeload.github.com/drewmoore/vending/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242150748,"owners_count":20080006,"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":[],"created_at":"2024-11-16T01:41:49.218Z","updated_at":"2026-04-16T21:06:44.977Z","avatar_url":"https://github.com/drewmoore.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Vend It Up!\n===========\n\nIf only it were the real thing...\n---------------------------------\nThis is an app that mimics the behavior of a standard drink vending machine. A user can put money in, select a drink, and get change.\nThe database keeps count of all beverages, quantities of money by denomination, and a detailed transaction log that includes the time of each\npurchase as well as records of the exact types and numbers of coins dispensed as change. The app starts of as a clean slate, allowing a user\nto add their own beverage products and corresponding logos as well as a front-panel image for the user interface. A user can change the number\nof beverages and currency denominations at any time, and the user can reset the transaction log as well.\n\n\nVend It Up! uses the speed of Node's non-blocking, asyncronous mechanisms combined with the flexibility and ease of MongoDB. The front-end\nframework utilized is Zurb's Foundation.\n\nDeployment Instructions:\n------------------------\n\n+ Run `git clone https://github.com/drewmoore/vending`.\n+ If you don't already have Vagrant installed, run `sudo apt-get install vagrant` (Requires VirtualBox), or whatever command your linux distro uses.\n+ Run `vagrant box add hashicorp/precise64 http://files.vagrantup.com/precise64.box`.\n+ Run `vagrant up`.\n\n+ Vagrant's virtual box will download and install the necessary repositories and run the test suite.\n+ When the Node server is running, load `http://127.0.0.1:4567/` into your browser.\n\nUsing the App\n-------------\nOnce you have installed the app and have it running, if you load the home page for the first time, it will prompt you to create a new machine\ninstance with its own price and front image. It is recommended to use as large an image as possible in a portrait orientation. Next, you will be\nprompted to add at least one beverage with a corresponding logo image and a specified quantity to stock.\nThis start-up process will lead you to the new homepage, featuring your brand new vending machine with a button for your brand new beverage.\nWhat's that? You want more beverages to choose from? Well, you're in luck, because the site comes equiped with a navigation bar at the top of\nthe page. Simply click 'New Beverage,' and repeat the process from earlier. The machine has six slots for beverages and will return an error\nmessage if you attempt to add more. If you wish to change the quantity or logo image for a beverage or swap the beverage with a new one, click\n'Change Beverages' in the navigation bar.\n\n\nYou can also edit the numbers of coins of a given denomination, empty all paper bills, and change the machine's front-panel image by clicking\n'Administer Machine.'\n\n\nVend It Up! keeps detailed records of all transactions. If you simply wish to view a summary of the current state of the machine, click on\n'Summary' in the navigation bar. If you're not into the whole brevity thing, click on 'Records' to see a detailed transaction log with the\nvalues of all currency denominations in the machine. It will also break down the quantity of each beverage product that is stocked. You can\nperuse the detailed transaction history, or click a button to reset it.\n\n\nAPI Documentation\n-----------------\nIf you're the type that likes to pop open the hood and tinker around, here's a little primer on the app's client-server communications.\nTo create a machine instance, post to `/machines/create`. The only data necessary are a `price` and `imageFile`. To edit the machine's price\nand image, post to `/machines/update/:id` with the id being the machine's database ID. Again, all that is needed is a `price` and `imageFile`.\n\n\nTo add a new beverage product, post to `/beverageTypes/create` with a `name`, `quantity`, and `imageFile` as properties of the request body.\nIf you want to swap a beverage product, change its image, or change its quantity, post to `/beverageTypes/update`. You will need to send a\n`beverageId`, which is the database ID for the beverage product. You can supply an optional `name` property if you want to swap out the beverage.\nThe name provided will be the new product name for that slot. You can provide an optional `imageFile` if you wish to change the logo. A\n`quantity` is required, but it does not have to be different from the beverage's current quantity.\n\n\nIf you wish to manage the level of change in the machine, you can post to `/currencies/update`. The request body must include a quantity for\neach denomination the machine accepts, i.e.: `nickel: 3`, `quarter: 20`, `dime: 0`, `dollarCoin: 0`, `dollarBill:0`, and `fiveDollarBill:2`.\nThe quantity can be the same as the current quantity, but it must not be left undefined.\n\n\nTo utilize the machine's 'coin return' button, which gives you change without vending a product, the route you would want is\n`/machines/return-coins`. The data to send is an object with it's properties being all currencies going in and their quantity. For example:\n`.currencies.quarter: 3`. Again, all denominations must be represented, even if the quantity is 0. The server will send back three objects:\n`coinsDispensed`, `totalChange`, and `stateOfMachine`. Examples:\n`coinsDispensed.quarter.name: 'quarter';`\n`coinsDispensed.quarter.count: 2;`\n`totalChange: .5;`\n`stateOfMachine.inService: true;`\n\n\nTo make a purchase, post to `/machines/make-purchase`. Include the `machineId` and `beverageTypeId` in the body, as well as the total `value` of all the money\ngoing in. Also inclue each currency and quantity. Examples:\n`machineId: 12345;`\n`beverageTypeId: 12345;`\n`value: 1.25;`\n`quarter: 1;`\n`dollarCoin: 1;`\n\n\nFinally, if you wish to erase the transaction history, simply post to `/transactions/reset`.\n\nEnjoy!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrewmoore%2Fvending","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrewmoore%2Fvending","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrewmoore%2Fvending/lists"}