gitwtfhub

wtf is mvp-vending-machine?

dagnarus15/mvp-vending-machine — explained in plain English

Analysis updated 2026-08-08 · repo last pushed 2021-10-27

JavaAudience · developerComplexity · 2/5DormantSetup · easy

TL;DR

A REST API backend for a vending machine where sellers manage products and buyers deposit coins and make purchases through HTTP requests. Built as a coding exercise to practice API design, money handling, and role-based access control.

Mindmap

mindmap
  root((repo))
    What it does
      Create users and products
      Deposit coins and buy
      Returns change in coins
    Tech stack
      Java
      REST API
      JSON
    Use cases
      Practice API design
      Learn backend logic
      Interview prep
    Audience
      Beginners learning APIs
      Developers practicing
    Features
      Sellers manage products
      Buyers deposit coins
      Basic auth security
    Known Issues
      User update broken
      No password changes

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Practice backend API design by studying how vending machine endpoints interact with each other.

REASON 2

Learn role-based access control by reviewing how sellers and buyers have different permissions.

REASON 3

Use as a coding exercise to think through edge cases like insufficient funds and out-of-stock products.

REASON 4

Study how to handle money and make change using fixed coin denominations in an API.

What's in the stack?

JavaREST APIJSON

How it stacks up

dagnarus15/mvp-vending-machine0verflowme/intech-solabhishek-kumar09/configurate
LanguageJavaJavaJava
Last pushed2021-10-272022-11-162020-09-30
MaintenanceDormantDormantDormant
Setup difficultyeasyhardeasy
Complexity2/51/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 30min

Java backend project requiring compilation and a local server start, plus a tool like curl or Postman to send HTTP requests.

No license information is provided in this repository.

Wtf does this do

This repository is a simple vending machine backend built as a pure REST API. It lets you create users, add products, deposit coins, and make purchases entirely through HTTP requests that send and receive JSON data. There is no user interface, everything is handled by API calls, making it a straightforward project for learning how backend logic works. The system has two types of users: sellers and buyers. Sellers can create, update, and delete products, specifying a name, cost, and how many are in stock. Buyers can deposit coins in denominations of 5, 10, 20, 50, or 100 cents, then spend that deposit on available products. When a buyer makes a purchase, the API returns the total spent, the products bought, and any change owed, broken down into the same coin denominations. Buyers can also reset their deposit balance without buying anything if they change their mind. Authentication is handled with basic auth on every request, meaning there are no login sessions to manage. Anyone can view products without logging in, but only the seller who created a product can modify or delete it. Creating a new user account is also open to anyone. The README notes a couple of known issues: updating users doesn't work properly, and there's no way to change a username or password once an account exists. This project is a good fit for someone practicing backend API design or working through a coding exercise that involves role-based access control, money handling, and edge-case thinking. A beginner learning how APIs work could use it to understand how different endpoints interact, while a developer reviewing it might focus on how it handles things like insufficient funds, out-of-stock products, or permission checks. The README explicitly asks the reader to think through edge cases and access issues, suggesting this was built as a skills demonstration or interview-style project.

Yoink these prompts

Prompt 1
Set up this vending machine API locally and create one seller user and one buyer user, then have the buyer deposit 100 cents and buy a product to see the change calculation in the JSON response.
Prompt 2
Review the API code and explain how it enforces that only the seller who created a product can modify or delete it, using basic auth on every request.
Prompt 3
Write test cases for edge cases in this vending machine API: buyer tries to buy with insufficient deposit, buyer tries to buy out-of-stock product, and a buyer tries to access seller-only endpoints.
Prompt 4
Fix the known issue where updating users doesn't work properly, and add the ability to change a username or password after account creation.
Prompt 5
Create a simple script that walks through the full vending machine flow: create a seller, add a product, create a buyer, deposit coins, buy the product, and reset the deposit.

Frequently asked questions

wtf is mvp-vending-machine?

A REST API backend for a vending machine where sellers manage products and buyers deposit coins and make purchases through HTTP requests. Built as a coding exercise to practice API design, money handling, and role-based access control.

What language is mvp-vending-machine written in?

Mainly Java. The stack also includes Java, REST API, JSON.

Is mvp-vending-machine actively maintained?

Dormant — no commits in 2+ years (last push 2021-10-27).

What license does mvp-vending-machine use?

No license information is provided in this repository.

How hard is mvp-vending-machine to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is mvp-vending-machine for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.