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.
- 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)
- id: Unique identifier for the item
- name: Name of the item
- stock: Number of items in stock
- price: Price of the item
-
GET /get_all_items: Returns a list of all items in the inventory
-
GET /get_item?id={item_id}: Returns the item with the given id
-
POST /add_item: Adds a new item to the inventory
-
PUT /update_item: Updates the item with the given id
-
DELETE /delete_item?id={item_id}: Deletes the item with the given id
- 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
- 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)
-
GET /get_all_invoices: Returns a list of all invoices
-
GET /get_invoice?id={invoice_id}: Returns the invoice with the given id
-
GET /get_invoice_pdf?id={invoice_id}: Returns the invoice with the given id in PDF format (example: invoice1.pdf)
-
POST /new_invoice: Adds a new invoice
-
PUT /update_invoice: Updates the invoice with the given id
-
DELETE /delete_invoice?id={invoice_id}: Deletes the invoice with the given id