# eraycancoban/ifridge architecture

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

- Interactive diagram: https://gitdiagram.com/eraycancoban/ifridge
- Repository: https://github.com/eraycancoban/ifridge

## Overview

iFridge is a Flutter app for tracking refrigerator ingredients and getting AI-generated recipes from ingredients on hand. The documented user workflow is managing an ingredient list, then asking the chatbot for recipes using those ingredients. The tree also shows authentication and profile screens, but their behavior and wiring were not sampled, so those relationships are omitted. Product relationships below are based on the README; Dart implementation details were not available in the excerpts.

Main entry points: [`lib/screens/chatscreengpt.dart`](https://github.com/eraycancoban/ifridge/blob/master/lib/screens/chatscreengpt.dart) (Recipe Chat), [`lib/screens/fridgelist.dart`](https://github.com/eraycancoban/ifridge/blob/master/lib/screens/fridgelist.dart) (Fridge List), [`lib/screens/api_key.dart`](https://github.com/eraycancoban/ifridge/blob/master/lib/screens/api_key.dart) (API Key Setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App Shell"]
  node_entry["App Entry<br/>[main.dart]"]
end

subgraph group_inventory["Ingredient Inventory"]
  node_fridge["Fridge List<br/>[fridgelist.dart]"]
end

subgraph group_recipes["Recipe Chat"]
  node_chat["Recipe Chat<br/>[chatscreengpt.dart]"]
  node_messages["Chat Messages<br/>[message.dart]"]
  node_api_key["API Key Setup<br/>[api_key.dart]"]
end

subgraph group_accounts["Account Screens"]
  node_login["Login<br/>[loginpage.dart]"]
  node_signup["Sign Up<br/>[signuppage.dart]"]
  node_password["Password<br/>[passwordpage.dart]"]
  node_profile["User Profile<br/>[userprofile.dart]"]
end

node_user(("User"))
node_openai["OpenAI API"]

node_user -->|"manages ingredients"| node_fridge
node_user -->|"requests recipes"| node_chat
node_fridge -->|"provides ingredients"| node_chat
node_chat -->|"requests recipes"| node_openai
node_api_key -->|"configures access"| node_openai

click node_entry "https://github.com/eraycancoban/ifridge/blob/master/lib/main.dart"
click node_fridge "https://github.com/eraycancoban/ifridge/blob/master/lib/screens/fridgelist.dart"
click node_chat "https://github.com/eraycancoban/ifridge/blob/master/lib/screens/chatscreengpt.dart"
click node_messages "https://github.com/eraycancoban/ifridge/blob/master/lib/screens/message.dart"
click node_api_key "https://github.com/eraycancoban/ifridge/blob/master/lib/screens/api_key.dart"
click node_login "https://github.com/eraycancoban/ifridge/blob/master/lib/screens/loginpage.dart"
click node_signup "https://github.com/eraycancoban/ifridge/blob/master/lib/screens/signuppage.dart"
click node_password "https://github.com/eraycancoban/ifridge/blob/master/lib/screens/passwordpage.dart"
click node_profile "https://github.com/eraycancoban/ifridge/blob/master/lib/screens/userprofile.dart"

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_entry,node_user toneBlue
class node_fridge toneAmber
class node_chat,node_messages,node_api_key,node_openai toneMint
class node_login,node_signup,node_password,node_profile toneRose
```

## Components

### App Shell

- [App Entry](https://github.com/eraycancoban/ifridge/blob/master/lib/main.dart): `lib/main.dart`

### Ingredient Inventory

- [Fridge List](https://github.com/eraycancoban/ifridge/blob/master/lib/screens/fridgelist.dart): `lib/screens/fridgelist.dart`

### Recipe Chat

- [Recipe Chat](https://github.com/eraycancoban/ifridge/blob/master/lib/screens/chatscreengpt.dart): `lib/screens/chatscreengpt.dart`
- [Chat Messages](https://github.com/eraycancoban/ifridge/blob/master/lib/screens/message.dart): `lib/screens/message.dart`
- [API Key Setup](https://github.com/eraycancoban/ifridge/blob/master/lib/screens/api_key.dart): `lib/screens/api_key.dart`

### Account Screens

- [Login](https://github.com/eraycancoban/ifridge/blob/master/lib/screens/loginpage.dart): `lib/screens/loginpage.dart`
- [Sign Up](https://github.com/eraycancoban/ifridge/blob/master/lib/screens/signuppage.dart): `lib/screens/signuppage.dart`
- [Password](https://github.com/eraycancoban/ifridge/blob/master/lib/screens/passwordpage.dart): `lib/screens/passwordpage.dart`
- [User Profile](https://github.com/eraycancoban/ifridge/blob/master/lib/screens/userprofile.dart): `lib/screens/userprofile.dart`

### Other components

- **User**
- **OpenAI API**

## Connections

- User → Fridge List: manages ingredients (evidence: `README.md`)
- User → Recipe Chat: requests recipes (evidence: `README.md`)
- Fridge List → Recipe Chat: provides ingredients (evidence: `README.md`)
- Recipe Chat → OpenAI API: requests recipes (evidence: `README.md`)
- API Key Setup → OpenAI API: configures access (evidence: `README.md`)
