Code Monkey home page Code Monkey logo

bamazon's Introduction

bAmazon | Amazon-like storefront:

This is a CLI application that takes in orders from customers and depletes stock from the store's inventory.

Basic app Functionality

  • The App will prompt users/customers with two messages.
  • The first message will prompt customers to enter the item_id of the product they would like to buy.
  • The second message will ask how many units of the product they would like to buy.
  • Once the customer has placed their order, the application will check if bamazon store has enough of the product in stock to meet the customer's request.
  • If not, the app will log a phrase like insufficient quantity!, and then prevent their order from going through.

App Requirements

NPM Pkgs Installed Package Uses
console.table Adds console.table method for convenience
inquirer A collection of common interactive command line user interfaces
mysql This is a node.js driver for mysql. It is written in JavaScript, does not require compiling, and is 100% MIT licensed

Running bamazon Application

  1. To see bamazon's full product inventory, you will need to type mysql -u root or mysql -u root -p to access mysql in GitBash/Terminal.

    Next, type the following commands in this order:

      1. show databases;
      1. use bamazon_db;
      1. show tables;
      1. select * from products;

    Products Inventory

    Type exit and press enter to exit mysql.

  2. To run this application, type this in your GitBash/Terminal node bamazonCustomer.js and press enter.

    • Once an item's stock has been depleted, it will be (removed) from the customer's view, you should see the products table displayed with available items; just like you see below:

    Available Inventory

    • Notice that (item_id 7) had a quantity of zero and has been (removed from the customer's view) because this item is no longer available.
  3. Customer will be prompted with two questions to make an item selection then enter the quantity they would like to buy.

    If customer makes an invalid entry, they will be prompted to make a valid selection:

    Insufficient Quantity

  4. When customer makes a valid selection, their order total will be displayed like this:

    Order Total

  5. bamazon inventory will also be updated to reflect new available stock.

    Inventory Updated

  6. Customers can now place another order until all inventory has been depleted.

THANK YOU FOR SHOPPING WITH BAMAZON!!

bamazon's People

Contributors

kyoukel avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.