Git Product home page Git Product logo

miskaa's Introduction

ShoppingCart Rest Api

A Shopping Cart using REST API in python with flask and mongoDB, performs CRUD(Create, Read, Update and Delete) operations on a cart.

Steps to be follow:

  • MongoDB : To create and maintain database
  • Postman App : To make requests to API from client side
  • Python(3.7) or (any python3 version): To create the API

Download and Install Required tools

Required packages for python

  • flask : To work with flask framework in python
  • pymongo : To work with MongoDB database from python

Operations that can be performed with API

  • Create and/or Add items to cart
  • Get items in cart
  • Update price, quantity for item in cart
  • Remove specific item from cart
  • Empty cart

Explaination about different operations

Create and/or Add items to cart :

By performing this operation, if the collection/table doesn't exist in MongoDB, than it will create the collection and add item to the cart, else if the collection already exists, then it will add item to existig cart.

  • EndPoint : localhost:5000/carts
  • Methods : POST
  • form_data : "name", "price", "quantity"
Get items in cart :

This operation allow you to get all the items present in the cart

  • EndPoint : localhost:5000/carts
  • Methods : GET
Update price/quantity of item in cart
  • This operation allow you to update name of item present in the cart by providing item id.
  • EndPoint : localhost:5000/carts/name/{item_id}
  • Methods : PUT
  • form_data : "price", "quantity"
Remove specific item from cart
  • This operation allows you to remove specific item from cart by providing its item id.
  • EndPoint : localhost:5000/carts/{item_id}
  • Methods : DELETE
Empty Cart
  • This operation allows you to empty your cart by removing all items in the cart.
  • EndPoint : localhost:5000/carts
  • Methods : DELETE

miskaa's People

Contributors

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