Skip to content

cosmasnyairo/cloudwatch-application-logging-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Store

Demo store to showcase logging to a file and to cloudwatch

Table of contents

Product Module:

We do the following actions on the product class: add, remove, fetch all produts and add a single product.

// Sample product:
 {
        "productid": 1,
        "name": "mouse",
        "description": "Wireless and has rgb",
        "price": 4000,
        "stockquantity": 30
},
graph LR;
    UserInput-->id1(GetProducts);
    UserInput-->id2(GetSingleProduct);
    UserInput-->id3(AddProduct);
    UserInput-->id4(RemoveProduct);
    id1(GetProducts)-->id5(LogtoFile?);
    id2(GetSingleProduct)-->id5(LogtoFile?);
    id3(RemoveProduct)-->id5(LogtoFile?);
    id4(RemoveProduct)-->id5(LogtoFile?);
    id5(Log to file?)-->|YES|id6(Log to file);
    id5(Log to file?)-->|NO|id7(Log to cloudwatch);
Loading

Discount Module:

We do the following actions on the discount class: add, remove, fetch all discounts

// Sample discount:
{
    "name": "20% Off select items",
    "productid": 1,
    "discountpercentage": 20,
    "discountcode": "20FOR20"
},
graph LR;
    UserInput-->id1(GetDiscount);
    UserInput-->id2(AddDiscount);
    UserInput-->id3(RemoveDiscount);
    id1(GetDiscount)-->id5(LogtoFile?);
    id2(AddDiscount)-->id5(LogtoFile?);
    id3(RemoveDiscount)-->id5(LogtoFile?);
    id5(Log to file?)-->|YES|id6(Log to file);
    id5(Log to file?)-->|NO|id7(Log to cloudwatch);
Loading

Cart Module:

We do the following actions on the cart class: add, remove, fetch all cart items

// Sample cart:
{
    "productid": 4,
    "quantity": 10,
    "totalprice": 2000,
    "discountcodes": "50OFFERNOW",
    "date": "August 11, 2022"
},
graph LR;
    UserInput-->id1(GetCart);
    UserInput-->id2(AddtoCart);
    UserInput-->id3(RemovefromCart);
    id1(GetCart)-->id5(LogtoFile?);
    id2(AddtoCart)-->id5(LogtoFile?);
    id3(RemovefromCart)-->id5(LogtoFile?);
    id5(Log to file?)-->|YES|id6(Log to file);
    id5(Log to file?)-->|NO|id7(Log to cloudwatch);
Loading

Requirements

  • Requirements.txt file contains all the packages that were used in creating of the store demo

About

cloudwatch logging demo

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages