# vivekmaddimsetty/shelfwise-shop-manager architecture

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

- Interactive diagram: https://gitdiagram.com/vivekmaddimsetty/shelfwise-shop-manager
- Repository: https://github.com/vivekmaddimsetty/shelfwise-shop-manager

## Overview

Shelfwise is a small-shop inventory and order manager. A shop owner uses the browser interface to review dashboard summaries, search and maintain products, export the catalog, and compose or cancel orders. The frontend sends API requests to the Python server, which validates requests and applies inventory and order rules backed by SQLite. The README documents transaction-safe stock deduction and restocking on cancellation. The sampled sources show key UI requests and server/database behavior; some details, including the cancellation implementation, are documented but not excerpted.

Main entry points: [`backend/server.py`](https://github.com/vivekmaddimsetty/shelfwise-shop-manager/blob/main/backend/server.py) (HTTP API), [`frontend/app.js`](https://github.com/vivekmaddimsetty/shelfwise-shop-manager/blob/main/frontend/app.js) (Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Shop interface"]
  node_dashboard["Dashboard<br/>[app.js]"]
  node_inventory["Inventory search<br/>[app.js]"]
  node_product_edits["Product management<br/>[app.js]"]
  node_catalog_export["CSV export<br/>[app.js]"]
  node_order_entry["Order entry<br/>[app.js]"]
  node_order_history["Order history<br/>[app.js]"]
  node_responsive_ui["Responsive layout<br/>[styles.css]"]
end

subgraph group_service["Application service"]
  node_http_api["HTTP API<br/>[server.py]"]
  node_request_validation["Request validation<br/>[server.py]"]
  node_product_rules["Product operations<br/>[server.py]"]
  node_order_rules["Order transactions<br/>[server.py]"]
  node_dashboard_queries["Dashboard summaries<br/>[server.py]"]
end

subgraph group_persistence["Persistence"]
  node_sqlite[("SQLite database<br/>[server.py]")]
end

node_owner(("Shop owner"))

node_owner -->|"reviews"| node_dashboard
node_owner -->|"searches"| node_inventory
node_owner -->|"updates"| node_product_edits
node_owner -->|"exports"| node_catalog_export
node_owner -->|"places"| node_order_entry
node_owner -->|"cancels"| node_order_history
node_dashboard -->|"requests"| node_http_api
node_inventory -->|"requests"| node_http_api
node_product_edits -->|"requests"| node_http_api
node_order_entry -->|"submits"| node_http_api
node_order_history -->|"requests"| node_http_api
node_http_api -->|"validates"| node_request_validation
node_http_api -->|"dispatches"| node_product_rules
node_http_api -->|"dispatches"| node_order_rules
node_http_api -->|"dispatches"| node_dashboard_queries
node_product_rules -->|"reads and writes"| node_sqlite
node_order_rules -->|"transacts"| node_sqlite
node_dashboard_queries -->|"reads"| node_sqlite

click node_dashboard "https://github.com/vivekmaddimsetty/shelfwise-shop-manager/blob/main/frontend/app.js"
click node_inventory "https://github.com/vivekmaddimsetty/shelfwise-shop-manager/blob/main/frontend/app.js"
click node_product_edits "https://github.com/vivekmaddimsetty/shelfwise-shop-manager/blob/main/frontend/app.js"
click node_catalog_export "https://github.com/vivekmaddimsetty/shelfwise-shop-manager/blob/main/frontend/app.js"
click node_order_entry "https://github.com/vivekmaddimsetty/shelfwise-shop-manager/blob/main/frontend/app.js"
click node_order_history "https://github.com/vivekmaddimsetty/shelfwise-shop-manager/blob/main/frontend/app.js"
click node_responsive_ui "https://github.com/vivekmaddimsetty/shelfwise-shop-manager/blob/main/frontend/styles.css"
click node_http_api "https://github.com/vivekmaddimsetty/shelfwise-shop-manager/blob/main/backend/server.py"
click node_request_validation "https://github.com/vivekmaddimsetty/shelfwise-shop-manager/blob/main/backend/server.py"
click node_product_rules "https://github.com/vivekmaddimsetty/shelfwise-shop-manager/blob/main/backend/server.py"
click node_order_rules "https://github.com/vivekmaddimsetty/shelfwise-shop-manager/blob/main/backend/server.py"
click node_dashboard_queries "https://github.com/vivekmaddimsetty/shelfwise-shop-manager/blob/main/backend/server.py"
click node_sqlite "https://github.com/vivekmaddimsetty/shelfwise-shop-manager/blob/main/backend/server.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_dashboard,node_inventory,node_product_edits,node_catalog_export,node_order_entry,node_order_history,node_responsive_ui toneBlue
class node_http_api,node_request_validation,node_product_rules,node_order_rules,node_dashboard_queries toneAmber
class node_sqlite toneMint
class node_owner toneIndigo
```

## Components

### Shop interface

- [Dashboard](https://github.com/vivekmaddimsetty/shelfwise-shop-manager/blob/main/frontend/app.js): `frontend/app.js`
- [Inventory search](https://github.com/vivekmaddimsetty/shelfwise-shop-manager/blob/main/frontend/app.js): `frontend/app.js`
- [Product management](https://github.com/vivekmaddimsetty/shelfwise-shop-manager/blob/main/frontend/app.js): `frontend/app.js`
- [CSV export](https://github.com/vivekmaddimsetty/shelfwise-shop-manager/blob/main/frontend/app.js): `frontend/app.js`
- [Order entry](https://github.com/vivekmaddimsetty/shelfwise-shop-manager/blob/main/frontend/app.js): `frontend/app.js`
- [Order history](https://github.com/vivekmaddimsetty/shelfwise-shop-manager/blob/main/frontend/app.js): `frontend/app.js`
- [Responsive layout](https://github.com/vivekmaddimsetty/shelfwise-shop-manager/blob/main/frontend/styles.css): `frontend/styles.css`

### Application service

- [HTTP API](https://github.com/vivekmaddimsetty/shelfwise-shop-manager/blob/main/backend/server.py): `backend/server.py`
- [Request validation](https://github.com/vivekmaddimsetty/shelfwise-shop-manager/blob/main/backend/server.py): `backend/server.py`
- [Product operations](https://github.com/vivekmaddimsetty/shelfwise-shop-manager/blob/main/backend/server.py): `backend/server.py`
- [Order transactions](https://github.com/vivekmaddimsetty/shelfwise-shop-manager/blob/main/backend/server.py): `backend/server.py`
- [Dashboard summaries](https://github.com/vivekmaddimsetty/shelfwise-shop-manager/blob/main/backend/server.py): `backend/server.py`

### Persistence

- [SQLite database](https://github.com/vivekmaddimsetty/shelfwise-shop-manager/blob/main/backend/server.py): `backend/server.py`

### Other components

- **Shop owner**

## Connections

- Shop owner → Dashboard: reviews (evidence: `README.md`)
- Shop owner → Inventory search: searches (evidence: `README.md`)
- Shop owner → Product management: updates (evidence: `README.md`)
- Shop owner → CSV export: exports (evidence: `README.md`)
- Shop owner → Order entry: places (evidence: `README.md`)
- Shop owner → Order history: cancels (evidence: `README.md`)
- Dashboard → HTTP API: requests (evidence: `frontend/app.js`)
- Inventory search → HTTP API: requests (evidence: `frontend/app.js`)
- Product management → HTTP API: requests (evidence: `frontend/app.js`)
- Order entry → HTTP API: submits (evidence: `frontend/app.js`)
- Order history → HTTP API: requests (evidence: `frontend/app.js`)
- HTTP API → Request validation: validates (evidence: `backend/server.py`)
- HTTP API → Product operations: dispatches (evidence: `backend/server.py`)
- HTTP API → Order transactions: dispatches (evidence: `backend/server.py`)
- HTTP API → Dashboard summaries: dispatches (evidence: `backend/server.py`)
- Product operations → SQLite database: reads and writes (evidence: `backend/server.py`)
- Order transactions → SQLite database: transacts (evidence: `README.md`)
- Dashboard summaries → SQLite database: reads (evidence: `backend/server.py`)
