git clone https://github.com/VivianChan1998/QRcode-Vending-Machine.git
cd QRcode-Vending-Machine/
npm install
npm start
enter localhost:3000/
in browser
Front end: React.js Back end: Express.js RPi and Arduino Code
- By pressing
order!
button, front end sends a request to server, including a specified uuid and item ID. - Server saves the uuid in database, and generates a QRcode that includes the GET request(including the uuid in QRcode).
- Server sends the QRcode to Front end.
- User scans the QR-code at the machine.
- The vending machine sends the url in the QRcode to the server.
- Server compares what it reserved with the database, to assure the order exists.
- Server tells the machine if the order exists or not, which item id it is, and dispense the item.