Bamazon is an Amazon-like storefront with the MySQL skills learned this unit. The app will take in orders from customers and deplete stock from the store’s inventory.
Bamazon requires the MySQL and Inquirer npm packages in the homework files–this app utilizes them for data input and storage.
To view screenshots of the bamazon app in use, navigate to ./screenshots and view the .mov file.
bamazon-demo.mov
Bamazon requiers a MySQL Database called bamazon
.
The table in the that database is called products
.
The products table has each of the following columns:
item_id (unique id for each product)
product_name (Name of product)
department_name
price (cost to customer)
stock_quantity (how much of the product is available in stores)
This database is populated with 10 different products corresponding to the ./db/seeds.sql file.
Running the application bamazonCustomer.js
will first display all of the items available for sale. Including the ids, names, and prices of products for sale.
The app then prompts users with two messages.
Once the customer has placed the order, bamazon checks if your store has enough of the product to meet the customer’s request.
Insufficient quantity!
, and then prevent the order from going through.However, if the store does have enough of the product, it will fulfill the customer’s order.