This is a node application to:
- view and maintain product and department information
- view and maintain product and department information
- allow customer to place orders for products
- Node.js must be installed (https://nodejs.org/en/download/)
- MySQL must be installed. At a minimum, the free Community Edition must be present (https://www.mysql.com/downloads/)
- A MySQL developer tool such as MySQL Workbench or Sequel Pro (https://dev.mysql.com/downloads/workbench/) is needed to create and seed the database
- Clone repository bamazon using the code -> git clone https://github.com/markpython86/bamazon.git bamazon
- Open a terminal session for the directory where the application was cloned to
- run npm install to install the dependencies
- Use the bamazaon.sql file to create the databases in MySQL
There are 3 js files that can be run from a terminal session. Details on executing each of these is found in sections below.
node BamazonCustomer.js
- Purchase items and create an order
node BamazonManager.js
- View products
- View products with low inventory
- Add Inventory to a Product
- Add a Product
- Delete Product
node BamazonSupevisor.js
- View Product sales by Department
- Add a Department
- You must be in a terminal session for the directory that contains the application
- Use the up/down arrow keys to navigate thru options and lists
- Select an option or list item by pressing Enter or Return
- The options and lists generally have an Exit item that can be selected to exit the application
- Ctrl+c for windows or Command+c for Mac can be used to exit the application at any time
- run node bamazonCustomer.js from a terminal session in the application directory
- A list of products is presented
- Select a product id to order
- Once a product is selected, reply to the prompt with the quantity to order
- A reply is provided indicating if the order is created or if there is not enough inventory
- Reply to the prompt to continue with another order or to exit the application
- run node bamazonManager.js from a terminal session in the application directory
- Six options are presented
- View products
- A list of all products and details is presented
- View products with low inventory
- Reply to the prompt with a quantity value
- A list is presented of all products with a stock quantity less than the quantity requested
- Add Inventory to a Product
- Rely to the prompts to provide a product item number and the additional inventory
- The product item number must exist
- Add a Product
- Rely to the prompts with the requested product information
- A product item number is automatically generated
- Product name must be unique
- Delete a product
- Rely to the prompts with the requested
- Pick the item ID that want to be deleted
- Table will be displayed after update
- Exit
- Terminate the Program
View products
View products with low inventory
Add Inventory to a Product
Add a Product
- run node bamazonSupevisor.js from a terminal session in the application directory
- Two options are presented
- View Product sales by Department
- A list of product sales and profits for each department is presented
- Add a Department
- Rely to the prompts with the requested department information
- A department item number is automatically generated
- Department name must be unique
View Product sales by Department
Add a Department
- MySQL is used as the database
- Details for the database, tables and users can be found in the *.sql files
- cli-table provides formatting to display list data in a table (https://www.npmjs.com/package/cli-table)
- inquirer provides framework for user prompts (https://www.npmjs.com/package/inquirer)
- mysql provides connection to MySQL database (https://www.npmjs.com/package/node-mysql)