# stephenjamesada/shopping-cart architecture

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

- Interactive diagram: https://gitdiagram.com/stephenjamesada/shopping-cart
- Repository: https://github.com/stephenjamesada/shopping-cart

## Overview

Shopping Cart is a small standalone C console program. The user selects a currency, enters a quantity and item names and prices, then sees a cart summary. These stages are all implemented within `main` in `cart.c`; the diagram separates their responsibilities without implying separate modules. The cart and product values are in-memory state only. The source excerpt supports the shown interactions and data flow.

Main entry points: [`cart.c`](https://github.com/stephenjamesada/shopping-cart/blob/main/cart.c) (Cart program)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_main["Cart program<br/>[cart.c]"]
node_currency["Currency selection<br/>[cart.c]"]
node_entry["Item entry<br/>[cart.c]"]
node_state["Cart state<br/>[cart.c]"]
node_summary["Cart summary<br/>[cart.c]"]

node_user -->|"provides input"| node_main
node_main -->|"prompts choice"| node_currency
node_currency -->|"sets currency"| node_state
node_main -->|"prompts items"| node_entry
node_entry -->|"stores items"| node_state
node_main -->|"prints summary"| node_summary
node_state -->|"provides values"| node_summary

click node_main "https://github.com/stephenjamesada/shopping-cart/blob/main/cart.c"
click node_currency "https://github.com/stephenjamesada/shopping-cart/blob/main/cart.c"
click node_entry "https://github.com/stephenjamesada/shopping-cart/blob/main/cart.c"
click node_state "https://github.com/stephenjamesada/shopping-cart/blob/main/cart.c"
click node_summary "https://github.com/stephenjamesada/shopping-cart/blob/main/cart.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_user toneBlue
class node_main,node_currency,node_entry,node_state,node_summary toneTeal
```

## Components

### Other components

- **User**
- [Cart program](https://github.com/stephenjamesada/shopping-cart/blob/main/cart.c): `cart.c`
- [Currency selection](https://github.com/stephenjamesada/shopping-cart/blob/main/cart.c): `cart.c`
- [Item entry](https://github.com/stephenjamesada/shopping-cart/blob/main/cart.c): `cart.c`
- [Cart state](https://github.com/stephenjamesada/shopping-cart/blob/main/cart.c): `cart.c`
- [Cart summary](https://github.com/stephenjamesada/shopping-cart/blob/main/cart.c): `cart.c`

## Connections

- User → Cart program: provides input (evidence: `cart.c`)
- Cart program → Currency selection: prompts choice (evidence: `cart.c`)
- Currency selection → Cart state: sets currency (evidence: `cart.c`)
- Cart program → Item entry: prompts items (evidence: `cart.c`)
- Item entry → Cart state: stores items (evidence: `cart.c`)
- Cart program → Cart summary: prints summary (evidence: `cart.c`)
- Cart state → Cart summary: provides values (evidence: `cart.c`)
