# unick-ux/department-store-management architecture

> Architecture diagram of the GitHub repository unick-ux/department-store-management, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/unick-ux/department-store-management
- Repository: https://github.com/unick-ux/department-store-management

## Overview

This is a single-file, console-based department-store application. A user works through the menu to manage products, assemble a cart, and complete a sale; billing applies discounts and tax, prints a bill, deducts stock, and saves updated state. The README also documents sales reporting, persistent product and sales data, low-stock detection, and input validation. The source excerpt shows startup loading and post-sale saves, but omits parts of the menu and persistence code, so some feature links rely on README statements.

Main entry points: [`department_store_management.c`](https://github.com/unick-ux/department-store-management/blob/main/department_store_management.c) (Console Menu)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_store_ops["Store Operations"]
  node_entry["Application Startup"]
  node_menu["Console Menu"]
  node_catalog["Product Management"]
  node_stock["Low-Stock Detection"]
end

subgraph group_checkout["Cart and Checkout"]
  node_cart["Shopping Cart"]
  node_billing["Billing and Sale"]
  node_report["Sales Report"]
end

subgraph group_persistence["Persistent Data"]
  node_product_data[("Product Data")]
  node_sales_data[("Sales Data")]
end

node_shopper(("Shopper"))

node_shopper -->|"chooses actions"| node_menu
node_entry -->|"loads products"| node_product_data
node_entry -->|"loads sales"| node_sales_data
node_entry -->|"starts menu"| node_menu
node_menu -->|"dispatches product actions"| node_catalog
node_menu -->|"dispatches cart actions"| node_cart
node_menu -->|"dispatches checkout"| node_billing
node_menu -->|"dispatches report"| node_report
node_catalog -->|"checks quantities"| node_stock
node_cart -->|"checks available stock"| node_catalog
node_billing -->|"bills cart items"| node_cart
node_billing -->|"deducts stock and saves"| node_product_data
node_billing -->|"saves sales state"| node_sales_data
node_report -.->|"reports sales"| node_sales_data

click node_entry "https://github.com/unick-ux/department-store-management/blob/main/department_store_management.c"
click node_menu "https://github.com/unick-ux/department-store-management/blob/main/department_store_management.c"
click node_catalog "https://github.com/unick-ux/department-store-management/blob/main/department_store_management.c"
click node_stock "https://github.com/unick-ux/department-store-management/blob/main/department_store_management.c"
click node_cart "https://github.com/unick-ux/department-store-management/blob/main/department_store_management.c"
click node_billing "https://github.com/unick-ux/department-store-management/blob/main/department_store_management.c"
click node_report "https://github.com/unick-ux/department-store-management/blob/main/department_store_management.c"
click node_product_data "https://github.com/unick-ux/department-store-management/blob/main/department_store_management.c"
click node_sales_data "https://github.com/unick-ux/department-store-management/blob/main/department_store_management.c"

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_entry,node_menu,node_catalog,node_stock toneBlue
class node_cart,node_billing,node_report toneAmber
class node_product_data,node_sales_data toneMint
class node_shopper toneIndigo
```

## Components

### Store Operations

- [Application Startup](https://github.com/unick-ux/department-store-management/blob/main/department_store_management.c): `department_store_management.c`
- [Console Menu](https://github.com/unick-ux/department-store-management/blob/main/department_store_management.c): `department_store_management.c`
- [Product Management](https://github.com/unick-ux/department-store-management/blob/main/department_store_management.c): `department_store_management.c`
- [Low-Stock Detection](https://github.com/unick-ux/department-store-management/blob/main/department_store_management.c): `department_store_management.c`

### Cart and Checkout

- [Shopping Cart](https://github.com/unick-ux/department-store-management/blob/main/department_store_management.c): `department_store_management.c`
- [Billing and Sale](https://github.com/unick-ux/department-store-management/blob/main/department_store_management.c): `department_store_management.c`
- [Sales Report](https://github.com/unick-ux/department-store-management/blob/main/department_store_management.c): `department_store_management.c`

### Persistent Data

- [Product Data](https://github.com/unick-ux/department-store-management/blob/main/department_store_management.c): `department_store_management.c`
- [Sales Data](https://github.com/unick-ux/department-store-management/blob/main/department_store_management.c): `department_store_management.c`

### Other components

- **Shopper**

## Connections

- Shopper → Console Menu: chooses actions (evidence: `README.md`)
- Application Startup → Product Data: loads products (evidence: `department_store_management.c`)
- Application Startup → Sales Data: loads sales (evidence: `department_store_management.c`)
- Application Startup → Console Menu: starts menu (evidence: `department_store_management.c`)
- Console Menu → Product Management: dispatches product actions (evidence: `department_store_management.c`)
- Console Menu → Shopping Cart: dispatches cart actions (evidence: `department_store_management.c`)
- Console Menu → Billing and Sale: dispatches checkout (evidence: `department_store_management.c`)
- Console Menu → Sales Report: dispatches report (evidence: `README.md`)
- Product Management → Low-Stock Detection: checks quantities (evidence: `department_store_management.c`)
- Shopping Cart → Product Management: checks available stock (evidence: `department_store_management.c`)
- Billing and Sale → Shopping Cart: bills cart items (evidence: `department_store_management.c`)
- Billing and Sale → Product Data: deducts stock and saves (evidence: `department_store_management.c`)
- Billing and Sale → Sales Data: saves sales state (evidence: `department_store_management.c`)
- Sales Report → Sales Data: reports sales (evidence: `department_store_management.c`)
