# synthestic/inf1103_projectgrpwork architecture

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

- Interactive diagram: https://gitdiagram.com/synthestic/inf1103_projectgrpwork
- Repository: https://github.com/synthestic/inf1103_projectgrpwork

## Overview

This is a terminal-based SME green-grant auditor. The main workflow collects a company profile and proposal, classifies its GHG scope and intervention through OpenRouter, then applies deterministic eligibility and subsidy rules and presents the decision. Applicants can also save and reload audit records. The README documents grant matching and subsidy calculations; these are represented within the rules component. Source excerpts establish the principal calls, while several menu and persistence details are documented in the README.

Main entry points: [`main.py`](https://github.com/synthestic/inf1103_projectgrpwork/blob/main/main.py) (Menu coordinator), [`ai_manager.py`](https://github.com/synthestic/inf1103_projectgrpwork/blob/main/ai_manager.py) (Proposal classification), [`io_manager.py`](https://github.com/synthestic/inf1103_projectgrpwork/blob/main/io_manager.py) (Profile intake), [`logic_manager.py`](https://github.com/synthestic/inf1103_projectgrpwork/blob/main/logic_manager.py) (Eligibility and subsidy rules)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Audit workflow"]
  node_orchestrator["Menu coordinator<br/>[main.py]"]
  node_classification["Proposal classification<br/>[ai_manager.py]"]
  node_grant_rules["Eligibility and subsidy rules<br/>[logic_manager.py]"]
end

subgraph group_experience["Terminal experience"]
  node_profile["Profile intake<br/>[io_manager.py]"]
  node_terminal["Terminal UI"]
  node_audit_display["Audit and decision display<br/>[io_manager.py]"]
end

subgraph group_records["Saved records"]
  node_record_session["Record session<br/>[main.py]"]
  node_json_records[("JSON record storage<br/>[data_manager.py]")]
end

node_applicant(("SME applicant"))
node_openrouter{{"OpenRouter AI"}}

node_applicant -->|"chooses options"| node_orchestrator
node_orchestrator -->|"collects profile"| node_profile
node_profile -->|"uses buttons"| node_terminal
node_orchestrator -->|"submits proposal"| node_classification
node_classification -->|"requests classification"| node_openrouter
node_classification -->|"runs progress display"| node_terminal
node_orchestrator -->|"evaluates application"| node_grant_rules
node_orchestrator -->|"displays results"| node_audit_display
node_grant_rules -->|"returns decision"| node_audit_display
node_applicant -->|"requests save or load"| node_record_session
node_orchestrator -->|"manages records"| node_record_session
node_record_session -->|"loads and saves"| node_json_records
node_json_records -->|"requests filename"| node_profile

click node_orchestrator "https://github.com/synthestic/inf1103_projectgrpwork/blob/main/main.py"
click node_profile "https://github.com/synthestic/inf1103_projectgrpwork/blob/main/io_manager.py"
click node_terminal "https://github.com/synthestic/inf1103_projectgrpwork/blob/main/sme_interface_stores/sme_interface_gui.py"
click node_classification "https://github.com/synthestic/inf1103_projectgrpwork/blob/main/ai_manager.py"
click node_grant_rules "https://github.com/synthestic/inf1103_projectgrpwork/blob/main/logic_manager.py"
click node_audit_display "https://github.com/synthestic/inf1103_projectgrpwork/blob/main/io_manager.py"
click node_record_session "https://github.com/synthestic/inf1103_projectgrpwork/blob/main/main.py"
click node_json_records "https://github.com/synthestic/inf1103_projectgrpwork/blob/main/data_manager.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_orchestrator,node_classification,node_grant_rules toneBlue
class node_profile,node_terminal,node_audit_display toneAmber
class node_record_session,node_json_records,node_openrouter toneMint
class node_applicant toneIndigo
```

## Components

### Audit workflow

- [Menu coordinator](https://github.com/synthestic/inf1103_projectgrpwork/blob/main/main.py): `main.py`
- [Proposal classification](https://github.com/synthestic/inf1103_projectgrpwork/blob/main/ai_manager.py): `ai_manager.py`
- [Eligibility and subsidy rules](https://github.com/synthestic/inf1103_projectgrpwork/blob/main/logic_manager.py): `logic_manager.py`

### Terminal experience

- [Profile intake](https://github.com/synthestic/inf1103_projectgrpwork/blob/main/io_manager.py): `io_manager.py`
- [Terminal UI](https://github.com/synthestic/inf1103_projectgrpwork/blob/main/sme_interface_stores/sme_interface_gui.py): `sme_interface_stores/sme_interface_gui.py`
- [Audit and decision display](https://github.com/synthestic/inf1103_projectgrpwork/blob/main/io_manager.py): `io_manager.py`

### Saved records

- [Record session](https://github.com/synthestic/inf1103_projectgrpwork/blob/main/main.py): `main.py`
- [JSON record storage](https://github.com/synthestic/inf1103_projectgrpwork/blob/main/data_manager.py): `data_manager.py`

### Other components

- **SME applicant**
- **OpenRouter AI**

## Connections

- SME applicant → Menu coordinator: chooses options (evidence: `README.md`)
- Menu coordinator → Profile intake: collects profile (evidence: `main.py`)
- Profile intake → Terminal UI: uses buttons (evidence: `io_manager.py`)
- Menu coordinator → Proposal classification: submits proposal (evidence: `main.py`)
- Proposal classification → OpenRouter AI: requests classification (evidence: `ai_manager.py`)
- Proposal classification → Terminal UI: runs progress display (evidence: `ai_manager.py`)
- Menu coordinator → Eligibility and subsidy rules: evaluates application (evidence: `main.py`)
- Menu coordinator → Audit and decision display: displays results (evidence: `main.py`)
- Eligibility and subsidy rules → Audit and decision display: returns decision (evidence: `README.md`)
- SME applicant → Record session: requests save or load (evidence: `README.md`)
- Menu coordinator → Record session: manages records (evidence: `main.py`)
- Record session → JSON record storage: loads and saves (evidence: `main.py`)
- JSON record storage → Profile intake: requests filename (evidence: `data_manager.py`)
