# sriteja21/cloudmart architecture

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

## Overview

CloudMart is a serverless commerce application, with customer and administrator workflows, product and inventory management, order processing, a dashboard, and reporting. HTTP-triggered Lambda handlers implement the API domains; the dashboard also accesses the database directly. A schema initializer creates the database structure, while reporting exports data to object storage. The excerpts show individual handlers’ database and cloud-service interactions, but do not establish how infrastructure routes requests or connects these handlers, so those links are omitted.

Main entry points: [`src/dashboard/app.py`](https://github.com/sriteja21/cloudmart/blob/main/src/dashboard/app.py) (Admin dashboard), [`src/report/lambda_function.py`](https://github.com/sriteja21/cloudmart/blob/main/src/report/lambda_function.py) (Report generation), [`src/init-schema/lambda_function.py`](https://github.com/sriteja21/cloudmart/blob/main/src/init-schema/lambda_function.py) (Schema initializer), [`src/product/lambda_function.py`](https://github.com/sriteja21/cloudmart/blob/main/src/product/lambda_function.py) (Product and inventory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and dashboard"]
  node_dashboard["Admin dashboard<br/>[app.py]"]
  node_dashboard_views["Dashboard views"]
  node_authorizer["Request authorization<br/>[lambda_function.py]"]
end

subgraph group_commerce["Commerce APIs"]
  node_customer_api["Customer management<br/>[lambda_function.py]"]
  node_product_api["Product and inventory<br/>[lambda_function.py]"]
  node_order_api["Order processing<br/>[lambda_function.py]"]
end

subgraph group_data["Data and reports"]
  node_report_job["Report generation<br/>[lambda_function.py]"]
  node_database[("MySQL database")]
  node_object_storage[("Report storage")]
  node_parameter_store["Parameter Store"]
  node_event_bus["EventBridge"]
end

subgraph group_setup["Database setup"]
  node_schema_initializer["Schema initializer<br/>[lambda_function.py]"]
  node_schema_sql["Database schema<br/>[schema.sql]"]
end

node_admin(("Administrator"))
node_customer_actor(("Customer"))

node_admin -->|"uses"| node_dashboard
node_dashboard -->|"renders"| node_dashboard_views
node_dashboard -->|"queries"| node_database
node_dashboard -->|"lists and downloads"| node_object_storage
node_dashboard -->|"loads configuration"| node_parameter_store
node_customer_actor -->|"sends requests"| node_customer_api
node_customer_api -->|"reads and writes"| node_database
node_customer_actor -->|"requests products"| node_product_api
node_product_api -->|"reads and updates"| node_database
node_product_api -->|"publishes low-stock events"| node_event_bus
node_customer_actor -->|"sends requests"| node_order_api
node_order_api -->|"reads and updates"| node_database
node_report_job -->|"fetches report data"| node_database
node_report_job -->|"uploads CSV"| node_object_storage
node_report_job -->|"loads configuration"| node_parameter_store
node_schema_initializer -->|"loads configuration"| node_parameter_store
node_schema_initializer -->|"reads"| node_schema_sql
node_schema_initializer -->|"creates and initializes"| node_database
node_authorizer -->|"loads configuration"| node_parameter_store
node_authorizer -->|"looks up identity"| node_database

click node_dashboard "https://github.com/sriteja21/cloudmart/blob/main/src/dashboard/app.py"
click node_dashboard_views "https://github.com/sriteja21/cloudmart/tree/main/src/dashboard/templates"
click node_authorizer "https://github.com/sriteja21/cloudmart/blob/main/src/authorizer/lambda_function.py"
click node_customer_api "https://github.com/sriteja21/cloudmart/blob/main/src/customer/lambda_function.py"
click node_product_api "https://github.com/sriteja21/cloudmart/blob/main/src/product/lambda_function.py"
click node_order_api "https://github.com/sriteja21/cloudmart/blob/main/src/order/lambda_function.py"
click node_report_job "https://github.com/sriteja21/cloudmart/blob/main/src/report/lambda_function.py"
click node_schema_initializer "https://github.com/sriteja21/cloudmart/blob/main/src/init-schema/lambda_function.py"
click node_schema_sql "https://github.com/sriteja21/cloudmart/blob/main/src/init-schema/schema.sql"

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_dashboard,node_dashboard_views,node_authorizer toneBlue
class node_customer_api,node_product_api,node_order_api toneAmber
class node_report_job,node_database,node_object_storage,node_parameter_store,node_event_bus toneMint
class node_schema_initializer,node_schema_sql toneRose
class node_admin,node_customer_actor toneIndigo
```

## Components

### Access and dashboard

- [Admin dashboard](https://github.com/sriteja21/cloudmart/blob/main/src/dashboard/app.py): `src/dashboard/app.py`
- [Dashboard views](https://github.com/sriteja21/cloudmart/tree/main/src/dashboard/templates): `src/dashboard/templates`
- [Request authorization](https://github.com/sriteja21/cloudmart/blob/main/src/authorizer/lambda_function.py): `src/authorizer/lambda_function.py`

### Commerce APIs

- [Customer management](https://github.com/sriteja21/cloudmart/blob/main/src/customer/lambda_function.py): `src/customer/lambda_function.py`
- [Product and inventory](https://github.com/sriteja21/cloudmart/blob/main/src/product/lambda_function.py): `src/product/lambda_function.py`
- [Order processing](https://github.com/sriteja21/cloudmart/blob/main/src/order/lambda_function.py): `src/order/lambda_function.py`

### Data and reports

- [Report generation](https://github.com/sriteja21/cloudmart/blob/main/src/report/lambda_function.py): `src/report/lambda_function.py`
- **MySQL database**
- **Report storage**
- **Parameter Store**
- **EventBridge**

### Database setup

- [Schema initializer](https://github.com/sriteja21/cloudmart/blob/main/src/init-schema/lambda_function.py): `src/init-schema/lambda_function.py`
- [Database schema](https://github.com/sriteja21/cloudmart/blob/main/src/init-schema/schema.sql): `src/init-schema/schema.sql`

### Other components

- **Administrator**
- **Customer**

## Connections

- Administrator → Admin dashboard: uses (evidence: `src/dashboard/app.py`)
- Admin dashboard → Dashboard views: renders (evidence: `src/dashboard/app.py`)
- Admin dashboard → MySQL database: queries (evidence: `src/dashboard/app.py`)
- Admin dashboard → Report storage: lists and downloads (evidence: `src/dashboard/app.py`)
- Admin dashboard → Parameter Store: loads configuration (evidence: `src/dashboard/app.py`)
- Customer → Customer management: sends requests (evidence: `src/customer/lambda_function.py`)
- Customer management → MySQL database: reads and writes (evidence: `src/customer/lambda_function.py`)
- Customer → Product and inventory: requests products (evidence: `src/product/lambda_function.py`)
- Product and inventory → MySQL database: reads and updates (evidence: `src/product/lambda_function.py`)
- Product and inventory → EventBridge: publishes low-stock events (evidence: `src/product/lambda_function.py`)
- Customer → Order processing: sends requests (evidence: `src/order/lambda_function.py`)
- Order processing → MySQL database: reads and updates (evidence: `src/order/lambda_function.py`)
- Report generation → MySQL database: fetches report data (evidence: `src/report/lambda_function.py`)
- Report generation → Report storage: uploads CSV (evidence: `src/report/lambda_function.py`)
- Report generation → Parameter Store: loads configuration (evidence: `src/report/lambda_function.py`)
- Schema initializer → Parameter Store: loads configuration (evidence: `src/init-schema/lambda_function.py`)
- Schema initializer → Database schema: reads (evidence: `src/init-schema/lambda_function.py`)
- Schema initializer → MySQL database: creates and initializes (evidence: `src/init-schema/lambda_function.py`)
- Request authorization → Parameter Store: loads configuration (evidence: `src/authorizer/lambda_function.py`)
- Request authorization → MySQL database: looks up identity (evidence: `src/authorizer/lambda_function.py`)
