#Bamazon
A Node.js & MySQL command line Amazon-like storefront app that takes in customers orders and depletes stock from the stores Inventory.
#My Videos click here to see Bamazon Live!
- Clone repo
- npm install
- cd Bamazon
- node server.js
- run it locally. Default Port will be PORT 3000 in any browser.
- ENJOY!
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
- Node.js
- Express
- MySQL
- Morgan
- Cli-View
- Aand many others...
-
Database is called
Bamazon
. -
There is a Table inside of that database called
Products
. -
The products table was created with the following columns.
-
ItemID (unique id for each product)
-
ProductName (Name of product)
-
DepartmentName
-
Price (cost to customer)
-
StockQuantity (how much of the product is available in stores)
-
-
I populated the database with 10+ different products.
-
There is 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. -
Bamazon then prompts users with two messages.
- The first ask them the ID of the product they would like to buy.
- The second message should ask how many units of the product they would like to buy.
-
Once an order has been placed the application then checks to see if the store has enough of the product to meet the user's request.
- If not, the app will log:
Insufficient quantity!
, and then prevent the order from going through.
- If not, the app will log:
-
However, if the store does have enough of the product, It will fulfill the users's order.
- This means updating the SQL database to reflect the remaining quantity.
- Once the update goes through, it will show the customer the total cost of their purchase.
-
There is a new Node application called
BamazonManager.js
. Running this application will:-
List a set of menu options:
- View Products for Sale
- View Low Inventory
- Add to Inventory
- Add New Product
-
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
, it will list all items with a 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 currently in the store. -
If a manager selects
Add New Product
, it will allow the manager to add a completely new product to the store.
-
| itemID | ProductName | DepartmentName | Price | StockQuantity |
|--------|-------------|----------------|-------|---------------|
| 01 | MacBookPro | Electronics | 1700 | 1000 |
| 02 | IpadPro | Electronics | 800 | 400 |