Skip to content

Command line app designed using node.js and MySQL where users can view store inventory and make real time changes based on "purchases".

Notifications You must be signed in to change notification settings

dentechy/CLI-digital-store

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CLI digital store

Introduction

This is a command line application developed to act as a digital store front. Upon execution, it will present the customer with a table of available products in the digital marketplace. The customer then select products based on their ID, specifies a quantity and is then presented with a total and in the process, the app updates the stores inventory to reflect the purchase. The following software is required to successfully execute the app:

  • Unix command line
    • Any Linux distro (e.g. Fedora, Ubuntu, Mint)
    • mac OS
    • Git Bash, cygwin or Bash on Ubuntu on Windows (WSL) should work on Windows
  • Nodejs
  • mysql-server
  • inquirer (npm)
  • mysql (npm)

Walkthrough

  1. Clone the repo to your local computer. Change into the repo directory. Use the command npm install to install the required node packages, inquirer and mysql. Ensure all expected files are present with ls command.

sql-1

  1. Ensure that sql scripts will function as expected.

sql-2

sql-3

  1. Enter the mysql command line interface using mysql -u root -p. Be sure to enter the password set up for root user of mysql.

sql-4

  1. Create the database "Bamazon" and populate a table with entries using these commands:
  • SOURCE Bamazon.sql; (creates database and table)

sql-5

  • SOURCE 10products.sql; (populates table with 10 products)

sql-6

  1. Check that table exists using the command SELECT * FROM products

sql-7

  1. Exit mysql command line with CTRL + D.

  2. Use nodejs to execute the bamazonCustomer.js file. The store directory will be presented as an array of objects. The relevant command is node bamazonCustomer.js.

sql-8

  1. Continue through the prompts. At the last prompt, the customer is presented with the total price and the inventory is updated accordingly.

sql-9

sql-10

sql-11

  1. Note that the program will not proceed if an invalid ID is entered or there is insufficient stock.

sql-12

sql-13

About

Command line app designed using node.js and MySQL where users can view store inventory and make real time changes based on "purchases".

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published