bamazon is a command line Node.js / mySQL "Amazon-like" storefront app.
This CLI app will take in orders from customers and deplete stock from the store's inventory, track product sales across the store's departments and provide a summary of the sales, over-head expenses and profits of each of the store's departments.
The app uses a node.js driver for mysql to establish a connection to the database and utilize SQL queries to perform CRUD operations in the database.
Prerequisites:
- mySQL server
- Node.js and NPM (package manager)
Before running the app, you will have to use the npm install
command from the command-line to install the required packages (using the package.json file).
Make sure your MySQL server is up and running in the background -> from the mysql console (mysql -u root
), run the command source schema.sql
to build our SQL schema.
Run the following commands:
node bamazonCustomer.js
- for the Customer view.
node bamazonManager.js
- for the Manager view.
node bamazonSupervisor.js
- for the Supervisor view.
This app was built using Node.js, mySQL (database) and the following NPM packages: inquirer, mysql, cli-table,colors.
Below are examples of the different store views: (click on the image for the full video)
The Deprecation Warnings in the examples are from the current mysql module (v2.15.0) deprecated methods in node v10.5.0.