# likithareddy-05/cloudmart-capstone architecture

> Architecture diagram of the GitHub repository likithareddy-05/cloudmart-capstone, 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/likithareddy-05/cloudmart-capstone
- Repository: https://github.com/likithareddy-05/cloudmart-capstone

## Overview

CloudMart is an AWS e-commerce backend. The main workflow authenticates API requests, dispatches product/inventory or order operations, and persists application data in MySQL. Orders also emit events for asynchronous processing; scheduled reporting writes CSVs to S3 for the Flask admin dashboard. The graph preserves documented monitoring and notification capabilities. Some service wiring is described only in the README, so those relationships cite it; source excerpts provide evidence for database and S3 access, but not all runtime configuration.

Main entry points: [`database/schema.sql`](https://github.com/likithareddy-05/cloudmart-capstone/blob/main/database/schema.sql) (RDS MySQL), [`lambda/order/lambda_function.py`](https://github.com/likithareddy-05/cloudmart-capstone/blob/main/lambda/order/lambda_function.py) (Order processing), [`lambda/report/lambda_function.py`](https://github.com/likithareddy-05/cloudmart-capstone/blob/main/lambda/report/lambda_function.py) (Report generator), [`dashboard/app.py`](https://github.com/likithareddy-05/cloudmart-capstone/blob/main/dashboard/app.py) (Flask dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and identity"]
  node_api_gateway{{"API Gateway"}}
  node_authorizer["Request authorizer<br/>[lambda_function.py]"]
end

subgraph group_commerce["Commerce services"]
  node_product["Product and inventory<br/>[lambda_function.py]"]
  node_order["Order processing<br/>[lambda_function.py]"]
  node_rds[("RDS MySQL<br/>[schema.sql]")]
end

subgraph group_events["Events and reporting"]
  node_eventbridge["EventBridge"]
  node_inventory_alert["Low-stock alerts<br/>[lambda_function.py]"]
  node_report["Report generator<br/>[lambda_function.py]"]
  node_s3[("S3 reports")]
  node_schedule{{"Scheduled rule"}}
end

subgraph group_admin["Administration and operations"]
  node_dashboard["Flask dashboard<br/>[app.py]"]
  node_cloudwatch["CloudWatch alarms"]
  node_sns["SNS notifications"]
end

node_client(("API client"))
node_admin(("Administrator"))
node_operations(("Operations team"))

node_client -->|"sends requests"| node_api_gateway
node_api_gateway -->|"authorizes via"| node_authorizer
node_authorizer -->|"validates against"| node_rds
node_api_gateway -->|"routes requests"| node_product
node_api_gateway -->|"routes requests"| node_order
node_product -->|"reads and writes"| node_rds
node_order -->|"reads and writes"| node_rds
node_order -->|"publishes order events"| node_eventbridge
node_eventbridge -->|"routes events"| node_inventory_alert
node_inventory_alert -->|"publishes alerts"| node_sns
node_eventbridge -->|"schedules reports"| node_schedule
node_schedule -->|"invokes"| node_report
node_report -->|"queries data"| node_rds
node_report -->|"stores CSV reports"| node_s3
node_admin -->|"uses"| node_dashboard
node_dashboard -->|"queries data"| node_rds
node_dashboard -->|"lists and downloads"| node_s3
node_cloudwatch -->|"sends alarm notifications"| node_sns
node_sns -->|"notifies"| node_operations

click node_authorizer "https://github.com/likithareddy-05/cloudmart-capstone/blob/main/lambda/authorizer/lambda_function.py"
click node_product "https://github.com/likithareddy-05/cloudmart-capstone/blob/main/lambda/product/lambda_function.py"
click node_order "https://github.com/likithareddy-05/cloudmart-capstone/blob/main/lambda/order/lambda_function.py"
click node_rds "https://github.com/likithareddy-05/cloudmart-capstone/blob/main/database/schema.sql"
click node_inventory_alert "https://github.com/likithareddy-05/cloudmart-capstone/blob/main/lambda/inventory-alert/lambda_function.py"
click node_report "https://github.com/likithareddy-05/cloudmart-capstone/blob/main/lambda/report/lambda_function.py"
click node_dashboard "https://github.com/likithareddy-05/cloudmart-capstone/blob/main/dashboard/app.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_api_gateway,node_authorizer,node_client toneBlue
class node_product,node_order,node_rds toneAmber
class node_eventbridge,node_inventory_alert,node_report,node_s3,node_schedule toneMint
class node_dashboard,node_cloudwatch,node_sns toneRose
class node_admin,node_operations toneIndigo
```

## Components

### API and identity

- **API Gateway**
- [Request authorizer](https://github.com/likithareddy-05/cloudmart-capstone/blob/main/lambda/authorizer/lambda_function.py): `lambda/authorizer/lambda_function.py`

### Commerce services

- [Product and inventory](https://github.com/likithareddy-05/cloudmart-capstone/blob/main/lambda/product/lambda_function.py): `lambda/product/lambda_function.py`
- [Order processing](https://github.com/likithareddy-05/cloudmart-capstone/blob/main/lambda/order/lambda_function.py): `lambda/order/lambda_function.py`
- [RDS MySQL](https://github.com/likithareddy-05/cloudmart-capstone/blob/main/database/schema.sql): `database/schema.sql`

### Events and reporting

- **EventBridge**
- [Low-stock alerts](https://github.com/likithareddy-05/cloudmart-capstone/blob/main/lambda/inventory-alert/lambda_function.py): `lambda/inventory-alert/lambda_function.py`
- [Report generator](https://github.com/likithareddy-05/cloudmart-capstone/blob/main/lambda/report/lambda_function.py): `lambda/report/lambda_function.py`
- **S3 reports**
- **Scheduled rule**

### Administration and operations

- [Flask dashboard](https://github.com/likithareddy-05/cloudmart-capstone/blob/main/dashboard/app.py): `dashboard/app.py`
- **CloudWatch alarms**
- **SNS notifications**

### Other components

- **API client**
- **Administrator**
- **Operations team**

## Connections

- API client → API Gateway: sends requests (evidence: `README.md`)
- API Gateway → Request authorizer: authorizes via (evidence: `README.md`)
- Request authorizer → RDS MySQL: validates against (evidence: `lambda/authorizer/lambda_function.py`)
- API Gateway → Product and inventory: routes requests (evidence: `README.md`)
- API Gateway → Order processing: routes requests (evidence: `README.md`)
- Product and inventory → RDS MySQL: reads and writes (evidence: `README.md`)
- Order processing → RDS MySQL: reads and writes (evidence: `README.md`)
- Order processing → EventBridge: publishes order events (evidence: `README.md`)
- EventBridge → Low-stock alerts: routes events (evidence: `README.md`)
- Low-stock alerts → SNS notifications: publishes alerts (evidence: `lambda/inventory-alert/lambda_function.py`)
- EventBridge → Scheduled rule: schedules reports (evidence: `README.md`)
- Scheduled rule → Report generator: invokes (evidence: `README.md`)
- Report generator → RDS MySQL: queries data (evidence: `lambda/report/lambda_function.py`)
- Report generator → S3 reports: stores CSV reports (evidence: `lambda/report/lambda_function.py`)
- Administrator → Flask dashboard: uses (evidence: `README.md`)
- Flask dashboard → RDS MySQL: queries data (evidence: `dashboard/app.py`)
- Flask dashboard → S3 reports: lists and downloads (evidence: `dashboard/app.py`)
- CloudWatch alarms → SNS notifications: sends alarm notifications (evidence: `README.md`)
- SNS notifications → Operations team: notifies (evidence: `README.md`)
