Giter VIP home page Giter VIP logo

bamazon's Introduction

bamazon

A mySQL/node.js app for manipulating a basic database. It consists of a SQL schema and seed files for initializing and adding to the database, and several node.js files for actually working with it from the command line.

  1. Requirements and Installation
  2. How to Use
    1. Customer Interface
    2. Manager Interface
    3. Supervisor Interface
  3. How It Works
  4. About

Requirements and Installation

Bamazon is a node.js and mySQL application. Go to their sites and read their documentation for help installing and configuring these applications.

Bamazon is currently configured to look for localhost:3306 and log in as root with no password.

You may need to run the following query on your database to get bamazon running:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY ''

Once you have mySQL running, use the included bamazon-schema and bamazon-seed files to create and populate the bamazon database.

In addition to node.js, there are several node packages required by bamazon: mysql, inquirer, cli-table2. The included package.json file allows you to install them all at once by simply running npm install from the command-line in the bamazon directory.

How to Use

Customer Interface

The Customer Interface allows the user to purchase a product from the bamazon storefront, in the form of a command-line table.

Invoke the customer interface with:

node bamazonCustomer.js

The opening menu describes each of the functions of the Customer Interface. Both View Catalog and Make Purchase will display the product catalog, but the former will ask if one wants to make a purchase and the latter will simply begin the purchase process.

See the Demo

Manager Interface

The Manager Interface allows the user to view products and their sales, check low inventory, add inventory, and add new items.

Invoke the manager interface with:

node bamazonManager.js

You will then be presented with a main menu of various functions to choose from. Add to Inventory is identical to View Products for Sale except it directly prompts the user to add inventory, rather than directing them back to the main menu first.

See the Demo

Supervisor Interface

The Supervisor Interface allows the user to view sales departments, see departmental costs, sales, and profits, and add new departments.

Invoke the supervisor interface with:

node bamazonSupervisor.js

You will then be presented with the now familiar main menu of funtions implemented by this interface.

See the Demo

How It Works

Bamazon consists of three node.js files each configured to request data from a running SQL server, currently configured to look for localhost:3306. Each application guides the user–playing the role of either a cusomer, manager, or supervisor–through a series of fictional transactions and data requests.

Each file interacts with a mySQL database using the mysql npm package, which is responsible for making the connection to the database, and sending and recieving data from it in the form of queries.

Queries take several forms. Most commonly, a query is used to display records from the database to the command line. The actual tables are made with the cli-table2 npm package, which is responsible for defining the Table objects the data got inserted into. Additionally, queries add and update the information in each database table when the "customer" makes a "purchase" or when the "manager" updates the "inventory" or adds a new "product."

Another, less obvious query, happens in the Manager Interface when adding a new product. A query is made to create an array which is used by the inquirer npm package to populate a choice list to ensure the user cannot add a new product to a department that doesn't exist.

About

Bamazon is the result of an assignment for the U of M Full Stack Web Development Boot Camp. It was written entirely by me Tom Christ.

bamazon's People

Contributors

kiselblat 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.