# whps0620/smartpack-finder architecture

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

- Interactive diagram: https://gitdiagram.com/whps0620/smartpack-finder
- Repository: https://github.com/whps0620/smartpack-finder

## Overview

Food-Pack-Mapper is a Streamlit decision-support tool for selecting sustainable packaging materials against food barrier requirements. Users choose a food category or enter custom OTR/WVTR ranges; the app loads and cleans material data, clusters materials by permeability, and presents a log-scale map and matching-material results. The README also describes representative materials, a safe-zone overlay, and food-specific requirement context. The sampled source places these stages in app.py; no separate implementation modules are evident in the tree.

Main entry points: [`app.py`](https://github.com/whps0620/smartpack-finder/blob/main/app.py) (Streamlit selector), [`materials_permeability.csv`](https://github.com/whps0620/smartpack-finder/blob/main/materials_permeability.csv) (Material profiles), [`food_requirements.csv`](https://github.com/whps0620/smartpack-finder/blob/main/food_requirements.csv) (Food requirements)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Requirements and Data"]
  node_app["Streamlit selector<br/>[app.py]"]
  node_materials[("Material profiles")]
  node_foodreq[("Food requirements")]
end

subgraph group_analysis["Permeability Analysis"]
  node_clean["Clean and aggregate<br/>[app.py]"]
  node_requirements["Requirement selection<br/>[app.py]"]
  node_clustering["Four-tier clustering<br/>[app.py]"]
  node_representatives["Representative materials<br/>[app.py]"]
end

subgraph group_results["Selection Results"]
  node_mapping["Log-scale mapping<br/>[app.py]"]
  node_safezone["Requirement safe zone<br/>[app.py]"]
  node_matching["Range matching<br/>[app.py]"]
  node_table["Matching materials table<br/>[app.py]"]
end

node_user(("Packaging user"))

node_user -->|"sets requirements"| node_app
node_app -->|"reads profiles"| node_materials
node_app -->|"reads limits"| node_foodreq
node_app -->|"prepares data"| node_clean
node_app -->|"selects limits"| node_requirements
node_clean -->|"scales and clusters"| node_clustering
node_clustering -->|"summarizes tiers"| node_representatives
node_app -->|"renders permeability"| node_mapping
node_app -->|"plots selected limits"| node_safezone
node_app -->|"filters ranges"| node_matching
node_matching -->|"provides matches"| node_table
node_representatives -->|"labels clusters"| node_mapping
node_requirements -->|"sets bounds"| node_safezone
node_requirements -->|"sets bounds"| node_matching

click node_app "https://github.com/whps0620/smartpack-finder/blob/main/app.py"
click node_materials "https://github.com/whps0620/smartpack-finder/blob/main/materials_permeability.csv"
click node_foodreq "https://github.com/whps0620/smartpack-finder/blob/main/food_requirements.csv"
click node_clean "https://github.com/whps0620/smartpack-finder/blob/main/app.py"
click node_requirements "https://github.com/whps0620/smartpack-finder/blob/main/app.py"
click node_clustering "https://github.com/whps0620/smartpack-finder/blob/main/app.py"
click node_representatives "https://github.com/whps0620/smartpack-finder/blob/main/app.py"
click node_mapping "https://github.com/whps0620/smartpack-finder/blob/main/app.py"
click node_safezone "https://github.com/whps0620/smartpack-finder/blob/main/app.py"
click node_matching "https://github.com/whps0620/smartpack-finder/blob/main/app.py"
click node_table "https://github.com/whps0620/smartpack-finder/blob/main/app.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_app,node_materials,node_foodreq,node_user toneBlue
class node_clean,node_requirements,node_clustering,node_representatives toneAmber
class node_mapping,node_safezone,node_matching,node_table toneMint
```

## Components

### Requirements and Data

- [Streamlit selector](https://github.com/whps0620/smartpack-finder/blob/main/app.py): `app.py`
- [Material profiles](https://github.com/whps0620/smartpack-finder/blob/main/materials_permeability.csv): `materials_permeability.csv`
- [Food requirements](https://github.com/whps0620/smartpack-finder/blob/main/food_requirements.csv): `food_requirements.csv`

### Permeability Analysis

- [Clean and aggregate](https://github.com/whps0620/smartpack-finder/blob/main/app.py): `app.py`
- [Requirement selection](https://github.com/whps0620/smartpack-finder/blob/main/app.py): `app.py`
- [Four-tier clustering](https://github.com/whps0620/smartpack-finder/blob/main/app.py): `app.py`
- [Representative materials](https://github.com/whps0620/smartpack-finder/blob/main/app.py): `app.py`

### Selection Results

- [Log-scale mapping](https://github.com/whps0620/smartpack-finder/blob/main/app.py): `app.py`
- [Requirement safe zone](https://github.com/whps0620/smartpack-finder/blob/main/app.py): `app.py`
- [Range matching](https://github.com/whps0620/smartpack-finder/blob/main/app.py): `app.py`
- [Matching materials table](https://github.com/whps0620/smartpack-finder/blob/main/app.py): `app.py`

### Other components

- **Packaging user**

## Connections

- Packaging user → Streamlit selector: sets requirements
- Streamlit selector → Material profiles: reads profiles
- Streamlit selector → Food requirements: reads limits
- Streamlit selector → Clean and aggregate: prepares data
- Streamlit selector → Requirement selection: selects limits
- Clean and aggregate → Four-tier clustering: scales and clusters
- Four-tier clustering → Representative materials: summarizes tiers
- Streamlit selector → Log-scale mapping: renders permeability
- Streamlit selector → Requirement safe zone: plots selected limits
- Streamlit selector → Range matching: filters ranges
- Range matching → Matching materials table: provides matches
- Representative materials → Log-scale mapping: labels clusters
- Requirement selection → Requirement safe zone: sets bounds
- Requirement selection → Range matching: sets bounds
