Bamazon is an Amazon-like storefront with the MySQL database. The app will take in orders from customers and deplete stock from the store's inventory. You can program your app to track product sales across your store's departments and then provide a summary of the highest-grossing departments in the store. It is a command line app that takes in parameters and gives you back data. The app receive user input using the maysql
, inquirer
, chalk
, figlet
and boxen
npm packages.
👉 Click >>>Here<<< Check my 📺 video to see how it works.
Bamazon is composed with three apps.
* Bamazon customer app
* Bamazon manager app
* Bamazon supervisor app
-
A MySQL Database called
bamazon
. -
A Table inside of that database called
products
. -
The products table have 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)
-
A Node application called
bamazonCustomer.js
. Running this application will first display all of the items available for sale. Include the ids, names, and prices of products for sale. -
The app will then prompt users with two messages.
-
Once the customer has placed the order, Bamazon will check if the store has enough of the product to meet the customer's request.
-
If the store does have enough of the product, Bamazon will fulfill the customer's order.
-
A Node application called
bamazonManager.js
. Running this application will:-
List a set of menu options:
-
If a manager selects
View Products for Sale
, the app will list every available item: the item IDs, names, prices, and quantities. -
If a manager selects
View Low Inventory
, then it will list all items with an inventory count lower than five. -
If a manager selects
Add to Inventory
, it will display a prompt that will let the manager "add more" of any item in the store. -
If a manager selects
Add New Product
, it will allow the manager to add a completely new product to the store.
-
-
A MySQL table called
departments
includes the following columns: -
When a customer purchases anything from the store, the price of the product multiplied by the quantity purchased is added to the product's product_sales column.
-
Another Node app called
bamazonSupervisor.js
. Running this application will list a set of menu options:- View Product Sales by Department
- Create New Department
-
When a supervisor selects
View Product Sales by Department
, the app will display a summarized table in their terminal/bash window.
department_id | department_name | over_head_costs | product_sales | total_profit |
---|---|---|---|---|
01 | Electronics | 10000 | 20000 | 10000 |
02 | Clothing | 60000 | 100000 | 40000 |
- The
total_profit
column is calculated on the fly using the difference betweenover_head_costs
andproduct_sales
.total_profit
won't be stored in any database.
Isaac Wu © 2019 All Rights Reserved