# benjiavdullahu/fridgebuddy architecture

> Architecture diagram of the GitHub repository benjiavdullahu/fridgebuddy, 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/benjiavdullahu/fridgebuddy
- Repository: https://github.com/benjiavdullahu/fridgebuddy
- Video tour (about a minute): https://gitdiagram.com/benjiavdullahu/fridgebuddy/video

## Overview

FoodStorage is a React Native app for tracking stored foods and finding recipes from ingredients. The main workflow is to open the inventory or capture a food photo, enter item details and expiry, save locally, and browse recipes for an item. App startup initializes SQLite and requests notification permission; saving an item schedules expiry reminders. The README also describes offline storage, image capture, and paginated recipe browsing. Source excerpts support the main screen, persistence, recipe, and notification connections; other documented details are represented only where their owning module is evident.

Main entry points: [`App.js`](https://github.com/benjiavdullahu/fridgebuddy/blob/master/App.js) (App and navigation), [`components/ItemList.js`](https://github.com/benjiavdullahu/fridgebuddy/blob/master/components/ItemList.js) (Item list), [`components/ItemForm.js`](https://github.com/benjiavdullahu/fridgebuddy/blob/master/components/ItemForm.js) (Item form), [`database/database.js`](https://github.com/benjiavdullahu/fridgebuddy/blob/master/database/database.js) (SQLite access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App navigation"]
  node_app_entry["App and navigation<br/>[App.js]"]
  node_home["Home<br/>[Home.js]"]
end

subgraph group_inventory["Food inventory"]
  node_camera["Food camera<br/>[CameraComponent.js]"]
  node_item_form["Item form<br/>[ItemForm.js]"]
  node_item_list["Item list<br/>[ItemList.js]"]
  node_database_layer["SQLite access<br/>[database.js]"]
  node_items_db[("Local items database")]
end

subgraph group_recipes["Recipe discovery"]
  node_recipe_view["Recipe browser<br/>[RecipeView.js]"]
  node_recipe_api["Recipe API client<br/>[recipes.js]"]
end

node_user(("FoodStorage user"))
node_mealdb["TheMealDB"]
node_camera_service["Device camera"]
node_notifications["Expo notifications"]

node_user -->|"opens app"| node_app_entry
node_app_entry -->|"routes to"| node_home
node_app_entry -->|"initializes"| node_database_layer
node_app_entry -->|"requests permission"| node_notifications
node_home -->|"opens inventory"| node_item_list
node_home -->|"opens camera"| node_camera
node_camera -->|"captures photo"| node_camera_service
node_camera -->|"passes image"| node_item_form
node_item_form -->|"saves or updates"| node_database_layer
node_database_layer -->|"reads and writes"| node_items_db
node_item_form -->|"schedules reminders"| node_notifications
node_item_list -->|"loads or deletes"| node_database_layer
node_item_list -->|"opens for editing"| node_item_form
node_item_list -->|"opens recipes"| node_recipe_view
node_recipe_view -->|"requests recipes"| node_recipe_api
node_recipe_api -->|"fetches recipes"| node_mealdb

click node_app_entry "https://github.com/benjiavdullahu/fridgebuddy/blob/master/App.js"
click node_home "https://github.com/benjiavdullahu/fridgebuddy/blob/master/components/Home.js"
click node_camera "https://github.com/benjiavdullahu/fridgebuddy/blob/master/components/CameraComponent.js"
click node_item_form "https://github.com/benjiavdullahu/fridgebuddy/blob/master/components/ItemForm.js"
click node_item_list "https://github.com/benjiavdullahu/fridgebuddy/blob/master/components/ItemList.js"
click node_database_layer "https://github.com/benjiavdullahu/fridgebuddy/blob/master/database/database.js"
click node_recipe_view "https://github.com/benjiavdullahu/fridgebuddy/blob/master/components/RecipeView.js"
click node_recipe_api "https://github.com/benjiavdullahu/fridgebuddy/blob/master/api/recipes.js"

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_entry,node_home toneBlue
class node_camera,node_item_form,node_item_list,node_database_layer,node_items_db,node_user toneAmber
class node_recipe_view,node_recipe_api toneMint
class node_mealdb,node_camera_service,node_notifications toneIndigo
```

## Components

### App navigation

- [App and navigation](https://github.com/benjiavdullahu/fridgebuddy/blob/master/App.js): `App.js`
- [Home](https://github.com/benjiavdullahu/fridgebuddy/blob/master/components/Home.js): `components/Home.js`

### Food inventory

- [Food camera](https://github.com/benjiavdullahu/fridgebuddy/blob/master/components/CameraComponent.js): `components/CameraComponent.js`
- [Item form](https://github.com/benjiavdullahu/fridgebuddy/blob/master/components/ItemForm.js): `components/ItemForm.js`
- [Item list](https://github.com/benjiavdullahu/fridgebuddy/blob/master/components/ItemList.js): `components/ItemList.js`
- [SQLite access](https://github.com/benjiavdullahu/fridgebuddy/blob/master/database/database.js): `database/database.js`
- **Local items database**

### Recipe discovery

- [Recipe browser](https://github.com/benjiavdullahu/fridgebuddy/blob/master/components/RecipeView.js): `components/RecipeView.js`
- [Recipe API client](https://github.com/benjiavdullahu/fridgebuddy/blob/master/api/recipes.js): `api/recipes.js`

### Other components

- **FoodStorage user**
- **TheMealDB**
- **Device camera**
- **Expo notifications**

## Connections

- FoodStorage user → App and navigation: opens app
- App and navigation → Home: routes to
- App and navigation → SQLite access: initializes
- App and navigation → Expo notifications: requests permission
- Home → Item list: opens inventory
- Home → Food camera: opens camera
- Food camera → Device camera: captures photo
- Food camera → Item form: passes image
- Item form → SQLite access: saves or updates
- SQLite access → Local items database: reads and writes
- Item form → Expo notifications: schedules reminders
- Item list → SQLite access: loads or deletes
- Item list → Item form: opens for editing
- Item list → Recipe browser: opens recipes
- Recipe browser → Recipe API client: requests recipes
- Recipe API client → TheMealDB: fetches recipes
