Giter VIP home page Giter VIP logo

gdsc-web-dev-task-2's Introduction

GDSC Web Dev Task (Backend Development)

This GitHub repository is my (Manan Gandhi's) submission for the GDSC Web Dev Task 2. The goal of the task was to develop an Inventory Management System. I have accomplished this task using the Flask framework in Python.

Technologies Used

  • Python
  • Flask
  • Flask-PyMongo
  • MongoDB (Instance hosted on MongoDB Atlas)
  • aspose-pdf (for generating PDF files)
  • Postman (for testing the API)
  • MongoDB Compass (for viewing the database)

Item class and routes

Attributes

  • id: Unique identifier for the item
  • name: Name of the item
  • stock: Number of items in stock
  • price: Price of the item

Routes

  • GET /get_all_items: Returns a list of all items in the inventory

    • Parameters - None Get All Items
  • GET /get_item?id={item_id}: Returns the item with the given id

    • Parameters - id (int) Get Item 1
  • POST /add_item: Adds a new item to the inventory

    • Parameters - name (str), stock (int), price (float) Add Item
  • PUT /update_item: Updates the item with the given id

    • Parameters - id (int), name (str), stock (int), price (float) (at least one of these parameters must be provided) Update Item
  • DELETE /delete_item?id={item_id}: Deletes the item with the given id

    • Parameters - id (int) Delete Item

Invoice class and routes

Attributes

  • id: Unique identifier for the invoice
  • items: List of items in the invoice
  • subtotal: Total price of the invoice before discount and tax
  • taxes_percent: Percentage of taxes to be applied to the invoice
  • tax: Total amount of taxes to be applied to the invoice
  • discount_percent: Percentage of discount to be applied to the invoice
  • discount: Total amount of discount to be applied to the invoice
  • total: Total price of the invoice after discount and tax

Methods

  • generate_pdf: Generates a PDF file of the invoice and saves it in the invoices folder, runs every time an invoice is created or updated (example: invoice1.pdf)

Routes

  • GET /get_all_invoices: Returns a list of all invoices

    • Parameters - None Get All Invoices
  • GET /get_invoice?id={invoice_id}: Returns the invoice with the given id

    • Parameters - id (int) Get Invoice
  • GET /get_invoice_pdf?id={invoice_id}: Returns the invoice with the given id in PDF format (example: invoice1.pdf)

    • Parameters - id (int) Get Invoice PDF
  • POST /new_invoice: Adds a new invoice

    • Parameters - items (list of dicts), taxes_percent (float), discount_percent (float) New Invoice
  • PUT /update_invoice: Updates the invoice with the given id

    • Parameters - id (int), items (list of dicts), taxes_percent (float), discount_percent (float) (at least one of these parameters must be provided) Update Invoice
  • DELETE /delete_invoice?id={invoice_id}: Deletes the invoice with the given id

    • Parameters - id (int) Delete Invoice

gdsc-web-dev-task-2's People

Contributors

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