Using MySQL & Node.js, bamazon is an Amazon-like CLI app that takes orders from customers and depletes stock from the store's inventory as valid.
-
Running
node bamazonCustomer.js
in the terminal will first display all of the items available for sale, including ids, names, and prices. -
The app then prompts users with two messages:
- The first asks them the ID of the product they would like to buy.
- The second message asks how many units of the product they would like to buy.
-
Once the customer has placed the order, the app will check for a valid product ID and if the store has enough of the product to meet the customer's request.
- If the product ID does not exist or if there is not enough quantity of a product, the app prevents the order from going through and prompts the customer to try again.
-
If an order is successful, the customer receives a receipt for the item and quantity purchased and the total cost.
-
the storefront will reflect the updated remaining quantity upon the next potential purchase.
- JavaScript - High-level programming language.
- MAMP - Local server environment.
- MySQL Workbench - Visual database design tool that integrates SQL development, administration, database design, creation and maintenance into a single integrated development environment for the MySQL database system.
- Node.js - Open-source run-time environment that executes JS code outside of a browser.
- Visual Studio Code - Source code editor developed by Microsoft.
- Pauline S. - paulinegithub