# jotapekk/lista-de-compras-python architecture

> Architecture diagram of the GitHub repository jotapekk/lista-de-compras-python, 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/jotapekk/lista-de-compras-python
- Repository: https://github.com/jotapekk/lista-de-compras-python

## Overview

This is a small command-line item register. It loads saved items, prompts for names and quantities until the user enters “sair,” saves each addition, then reads and prints the registered items. Item is the domain model; armazenamento handles persistence in a JSON file. The source shows these calls directly; the README is empty, and the separate requests example is not part of the register workflow.

Main entry points: [`main.py`](https://github.com/jotapekk/lista-de-compras-python/blob/main/main.py) (Item register), [`armazenamento.py`](https://github.com/jotapekk/lista-de-compras-python/blob/main/armazenamento.py) (Item storage), [`item.py`](https://github.com/jotapekk/lista-de-compras-python/blob/main/item.py) (Item model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Command line"]
  node_cli_app["Item register<br/>[main.py]"]
end

subgraph group_domain["Items and storage"]
  node_item["Item model<br/>[item.py]"]
  node_storage["Item storage<br/>[armazenamento.py]"]
  node_items_json[("items.json")]
end

node_user(("User"))

node_user -->|"enters items"| node_cli_app
node_cli_app -->|"loads items"| node_storage
node_cli_app -->|"creates item"| node_item
node_cli_app -->|"saves items"| node_storage
node_storage -->|"creates items"| node_item
node_storage -->|"reads and writes"| node_items_json
node_cli_app -->|"reads for display"| node_items_json
node_cli_app -->|"prints items"| node_user

click node_cli_app "https://github.com/jotapekk/lista-de-compras-python/blob/main/main.py"
click node_item "https://github.com/jotapekk/lista-de-compras-python/blob/main/item.py"
click node_storage "https://github.com/jotapekk/lista-de-compras-python/blob/main/armazenamento.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_cli_app,node_user toneBlue
class node_item,node_storage,node_items_json toneAmber
```

## Components

### Command line

- [Item register](https://github.com/jotapekk/lista-de-compras-python/blob/main/main.py): `main.py`

### Items and storage

- [Item model](https://github.com/jotapekk/lista-de-compras-python/blob/main/item.py): `item.py`
- [Item storage](https://github.com/jotapekk/lista-de-compras-python/blob/main/armazenamento.py): `armazenamento.py`
- **items.json**

### Other components

- **User**

## Connections

- User → Item register: enters items (evidence: `main.py`)
- Item register → Item storage: loads items (evidence: `main.py`)
- Item register → Item model: creates item (evidence: `main.py`)
- Item register → Item storage: saves items (evidence: `main.py`)
- Item storage → Item model: creates items (evidence: `armazenamento.py`)
- Item storage → items.json: reads and writes (evidence: `armazenamento.py`)
- Item register → items.json: reads for display (evidence: `main.py`)
- Item register → User: prints items (evidence: `main.py`)
