# akshara0405/cloudmart architecture

> Architecture diagram of the GitHub repository akshara0405/cloudmart, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/akshara0405/cloudmart
- Repository: https://github.com/akshara0405/cloudmart

## Overview

CloudMart is a serverless e-commerce application. Its main request path is API clients through API Gateway and authorization to product or order processing, with MySQL persistence; separate documented paths cover event notifications, daily reports, and the administrator dashboard. Product, order, and dashboard implementation details are only partially available, so edges between those components and AWS services rely on the README; the source index confirms the application modules use the bundled PyMySQL clients.

Main entry points: [`lambda/product-lambda/index.py`](https://github.com/akshara0405/cloudmart/blob/main/lambda/product-lambda/index.py) (Product service), [`lambda/order-processor/index.py`](https://github.com/akshara0405/cloudmart/blob/main/lambda/order-processor/index.py) (Order processor), [`lambda/report-lambda/index.py`](https://github.com/akshara0405/cloudmart/blob/main/lambda/report-lambda/index.py) (Report Lambda), [`lambda/pymysql/connections.py`](https://github.com/akshara0405/cloudmart/blob/main/lambda/pymysql/connections.py) (PyMySQL client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_commerce["Commerce API"]
  node_authorizer["Lambda Authorizer<br/>[index.py]"]
  node_products["Product service<br/>[index.py]"]
  node_orders["Order processor<br/>[index.py]"]
  node_dashboard["Admin dashboard<br/>[app.py]"]
end

subgraph group_aws["AWS Services"]
  node_gateway["API Gateway"]
  node_rds[("RDS MySQL")]
  node_events["EventBridge"]
  node_sns["SNS notifications"]
  node_s3[("S3 reports")]
  node_parameters[("Parameter Store")]
end

subgraph group_operations["Operations"]
  node_cloudwatch["CloudWatch monitoring"]
  node_report["Report Lambda<br/>[index.py]"]
end

subgraph group_mysql["MySQL Client"]
  node_pymysql["PyMySQL client<br/>[connections.py]"]
  node_orderdb["Order PyMySQL<br/>[connections.py]"]
end

node_client(("API clients"))

node_client -->|"calls API"| node_gateway
node_gateway -->|"authorizes requests"| node_authorizer
node_gateway -->|"routes product requests"| node_products
node_gateway -->|"routes order requests"| node_orders
node_authorizer -->|"validates tokens"| node_rds
node_products -->|"reads and writes"| node_rds
node_orders -->|"reads and writes"| node_rds
node_products -->|"publishes inventory events"| node_events
node_orders -->|"publishes order events"| node_events
node_events -->|"dispatches events"| node_sns
node_cloudwatch -->|"sends alarm notifications"| node_sns
node_rds -->|"provides report data"| node_report
node_report -->|"stores daily reports"| node_s3
node_events -->|"schedules daily run"| node_report
node_products -->|"uses client"| node_pymysql
node_authorizer -->|"uses client"| node_pymysql
node_dashboard -->|"imports client"| node_pymysql
node_report -->|"uses client"| node_pymysql
node_orders -->|"uses bundled client"| node_orderdb

click node_authorizer "https://github.com/akshara0405/cloudmart/blob/main/lambda/lambda-authorizer/index.py"
click node_products "https://github.com/akshara0405/cloudmart/blob/main/lambda/product-lambda/index.py"
click node_orders "https://github.com/akshara0405/cloudmart/blob/main/lambda/order-processor/index.py"
click node_dashboard "https://github.com/akshara0405/cloudmart/blob/main/dashboard/app.py"
click node_report "https://github.com/akshara0405/cloudmart/blob/main/lambda/report-lambda/index.py"
click node_pymysql "https://github.com/akshara0405/cloudmart/blob/main/lambda/pymysql/connections.py"
click node_orderdb "https://github.com/akshara0405/cloudmart/blob/main/lambda/order-processor/pymysql/connections.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_authorizer,node_products,node_orders,node_dashboard,node_client toneBlue
class node_gateway,node_rds,node_events,node_sns,node_s3,node_parameters toneAmber
class node_cloudwatch,node_report toneMint
class node_pymysql,node_orderdb toneRose
```

## Components

### Commerce API

- [Lambda Authorizer](https://github.com/akshara0405/cloudmart/blob/main/lambda/lambda-authorizer/index.py): `lambda/lambda-authorizer/index.py`
- [Product service](https://github.com/akshara0405/cloudmart/blob/main/lambda/product-lambda/index.py): `lambda/product-lambda/index.py`
- [Order processor](https://github.com/akshara0405/cloudmart/blob/main/lambda/order-processor/index.py): `lambda/order-processor/index.py`
- [Admin dashboard](https://github.com/akshara0405/cloudmart/blob/main/dashboard/app.py): `dashboard/app.py`

### AWS Services

- **API Gateway**
- **RDS MySQL**
- **EventBridge**
- **SNS notifications**
- **S3 reports**
- **Parameter Store**

### Operations

- **CloudWatch monitoring**
- [Report Lambda](https://github.com/akshara0405/cloudmart/blob/main/lambda/report-lambda/index.py): `lambda/report-lambda/index.py`

### MySQL Client

- [PyMySQL client](https://github.com/akshara0405/cloudmart/blob/main/lambda/pymysql/connections.py): `lambda/pymysql/connections.py`
- [Order PyMySQL](https://github.com/akshara0405/cloudmart/blob/main/lambda/order-processor/pymysql/connections.py): `lambda/order-processor/pymysql/connections.py`

### Other components

- **API clients**

## Connections

- API clients → API Gateway: calls API
- API Gateway → Lambda Authorizer: authorizes requests
- API Gateway → Product service: routes product requests
- API Gateway → Order processor: routes order requests
- Lambda Authorizer → RDS MySQL: validates tokens
- Product service → RDS MySQL: reads and writes
- Order processor → RDS MySQL: reads and writes
- Product service → EventBridge: publishes inventory events
- Order processor → EventBridge: publishes order events
- EventBridge → SNS notifications: dispatches events
- CloudWatch monitoring → SNS notifications: sends alarm notifications
- RDS MySQL → Report Lambda: provides report data
- Report Lambda → S3 reports: stores daily reports
- EventBridge → Report Lambda: schedules daily run
- Product service → PyMySQL client: uses client
- Lambda Authorizer → PyMySQL client: uses client
- Admin dashboard → PyMySQL client: imports client
- Report Lambda → PyMySQL client: uses client
- Order processor → Order PyMySQL: uses bundled client
