Bamazon is a CLI based storefront running on Node.js.
The app runs in a CLI or Terminal, and uses MySQL as its datastore. The program itself is organized into modules separating database, table, and main program functions.
Running this app requires Node.js and MySQL to be installed on your system.
- Clone this repository to your local machine
- Run
npm install
to install the required modules - Create a
.env
file in the root directory of the project, and supply the following variables:DB_HOST
-- The host of your MySQL databaseDB_USER
-- MySQL usernameDB_PASS
-- MySQL password
- Run the
schema.sql
andseeds.sql
(optional) scripts in your database. These will ensure the schema is in place. - Now you are ready to run the app, using one of:
bamazonCustomer.js
bamazonManager.js
bamazonSupervisor.js
The customer interface lets you choose and item to purchase, and the quantity of said item.
Manager has four different functions:
-
View Products For Sale
- This displays a table in the terminal with all products listed (same as in the Customer section)
-
View Low Inventory
- Displays a table of any item in which less than 5 remain in stock.
-
Add to Inventory
- Allows you to increase the remaining stock of any item
-
Add New Product
- Provides the interface for adding an entirely new item to inventory
Supervisor has two functions:
-
View Product Sale By Department
- Prints a table to the terminal showing all departments, their overhead costs, total product sales, and total profit
-
Create New Department
- Allows the creation of a new department
Built With
For future work, I would like to make better use of Promise
s in the db
module. The purpose would be to explicitly send data to the tables
module from the main files, as opposed to forcing tables to be printed direct from the db
module.
- Developed By: Will Parks -- wparks08