Skip to content

gbspecapedra/vending-machine

Repository files navigation

Your Mood Booster Is Waiting — Pick Your Favorite Beverage!

Vending Machine Simulator

GitHub language count GitHub top language GitHub repo size GitHub last commit Github license

💬 Project

An interactive vending machine simulation built with React, TypeScript, Chakra UI, and Vite. Users can insert coins, select real beverages from the Open Food Facts API, and complete purchases with automatic stock updates, change calculation, and refund functionality.

🚀 Live Demo

See live demo - Deployed this project on Vercel.

🧰 Tech Stack

📦 Features

  • 💰 Insert coins: 5¢, 10¢, and 25¢ denominations
  • 🧃 Real-time product selection from external API
  • 🛒 Cart system with item quantity control
  • 📦 Stock management and update after purchase
  • 💵 Automatic change calculation
  • ❌ Cancel purchase with refund and message reset
  • 🧊 Modern glass UI with responsive design
  • 🎯 Only allows purchase when balance ≥ cart total

ℹ️ How To Use

To clone and run this application, you'll need Git, NPM, Node.js >= 23.6.1. From your command line:

# Clone the repository
$ git clone https://github.com/gbspecapedra/vending-machine.git

# Go into the repository
$ cd vending-machine

# Install dependencies
$ npm install

# Run the development server
$ npm run dev

# Navigate to http://localhost:3000
# The app will automatically reload if you change any of the source files.

📌 TODO / Roadmap

  • Display full product info modal
  • Implement audio feedback (coin insert, vending sound)
  • Persist cart in localStorage
  • Unit tests with Vitest

📝 License

This project is under the MIT license. See the LICENSE for more information.


Made with ♥ by Gisele Pecapedra 👋 Get in touch!

About

An interactive vending machine simulation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published