# froggoreng/ecobite-foodrescue architecture

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

- Interactive diagram: https://gitdiagram.com/froggoreng/ecobite-foodrescue
- Repository: https://github.com/froggoreng/ecobite-foodrescue

## Overview

EcoBite is a native Android community food-rescue app. Donors publish surplus listings; recipients search and reserve food with a pickup time; volunteers or recipients complete or cancel collection; users can review history and impact. The README documents SQLite transactions, local photo storage, validation, and status tracking. Source excerpts were not provided for app code, so relationships below rely on the README’s workflow and structure descriptions rather than inspected implementation details.

Main entry points: [`app/src/main/java/com/example/ecobite/MainActivity.kt`](https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/MainActivity.kt) (Main navigation), [`app/src/main/java/com/example/ecobite/data/local/EcoBiteDatabaseHelper.kt`](https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/data/local/EcoBiteDatabaseHelper.kt) (Local SQLite), [`app/src/main/java/com/example/ecobite/ui/history/HistoryFragment.kt`](https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/ui/history/HistoryFragment.kt) (History views), [`app/src/main/java/com/example/ecobite/ui/donate/AddFoodFragment.kt`](https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/ui/donate/AddFoodFragment.kt) (List surplus)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App navigation"]
  node_main["Main navigation<br/>[MainActivity.kt]"]
end

subgraph group_rescue["Food rescue workflow"]
  node_listing["List surplus<br/>[AddFoodFragment.kt]"]
  node_explore["Search and explore<br/>[ExploreFragment.kt]"]
  node_food_adapter["Listing cards<br/>[FoodAdapter.kt]"]
  node_rescue_ops["Collection status"]
  node_volunteer_adapter["Task cards"]
end

subgraph group_records["Records and impact"]
  node_reservations["Reservation records<br/>[Reservation.kt]"]
  node_database[("Local SQLite")]
  node_history["History views<br/>[HistoryFragment.kt]"]
  node_history_adapter["Collection cards<br/>[HistoryAdapter.kt]"]
  node_donation_adapter["Donation cards<br/>[DonationAdapter.kt]"]
  node_sample_data["Demo records<br/>[SampleData.kt]"]
end

subgraph group_shared["Shared domain services"]
  node_food_images["Food photos<br/>[FoodImages.kt]"]
  node_validation["Input validation<br/>[Validation.kt]"]
  node_models["Food and status models"]
  node_impact["Impact totals<br/>[Impact.kt]"]
  node_dialogs["Tracking timeline<br/>[Dialogs.kt]"]
end

node_donors(("Donors"))
node_recipients(("Recipients"))
node_volunteers(("Volunteers"))

node_donors -->|"use app"| node_main
node_recipients -->|"use app"| node_main
node_volunteers -->|"use app"| node_main
node_main -->|"opens tab"| node_listing
node_main -->|"opens tab"| node_explore
node_main -->|"opens tab"| node_rescue_ops
node_main -->|"opens tab"| node_history
node_donors -->|"lists surplus"| node_listing
node_listing -->|"validates listing"| node_validation
node_listing -->|"saves photo"| node_food_images
node_listing -->|"stores listing"| node_database
node_recipients -->|"searches food"| node_explore
node_explore -->|"shows listings"| node_food_adapter
node_explore -->|"validates reservation"| node_validation
node_explore -->|"reserves transactionally"| node_database
node_database -->|"persists reservation"| node_reservations
node_database -->|"stores domain data"| node_models
node_volunteers -->|"updates collection"| node_rescue_ops
node_rescue_ops -->|"logs status changes"| node_database
node_rescue_ops -->|"shows tasks"| node_volunteer_adapter
node_history -->|"reads records"| node_database
node_history -->|"shows collections"| node_history_adapter
node_history -->|"shows donations"| node_donation_adapter
node_history -->|"calculates totals"| node_impact
node_history -->|"shows timeline"| node_dialogs
node_database -->|"initializes demo data"| node_sample_data

click node_main "https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/MainActivity.kt"
click node_listing "https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/ui/donate/AddFoodFragment.kt"
click node_food_images "https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/util/FoodImages.kt"
click node_explore "https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/ui/explore/ExploreFragment.kt"
click node_food_adapter "https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/ui/explore/FoodAdapter.kt"
click node_validation "https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/util/Validation.kt"
click node_reservations "https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/data/model/Reservation.kt"
click node_database "https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/data/local/EcoBiteDatabaseHelper.kt"
click node_models "https://github.com/froggoreng/ecobite-foodrescue/tree/main/app/src/main/java/com/example/ecobite/data/model"
click node_rescue_ops "https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/ui/rescue/VolunteerFragment.kt"
click node_volunteer_adapter "https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/ui/rescue/VolunteerAdapter.kt"
click node_history "https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/ui/history/HistoryFragment.kt"
click node_history_adapter "https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/ui/history/HistoryAdapter.kt"
click node_donation_adapter "https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/ui/history/DonationAdapter.kt"
click node_impact "https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/util/Impact.kt"
click node_dialogs "https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/ui/common/Dialogs.kt"
click node_sample_data "https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/data/local/SampleData.kt"

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_main toneBlue
class node_listing,node_explore,node_food_adapter,node_rescue_ops,node_volunteer_adapter toneAmber
class node_reservations,node_database,node_history,node_history_adapter,node_donation_adapter,node_sample_data toneMint
class node_food_images,node_validation,node_models,node_impact,node_dialogs toneRose
class node_donors,node_recipients,node_volunteers toneIndigo
```

## Components

### App navigation

- [Main navigation](https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/MainActivity.kt): `app/src/main/java/com/example/ecobite/MainActivity.kt`

### Food rescue workflow

- [List surplus](https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/ui/donate/AddFoodFragment.kt): `app/src/main/java/com/example/ecobite/ui/donate/AddFoodFragment.kt`
- [Search and explore](https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/ui/explore/ExploreFragment.kt): `app/src/main/java/com/example/ecobite/ui/explore/ExploreFragment.kt`
- [Listing cards](https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/ui/explore/FoodAdapter.kt): `app/src/main/java/com/example/ecobite/ui/explore/FoodAdapter.kt`
- [Collection status](https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/ui/rescue/VolunteerFragment.kt): `app/src/main/java/com/example/ecobite/ui/rescue/VolunteerFragment.kt`
- [Task cards](https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/ui/rescue/VolunteerAdapter.kt): `app/src/main/java/com/example/ecobite/ui/rescue/VolunteerAdapter.kt`

### Records and impact

- [Reservation records](https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/data/model/Reservation.kt): `app/src/main/java/com/example/ecobite/data/model/Reservation.kt`
- [Local SQLite](https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/data/local/EcoBiteDatabaseHelper.kt): `app/src/main/java/com/example/ecobite/data/local/EcoBiteDatabaseHelper.kt`
- [History views](https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/ui/history/HistoryFragment.kt): `app/src/main/java/com/example/ecobite/ui/history/HistoryFragment.kt`
- [Collection cards](https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/ui/history/HistoryAdapter.kt): `app/src/main/java/com/example/ecobite/ui/history/HistoryAdapter.kt`
- [Donation cards](https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/ui/history/DonationAdapter.kt): `app/src/main/java/com/example/ecobite/ui/history/DonationAdapter.kt`
- [Demo records](https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/data/local/SampleData.kt): `app/src/main/java/com/example/ecobite/data/local/SampleData.kt`

### Shared domain services

- [Food photos](https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/util/FoodImages.kt): `app/src/main/java/com/example/ecobite/util/FoodImages.kt`
- [Input validation](https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/util/Validation.kt): `app/src/main/java/com/example/ecobite/util/Validation.kt`
- [Food and status models](https://github.com/froggoreng/ecobite-foodrescue/tree/main/app/src/main/java/com/example/ecobite/data/model): `app/src/main/java/com/example/ecobite/data/model`
- [Impact totals](https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/util/Impact.kt): `app/src/main/java/com/example/ecobite/util/Impact.kt`
- [Tracking timeline](https://github.com/froggoreng/ecobite-foodrescue/blob/main/app/src/main/java/com/example/ecobite/ui/common/Dialogs.kt): `app/src/main/java/com/example/ecobite/ui/common/Dialogs.kt`

### Other components

- **Donors**
- **Recipients**
- **Volunteers**

## Connections

- Donors → Main navigation: use app (evidence: `README.md`)
- Recipients → Main navigation: use app (evidence: `README.md`)
- Volunteers → Main navigation: use app (evidence: `README.md`)
- Main navigation → List surplus: opens tab (evidence: `README.md`)
- Main navigation → Search and explore: opens tab (evidence: `README.md`)
- Main navigation → Collection status: opens tab (evidence: `README.md`)
- Main navigation → History views: opens tab (evidence: `README.md`)
- Donors → List surplus: lists surplus (evidence: `README.md`)
- List surplus → Input validation: validates listing (evidence: `README.md`)
- List surplus → Food photos: saves photo (evidence: `README.md`)
- List surplus → Local SQLite: stores listing (evidence: `README.md`)
- Recipients → Search and explore: searches food (evidence: `README.md`)
- Search and explore → Listing cards: shows listings (evidence: `README.md`)
- Search and explore → Input validation: validates reservation (evidence: `README.md`)
- Search and explore → Local SQLite: reserves transactionally (evidence: `README.md`)
- Local SQLite → Reservation records: persists reservation (evidence: `README.md`)
- Local SQLite → Food and status models: stores domain data (evidence: `README.md`)
- Volunteers → Collection status: updates collection (evidence: `README.md`)
- Collection status → Local SQLite: logs status changes (evidence: `README.md`)
- Collection status → Task cards: shows tasks (evidence: `README.md`)
- History views → Local SQLite: reads records (evidence: `README.md`)
- History views → Collection cards: shows collections (evidence: `README.md`)
- History views → Donation cards: shows donations (evidence: `README.md`)
- History views → Impact totals: calculates totals (evidence: `README.md`)
- History views → Tracking timeline: shows timeline (evidence: `README.md`)
- Local SQLite → Demo records: initializes demo data (evidence: `README.md`)
