bamazon is a proof of concept Node.js command line warehouse/inventory app using MySQL, Inquirer, and Easy-Table npm packages
bamazon breaks down into 3 views:
- bamazonCustomer.js
- bamazonManager.js
- bamazonSupervisor.js
To use:
- Download
- Type "npm i" in your command line
- this will install the dependencies - MySQL, Easy-Table, and Inquirer npm packages
var connection = mysql.createConnection({
host: "localhost",
port: 3306,
user: "root",
password: "root",
database: "bamazonDB"
})
- Create a MySQL server with the above credentials or edit to match your own
- run the SQL code in app.sql (I ran it in MySQL workbench)
node bamazonCustomer.js
to run the views!
node bamazonCustomer.js
The customer view displays all of the products, their departments, prices and quantity
Enter the item number of what you want to buy, and how many you're purchasing and the app will update the stock quantity, and tell you your total.
Behind the scenes this is updating the 'Product Sales' column in a department SQL table, for use in upper level views
node bamazonManager.js
The manager view allows you to:
- View Products for Sale
- Same as in customer view
- View Low Inventory
- Add to Inventory
- Add New Product
node bamazonSupervisor.js
This allows the highest level of function, the supervisor can:
- View Sales by Department
- Create New Department