Code Monkey home page Code Monkey logo

pantry-clone's Introduction

pantry-clone

Getting Started

  • Clone this git repository to your local machine.
  • Run npm install inside the project directory.
  • Run node index.js to run the Node.js server.

The APIs are now ready to be used.

Postman Collection

The sample Postman collection for the executed APIs is linked here.

APIs

  • SYSTEM
    -- Get Active Users (GET)
  • PANTRY
    -- Create New Pantry (POST)
    -- Get Pantry Details (GET)
  • BASKET
    -- Create New Basket (POST)
    -- Get Basket Details (GET)
    -- Update Basket (PUT)
    -- Delete Basket (DELETE)

SYSTEM

  • Get Active Users (GET)

    • Get the total number of registered active users.
    • Send a GET request to http://localhost:3000/system/status

PANTRY

  • Create New Pantry (POST)

    • Given your email address (CONTACT_EMAIL) and your desired pantry name (PANTRY_NAME), create a new pantry.

    • The request body looks something like this:

      {
      	name: PANTRY_NAME,
      	contactEmail: CONTACT_EMAIL,
      }
      
    • Send a POST request to http://localhost:3000/pantry/create with the above body.

  • Get Pantry Details (GET)

    • Given a PANTRY_ID, return the details of the pantry, including a list of baskets currently stored inside it.
    • Send a GET request to http://localhost:3000/pantry/PANTRY_ID.

BASKET

  • Create New Basket (POST)

    • Create a new basket for your existing pantry to store data.
    • Your request body should look something like this:
      {
      	data: YOUR_JSON_DATA_TO_BE_STORED
      }
      
    • Send a POST request to http://localhost:3000/pantry/PANTRY_ID/basket/BASKET_NAME, with the above mentioned body.
  • Get Basket Details (GET)

    • Provided your PantryID and BasketName, get data stored in that basket.
    • Send a GET request to http://localhost:3000/pantry/PANTRY_ID/basket/BASKET_NAME
  • Update Basket (PUT)

    • To update the data stored in a particular basket.
    • Your request body should look something like this:
      {
      	data: UPDATED_JSON_DATA_TO_BE_STORED
      }
      
    • Send a PUT request to http://localhost:3000/pantry/PANTRY_ID/basket/BASKET_NAME, with the above mentioned body.
  • Delete Basket (DELETE)

    • To delete any existing basket.
    • Send a DELETE request to http://localhost:3000/pantry/PANTRY_ID/basket/BASKET_NAME

pantry-clone's People

Contributors

anasharps avatar

Watchers

 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.