# 2602003/inf1103-labs architecture

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

- Interactive diagram: https://gitdiagram.com/2602003/inf1103-labs
- Repository: https://github.com/2602003/inf1103-labs

## Overview

This repository is a set of small, standalone Python exercises rather than one integrated application. The main workflows are inventory auditing by entering quantities and reporting totals, persistent order entry with file-backed history and a final audit report, and JSON inventory management for adding, finding, updating, displaying, and saving products. `hello.py` is a separate profile-input exercise. The files do not import or invoke one another; relationships shown are only within each script. `inventory.json` is the inventory manager's data file.

Main entry points: [`persistent_auditor.py`](https://github.com/2602003/inf1103-labs/blob/master/persistent_auditor.py) (Persistent order auditor), [`inventory_manager.py`](https://github.com/2602003/inf1103-labs/blob/master/inventory_manager.py) (Inventory manager), [`auditor.py`](https://github.com/2602003/inf1103-labs/blob/master/auditor.py) (Quantity auditor), [`modular_auditor.py`](https://github.com/2602003/inf1103-labs/blob/master/modular_auditor.py) (Modular auditor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_audit["Auditing exercises"]
  node_auditor["Quantity auditor<br/>[auditor.py]"]
  node_modular["Modular auditor<br/>[modular_auditor.py]"]
end

subgraph group_persistent["Persistent orders"]
  node_persistent["Persistent order auditor"]
  node_orderfile["Order history"]
end

subgraph group_inventory["Inventory manager"]
  node_manager["Inventory manager"]
  node_inventoryfile["Inventory data<br/>[inventory.json]"]
end

subgraph group_profile["Profile exercise"]
  node_profile["Profile exercise<br/>[hello.py]"]
end

node_user(("User"))

node_user -->|"enters quantities"| node_auditor
node_user -->|"enters quantities"| node_modular
node_user -->|"enters orders"| node_persistent
node_persistent -->|"loads and appends"| node_orderfile
node_user -->|"selects operations"| node_manager
node_manager -->|"loads and saves"| node_inventoryfile
node_user -->|"enters profile"| node_profile

click node_auditor "https://github.com/2602003/inf1103-labs/blob/master/auditor.py"
click node_modular "https://github.com/2602003/inf1103-labs/blob/master/modular_auditor.py"
click node_persistent "https://github.com/2602003/inf1103-labs/blob/master/persistent_auditor.py"
click node_orderfile "https://github.com/2602003/inf1103-labs/blob/master/persistent_auditor.py"
click node_manager "https://github.com/2602003/inf1103-labs/blob/master/inventory_manager.py"
click node_inventoryfile "https://github.com/2602003/inf1103-labs/blob/master/inventory.json"
click node_profile "https://github.com/2602003/inf1103-labs/blob/master/hello.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_auditor,node_modular,node_user toneBlue
class node_persistent,node_orderfile toneAmber
class node_manager,node_inventoryfile toneMint
class node_profile toneRose
```

## Components

### Auditing exercises

- [Quantity auditor](https://github.com/2602003/inf1103-labs/blob/master/auditor.py): `auditor.py`
- [Modular auditor](https://github.com/2602003/inf1103-labs/blob/master/modular_auditor.py): `modular_auditor.py`

### Persistent orders

- [Persistent order auditor](https://github.com/2602003/inf1103-labs/blob/master/persistent_auditor.py): `persistent_auditor.py`
- [Order history](https://github.com/2602003/inf1103-labs/blob/master/persistent_auditor.py): `persistent_auditor.py`

### Inventory manager

- [Inventory manager](https://github.com/2602003/inf1103-labs/blob/master/inventory_manager.py): `inventory_manager.py`
- [Inventory data](https://github.com/2602003/inf1103-labs/blob/master/inventory.json): `inventory.json`

### Profile exercise

- [Profile exercise](https://github.com/2602003/inf1103-labs/blob/master/hello.py): `hello.py`

### Other components

- **User**

## Connections

- User → Quantity auditor: enters quantities (evidence: `auditor.py`)
- User → Modular auditor: enters quantities (evidence: `modular_auditor.py`)
- User → Persistent order auditor: enters orders (evidence: `persistent_auditor.py`)
- Persistent order auditor → Order history: loads and appends (evidence: `persistent_auditor.py`)
- User → Inventory manager: selects operations (evidence: `inventory_manager.py`)
- Inventory manager → Inventory data: loads and saves (evidence: `inventory_manager.py`)
- User → Profile exercise: enters profile (evidence: `hello.py`)
