Command-line storefront application integrating a MySQL database
A command-line storefront application integrating a MySQL database to track and update stock quantities of available products. Friendly messages alert the customer key information about their transactions.
MySQL, Node.js, JavaScript, and the packages NPM MySQL, Inquirer, Colors.js & CLI-Table
- Check for sufficient stock level before completing purchase process
- Table view of products for sale
Video of application in action
- View of successfully processed order (entire process)
- User types 'node bamazonCustomer.js' to initialize the program
- Table displays available products by their id, product name, and retail price
- User is prompted to enter an id and qty of an item they wish to purchase
- Items and quantity the user selected are logged
- A function is triggered to check if there's enough stock of the item to complete the purchase
- If there is enough stock on hand, a "success" message is logged
- Next, a "receipt" is generated, totaling the cost of the items and thanking the user
- When the quantity is successfully deducted from the database, "order successful" logs
- Finally a new prompt asks the user if they'd like to continue shopping
- Confirming "yes" triggers the product display table and initial purchase prompts
- If the user enters a quantity that is out of stock, a message is logged that the "order cannot be fulfilled"
- The product display table is triggered again
- After another successful order, the user is again asked if they'd like to continue shopping
- Confirming "no" logs a message to "have a great day"
- The quantity of items from the examples have been deducted successfully
Thanks for reading. Happy shopping!