Tech stack used:
- Flask
- MongoDB
API documentation
Once the application has started successfully and database has been seeded with test data, open up your favorite web browser and go to http://127.0.0.1:5000/get_product.
Enter the product id you want to search
Output screen shot
Once the application has started successfully and database has been seeded with test data, open up your favorite web browser and go to http://127.0.0.1:5000/add_product.
Enter the product description you want to add
a. Unique product code b. Product Name c. Product Price d. Product category
Output screen shot
Once the application has started successfully and database has been seeded with test data, open up your favorite web browser and go to http://127.0.0.1:5000/delete_product.
Enter the product id which user want to remove
Output screen shot
Once the application has started successfully and database has been seeded with test data, open up your favorite web browser and go to http://127.0.0.1:5000/delete_product.
Enter the file from which user want to upload data to catalogue
File content should be in the below format
productId,productName,productPrice,productCategory
Output screen shot
**After upload, connect to mongo and verify documents are uploaded to mongoDB
db.product.find() { "_id" : ObjectId("5d2c7cd4981b51b94eafae07"), "product_category" : "fashion", "product_id" : 2, "product_name" : "Jeans", "product_price" : 2 } { "_id" : ObjectId("5d2c7cd4981b51b94eafae09"), "product_category" : "fashion", "product_id" : 1, "product_name" : "Shirt", "product_price" : 100 } { "_id" : ObjectId("5d2c7cd4981b51b94eafae0b"), "product_category" : "logistics", "product_id" : 3, "product_name" : "rivigo", "product_price" : 500 } { "_id" : ObjectId("5d2c80c6981b51b94eafaeef"), "product_category" : "fashion", "product_id" : 200, "product_name" : "Jeans", "product_price" : 100 } { "_id" : ObjectId("5d2c8eed981b51b94eafb25f"), "product_category" : "dummy", "product_id" : 2000, "product_name" : "DummyProduct", "product_price" : 0 } { "_id" : ObjectId("5d2d56ca981b51b94eafb5be"), "product_category" : "hardware", "product_id" : 200, "product_name" : "Laptop", "product_price" : 300000 } { "_id" : ObjectId("5d2d56ca981b51b94eafb5c0"), "product_category" : "hardware", "product_id" : 201, "product_name" : "Mobile", "product_price" : 20000 } { "_id" : ObjectId("5d2d56ca981b51b94eafb5c2"), "product_category" : "stationary", "product_id" : 202, "product_name" : "Pen", "product_price" : 200 } { "_id" : ObjectId("5d2d5749981b51b94eafb5f8"), "product_category" : "software", "product_id" : 100, "product_name" : "Delphix", "product_price" : 100 }
Once the application has started successfully and database has been seeded with test data, open up your favorite web browser and go to http://127.0.0.1:5000/delete_product.
Enter the file name to which user want to download catalogue
File content will be in the below format
productId,productName,productPrice,productCategory
Output screen shot
**After download open the file and verify the content