A modern, interactive vending machine application built with React, TypeScript, and Tailwind CSS. Features a kiosk-like user experience with cash and card payment options, inventory management, and transaction history.
- 🥤 Product Selection: Browse and select from available drinks
- 💵 Payment Options: Support for both cash and card payments
- 📊 Inventory Management: Admin panel for stock management
- 📜 Transaction History: View all completed transactions
- 🎨 Modern UI: Responsive design optimized for mobile and LCD screens
- ⚡ Real-time Updates: Live inventory and transaction tracking
View the complete user journey and machine state transitions:
- Node.js (v18 or higher recommended)
- npm or yarn package manager
npm installnpm run devThe application will start on http://localhost:5173 (or the next available port).
npm run buildThis will create an optimized production build in the dist directory.
npm run previewnpm run dev– Start the Vite development server with hot module replacementnpm run build– Type-check TypeScript and create an optimized production buildnpm run preview– Preview the production build locallynpm run lint– Run ESLint to check code qualitynpm run test– Execute Vitest unit tests
vending-machine/
├── src/
│ ├── components/ # React components
│ │ ├── ui/ # Reusable UI components (shadcn/ui)
│ ├── data/ # Static data (drinks, inventory)
│ ├── services/ # Business logic (inventory, payment, change)
│ ├── state/ # State management (vending machine logic)
│ ├── types/ # TypeScript type definitions
│ └── App.tsx # Main application component
├── docs/ # Documentation and diagrams
└── public/ # Static assets
- Select a Drink: Click on any available drink from the product grid
- Choose Payment Method: Select either cash or card payment
- Complete Payment:
- Cash: Insert bills (₩1000, ₩5000, ₩10000)
- Card: Tap the "Tap card to authorize" button
- Receive Drink: Wait for dispensing and collect your drink
- Get Change: If paying with cash and change is due, it will be returned automatically
Access the admin panel by clicking the "Admin" button in the footer:
- Stock Management: Set stock levels for each drink
- Transaction History: View all completed transactions with filters
- Framework: React 18 + TypeScript 5
- Build Tool: Vite 5
- Styling: Tailwind CSS 3.4 with shadcn/ui components
- State Management: React Hooks (useReducer, useState)
- Testing: Vitest + Testing Library
- Linting: ESLint (flat config)
- Chrome/Edge (latest)
- Firefox (latest)
- Safari (latest)
- Mobile browsers (iOS Safari, Chrome Mobile)
- The application uses React StrictMode in development, which may cause components to mount twice
- Inventory state persists across component remounts using React refs
- Payment processing is simulated (no actual payment gateway integration)
This project is for educational/demonstration purposes.