GithubHelp home page GithubHelp logo

bhagya88 / bamazon Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 41.9 MB

A console application which is like Amazon like store developed using - Node JS and MySQL. Demo- - https://github.com/bhagya88/bamazon/tree/master/demo

JavaScript 100.00%

bamazon's Introduction

#Bamazon

Overview

Amazon like storefront where customers can purchase products. The app will take in orders from customers and depletes stock from the store's inventory. It also tracks product sales across the store's departments and then provides a summary of the highest-grossing departments in the store.

Demo

click to find demo on github

Technologies used

  • Node.js
  • Inquirer module
  • Mysql module
  • console.table module
  • MYSQL - database

Challenges faced

  • How to put together all the asynchronous functions and make them work?

Solutions found

  • Understanding how promises work and how to use recursive functions helped solve the problem.

How it works

The app has 3 views. Customer View, Manager view and Executive view.

1. Customer view - BamazonCustomer.js

  • Running this application will display all of the items available for sale. Include the ids, names, and prices of products for sale.

  • Then app prompts users with two messages.

    • The first asks them the ID of the product they would like to buy.
    • The second message asks them how many units of the product they would like to buy.
  • Once the customer has placed the order, the application checks if the store has enough of the product to meet the customer's request.

    • If not, the app logs the phrase Insufficient quantity!, and then prevents the order from going through.
  • However, if the store does have enough of the product, application fulfills the customer's order.

    • This means updating the SQL database to reflect the remaining quantity.
    • Once the update goes through, it shows the customer the total cost of their purchase.

2. Manager View - BamazonManager.js

  • Running this application will:

    • List a set of menu options:

      • View Products for Sale
      • View Low Inventory
      • Add to Inventory
      • Add New Product
    • If a manager selects View Products for Sale, the app lists every available item: the item IDs, names, prices, and quantities.

    • If a manager selects View Low Inventory, then it lists all items with a inventory count lower than five.

    • If a manager selects Add to Inventory, your app displays a prompt that will let the manager "add more" of any item currently in the store.

    • If a manager selects Add New Product, it allows the manager to add a completely new product to the store.

3. Executive View - BamazonExecutive.js

  • Running this application will list a set of menu options:

    • View Product Sales by Department
    • Create New Department
  • When an executive selects View Product Sales by Department, the app displays a summarized table in their terminal/bash window.

  • The totalProfit is calculated on the fly using the difference between overheadCosts and totalSales. totalProfit is not stored in the database. totalProfit is a custom alias for (totalSales-overHeadCosts).

Developed by Bhagya

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.