This is a command-line Node.js and MySQL app for buying and tracking retail inventory for an aircraft parts and supplies store.
These must be installed to access the store:
You need to make your own copy of the MySQL database to run this app. Use retail-seeds.sql
to create an initial database. Then, in retail-customer.js
and retail-manager.js
, enter the connection information and credentials to your database.
This app provides a view into the store database from the perspective of both customers and store managers.
Note: You may need to widen your terminal window to see the entire table properly formatted.
As a customer, you can view information about available products and purchase items in stock.
In a terminal window, navigate into the folder where you downloaded this app, and type npm install
. Then, type node retail-customer.js
.
You will see a table of the current products available for purchase, which represents the data stored in a MySQL database. Following the prompts, type the item number of the product you want to buy and the quantity.
If there is enough inventory available in the store, you can buy the product and see your total cost. The quantity in the database is updated to reflect your purchase.
Unfortunately, if the store does not have enough of the item to fill your order, your purchase will be declined.
You can type Q
to leave the store at any prompt.
As a manager, you can view the current inventory, see which products are low in stock, and add new products to the store database.
In a terminal window, navigate into the folder where you downloaded this app and type node retail-manager.js
.
Use the arrow keys to navigate the menu of administrative options.
- JavaScript
- Node.js
- npm, including inquirer, node-mysql, cli-table2 and chalk packages