# bigsmellyhead/26inf1103p5-7 architecture

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

- Interactive diagram: https://gitdiagram.com/bigsmellyhead/26inf1103p5-7
- Repository: https://github.com/bigsmellyhead/26inf1103p5-7

## Overview

This is a command-line hawker-food dietary and ingredient safety auditor. A user sets or updates a restriction profile, enters a stall and dish, receives an AI-generated assessment that is adjusted by deterministic safety rules, and sees the report; audit records are persisted locally. The catalog supports restriction selection, while the ingredient tree and cross-contact considerations are part of the assessment. The main orchestration and module calls are shown in source; the README is empty, and some implementation details are unsampled.

Main entry points: [`main.py`](https://github.com/bigsmellyhead/26inf1103p5-7/blob/main/main.py) (Audit orchestration), [`io_manager.py`](https://github.com/bigsmellyhead/26inf1103p5-7/blob/main/io_manager.py) (Profile and audit input), [`ai_manager.py`](https://github.com/bigsmellyhead/26inf1103p5-7/blob/main/ai_manager.py) (AI safety assessment), [`data_manager.py`](https://github.com/bigsmellyhead/26inf1103p5-7/blob/main/data_manager.py) (Audit log access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["CLI interaction"]
  node_app["Audit orchestration<br/>[main.py]"]
  node_cli_inputs["Profile and audit input<br/>[io_manager.py]"]
  node_restriction_catalog["Restriction catalog"]
  node_report["Audit report display<br/>[io_manager.py]"]
end

subgraph group_assessment["Safety assessment"]
  node_ai_assessment["AI safety assessment<br/>[ai_manager.py]"]
  node_ingredient_tree["Ingredient breakdown<br/>[ai_manager.py]"]
  node_rule_processing["Safety rule processing<br/>[logic_manager.py]"]
end

subgraph group_persistence["Local persistence"]
  node_profile_access["Profile access<br/>[data_manager.py]"]
  node_audit_access["Audit log access<br/>[data_manager.py]"]
  node_history_file[("Audit history JSON<br/>[audit_history.json]")]
end

subgraph group_integrations["External service"]
  node_gemini["Gemini API"]
end

node_user(("User"))

node_user -->|"provides input"| node_cli_inputs
node_cli_inputs -->|"uses options"| node_restriction_catalog
node_app -->|"initializes and retrieves"| node_profile_access
node_cli_inputs -->|"reads and saves profile"| node_profile_access
node_app -->|"collects audit details"| node_cli_inputs
node_app -->|"requests assessment"| node_ai_assessment
node_ai_assessment -->|"requests generation"| node_gemini
node_ai_assessment -->|"produces breakdown"| node_ingredient_tree
node_app -->|"processes assessment"| node_rule_processing
node_app -->|"appends audit record"| node_audit_access
node_audit_access -->|"reads and writes"| node_history_file
node_app -->|"displays result"| node_report
node_report -->|"prints report"| node_user

click node_app "https://github.com/bigsmellyhead/26inf1103p5-7/blob/main/main.py"
click node_cli_inputs "https://github.com/bigsmellyhead/26inf1103p5-7/blob/main/io_manager.py"
click node_restriction_catalog "https://github.com/bigsmellyhead/26inf1103p5-7/blob/main/allergen_catalog.py"
click node_report "https://github.com/bigsmellyhead/26inf1103p5-7/blob/main/io_manager.py"
click node_ai_assessment "https://github.com/bigsmellyhead/26inf1103p5-7/blob/main/ai_manager.py"
click node_ingredient_tree "https://github.com/bigsmellyhead/26inf1103p5-7/blob/main/ai_manager.py"
click node_rule_processing "https://github.com/bigsmellyhead/26inf1103p5-7/blob/main/logic_manager.py"
click node_profile_access "https://github.com/bigsmellyhead/26inf1103p5-7/blob/main/data_manager.py"
click node_audit_access "https://github.com/bigsmellyhead/26inf1103p5-7/blob/main/data_manager.py"
click node_history_file "https://github.com/bigsmellyhead/26inf1103p5-7/blob/main/audit_history.json"

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_cli_inputs,node_restriction_catalog,node_report,node_user toneBlue
class node_ai_assessment,node_ingredient_tree,node_rule_processing toneAmber
class node_profile_access,node_audit_access,node_history_file toneMint
class node_gemini toneRose
```

## Components

### CLI interaction

- [Audit orchestration](https://github.com/bigsmellyhead/26inf1103p5-7/blob/main/main.py): `main.py`
- [Profile and audit input](https://github.com/bigsmellyhead/26inf1103p5-7/blob/main/io_manager.py): `io_manager.py`
- [Restriction catalog](https://github.com/bigsmellyhead/26inf1103p5-7/blob/main/allergen_catalog.py): `allergen_catalog.py`
- [Audit report display](https://github.com/bigsmellyhead/26inf1103p5-7/blob/main/io_manager.py): `io_manager.py`

### Safety assessment

- [AI safety assessment](https://github.com/bigsmellyhead/26inf1103p5-7/blob/main/ai_manager.py): `ai_manager.py`
- [Ingredient breakdown](https://github.com/bigsmellyhead/26inf1103p5-7/blob/main/ai_manager.py): `ai_manager.py`
- [Safety rule processing](https://github.com/bigsmellyhead/26inf1103p5-7/blob/main/logic_manager.py): `logic_manager.py`

### Local persistence

- [Profile access](https://github.com/bigsmellyhead/26inf1103p5-7/blob/main/data_manager.py): `data_manager.py`
- [Audit log access](https://github.com/bigsmellyhead/26inf1103p5-7/blob/main/data_manager.py): `data_manager.py`
- [Audit history JSON](https://github.com/bigsmellyhead/26inf1103p5-7/blob/main/audit_history.json): `audit_history.json`

### External service

- **Gemini API**

### Other components

- **User**

## Connections

- User → Profile and audit input: provides input (evidence: `io_manager.py`)
- Profile and audit input → Restriction catalog: uses options (evidence: `io_manager.py`)
- Audit orchestration → Profile access: initializes and retrieves (evidence: `main.py`)
- Profile and audit input → Profile access: reads and saves profile (evidence: `io_manager.py`)
- Audit orchestration → Profile and audit input: collects audit details (evidence: `main.py`)
- Audit orchestration → AI safety assessment: requests assessment (evidence: `main.py`)
- AI safety assessment → Gemini API: requests generation (evidence: `ai_manager.py`)
- AI safety assessment → Ingredient breakdown: produces breakdown (evidence: `ai_manager.py`)
- Audit orchestration → Safety rule processing: processes assessment (evidence: `main.py`)
- Audit orchestration → Audit log access: appends audit record (evidence: `main.py`)
- Audit log access → Audit history JSON: reads and writes (evidence: `data_manager.py`)
- Audit orchestration → Audit report display: displays result (evidence: `main.py`)
- Audit report display → User: prints report (evidence: `io_manager.py`)
