# reinhardtmarta/logiflow architecture

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

- Interactive diagram: https://gitdiagram.com/reinhardtmarta/logiflow
- Repository: https://github.com/reinhardtmarta/logiflow

## Overview

LogiFlow is a responsive food-rescue marketplace connecting sellers and consumers. The main workflow moves from browsing or searching surplus food, through seller inventory and listing management, to buyer–seller chat and local pickup coordination. Seller plans, AI-assisted rescue insights, and account management are additional capabilities. The graph reflects documented features and indexed imports; unsampled screens and service internals are represented at their exact paths, but their unverified connections are omitted or dashed.

Main entry points: [`src/services/store.ts`](https://github.com/reinhardtmarta/logiflow/blob/main/src/services/store.ts) (Application Store), [`src/App.tsx`](https://github.com/reinhardtmarta/logiflow/blob/main/src/App.tsx) (App Navigation), [`src/screens/GeneralFeedScreen.tsx`](https://github.com/reinhardtmarta/logiflow/blob/main/src/screens/GeneralFeedScreen.tsx) (Public Food Feed), [`src/screens/MarketplaceScreen.tsx`](https://github.com/reinhardtmarta/logiflow/blob/main/src/screens/MarketplaceScreen.tsx) (Marketplace)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_app["App Navigation<br/>[App.tsx]"]
  node_header["Header and Account Controls<br/>[Header.tsx]"]
  node_bottomnav["Bottom Navigation<br/>[BottomNav.tsx]"]
end

subgraph group_market["Food Marketplace"]
  node_feed["Public Food Feed"]
  node_feedbot["AI Rescue Feed<br/>[FeedBotScreen.tsx]"]
  node_assistant["Zero-Waste Assistant"]
  node_marketplace["Marketplace"]
  node_search["Food Search<br/>[SearchScreen.tsx]"]
  node_chat["Buyer-Seller Chat<br/>[ChatScreen.tsx]"]
  node_distance["Distance Bot<br/>[distanceBot.ts]"]
  node_distanceui["Distance Guidance"]
end

subgraph group_seller["Seller Operations"]
  node_addproduct["Product Listing"]
  node_stock["Stock Management<br/>[StockScreen.tsx]"]
  node_dashboard["Seller Dashboard"]
  node_featured["Featured Products"]
end

subgraph group_services["Platform Services"]
  node_store["Application Store<br/>[store.ts]"]
  node_firebase[("Firebase Services<br/>[firebase.ts]")]
  node_gemma["Gemma AI Service<br/>[gemmaService.ts]"]
  node_distanceutil["Location and Distance<br/>[distance.ts]"]
  node_language["Language Context"]
  node_i18n["Translations<br/>[i18n.ts]"]
  node_strings["Translation Strings<br/>[strings.ts]"]
  node_googlepay["Google Pay Service<br/>[googlePay.ts]"]
end

subgraph group_account["Account and Plans"]
  node_profile["User Profile"]
  node_auth["Google Sign-In<br/>[AuthScreen.tsx]"]
  node_terms["Terms and Privacy<br/>[TermsModal.tsx]"]
  node_deletion["Account Deletion"]
  node_upgrade["Seller Plans<br/>[UpgradeScreen.tsx]"]
  node_mpbot["Payment Security Flow"]
  node_paymentconfig["Payment Configuration<br/>[payment.ts]"]
end

node_consumer(("Consumer or Seller"))
node_browser["Browser Geolocation"]
node_google["Google Identity"]
node_mercadopago["Mercado Pago"]

node_consumer -->|"uses"| node_app
node_app -->|"renders"| node_header
node_app -->|"renders"| node_bottomnav
node_app -->|"routes to"| node_feed
node_app -->|"routes to"| node_marketplace
node_app -->|"routes to"| node_search
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_feedbot
node_app -->|"routes to"| node_profile
node_app -->|"reads user"| node_store
node_app -->|"opens sign-in"| node_auth
node_feed -->|"reads products"| node_store
node_feed -->|"requests guidance"| node_distance
node_feed -->|"opens modal"| node_distanceui
node_feedbot -->|"reads products"| node_store
node_feedbot -->|"uses distance"| node_distanceutil
node_assistant -.->|"requests AI insights"| node_gemma
node_marketplace -->|"reads products"| node_store
node_marketplace -->|"uses distance"| node_distanceutil
node_search -->|"searches products"| node_store
node_search -->|"formats distance"| node_distanceutil
node_marketplace -->|"opens chat"| node_chat
node_search -->|"opens chat"| node_chat
node_chat -->|"exchanges messages"| node_store
node_consumer -.->|"shares location"| node_browser
node_distanceutil -->|"requests coordinates"| node_browser
node_dashboard -->|"reads seller metrics"| node_store
node_dashboard -->|"opens listing"| node_addproduct
node_dashboard -->|"opens inventory"| node_stock
node_stock -->|"updates stock"| node_store
node_addproduct -->|"adds product"| node_store
node_featured -->|"updates featured item"| node_store
node_profile -->|"updates profile"| node_store
node_profile -->|"opens deletion"| node_deletion
node_profile -->|"opens terms"| node_terms
node_auth -->|"signs in with"| node_google
node_auth -->|"reads profile"| node_firebase
node_auth -->|"sets user"| node_store
node_store -->|"reads and writes"| node_firebase
node_upgrade -->|"updates plan"| node_store
node_upgrade -->|"uses payment service"| node_googlepay
node_upgrade -->|"opens payment flow"| node_mpbot
node_mpbot -->|"completes payment"| node_store
node_mpbot -->|"reads settings"| node_paymentconfig
node_mpbot -.->|"opens checkout"| node_mercadopago
node_app -->|"records payment return"| node_store
node_language -->|"subscribes and translates"| node_i18n
node_i18n -->|"reads translations"| node_strings

click node_app "https://github.com/reinhardtmarta/logiflow/blob/main/src/App.tsx"
click node_header "https://github.com/reinhardtmarta/logiflow/blob/main/src/components/Header.tsx"
click node_bottomnav "https://github.com/reinhardtmarta/logiflow/blob/main/src/components/BottomNav.tsx"
click node_feed "https://github.com/reinhardtmarta/logiflow/blob/main/src/screens/GeneralFeedScreen.tsx"
click node_feedbot "https://github.com/reinhardtmarta/logiflow/blob/main/src/screens/FeedBotScreen.tsx"
click node_assistant "https://github.com/reinhardtmarta/logiflow/blob/main/src/screens/AiAssistantScreen.tsx"
click node_marketplace "https://github.com/reinhardtmarta/logiflow/blob/main/src/screens/MarketplaceScreen.tsx"
click node_search "https://github.com/reinhardtmarta/logiflow/blob/main/src/screens/SearchScreen.tsx"
click node_chat "https://github.com/reinhardtmarta/logiflow/blob/main/src/screens/ChatScreen.tsx"
click node_distance "https://github.com/reinhardtmarta/logiflow/blob/main/src/services/distanceBot.ts"
click node_distanceui "https://github.com/reinhardtmarta/logiflow/blob/main/src/components/DistanceBotModal.tsx"
click node_addproduct "https://github.com/reinhardtmarta/logiflow/blob/main/src/screens/AddProductModal.tsx"
click node_stock "https://github.com/reinhardtmarta/logiflow/blob/main/src/screens/StockScreen.tsx"
click node_dashboard "https://github.com/reinhardtmarta/logiflow/blob/main/src/screens/SellerDashboard.tsx"
click node_featured "https://github.com/reinhardtmarta/logiflow/blob/main/src/screens/SelectFeaturedScreen.tsx"
click node_profile "https://github.com/reinhardtmarta/logiflow/blob/main/src/screens/UserProfileScreen.tsx"
click node_auth "https://github.com/reinhardtmarta/logiflow/blob/main/src/screens/AuthScreen.tsx"
click node_terms "https://github.com/reinhardtmarta/logiflow/blob/main/src/components/TermsModal.tsx"
click node_deletion "https://github.com/reinhardtmarta/logiflow/blob/main/src/components/AccountDeletionModal.tsx"
click node_upgrade "https://github.com/reinhardtmarta/logiflow/blob/main/src/screens/UpgradeScreen.tsx"
click node_mpbot "https://github.com/reinhardtmarta/logiflow/blob/main/src/components/MercadoPagoSecurityBot.tsx"
click node_paymentconfig "https://github.com/reinhardtmarta/logiflow/blob/main/src/config/payment.ts"
click node_store "https://github.com/reinhardtmarta/logiflow/blob/main/src/services/store.ts"
click node_firebase "https://github.com/reinhardtmarta/logiflow/blob/main/src/services/firebase.ts"
click node_gemma "https://github.com/reinhardtmarta/logiflow/blob/main/src/services/gemmaService.ts"
click node_distanceutil "https://github.com/reinhardtmarta/logiflow/blob/main/src/utils/distance.ts"
click node_language "https://github.com/reinhardtmarta/logiflow/blob/main/src/context/LanguageContext.tsx"
click node_i18n "https://github.com/reinhardtmarta/logiflow/blob/main/src/services/i18n.ts"
click node_strings "https://github.com/reinhardtmarta/logiflow/blob/main/src/res/strings.ts"
click node_googlepay "https://github.com/reinhardtmarta/logiflow/blob/main/src/services/googlePay.ts"

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_header,node_bottomnav,node_browser toneBlue
class node_feed,node_feedbot,node_assistant,node_marketplace,node_search,node_chat,node_distance,node_distanceui toneAmber
class node_addproduct,node_stock,node_dashboard,node_featured toneMint
class node_store,node_firebase,node_gemma,node_distanceutil,node_language,node_i18n,node_strings,node_googlepay toneRose
class node_profile,node_auth,node_terms,node_deletion,node_upgrade,node_mpbot,node_paymentconfig,node_consumer,node_google,node_mercadopago toneIndigo
```

## Components

### Application

- [App Navigation](https://github.com/reinhardtmarta/logiflow/blob/main/src/App.tsx): `src/App.tsx`
- [Header and Account Controls](https://github.com/reinhardtmarta/logiflow/blob/main/src/components/Header.tsx): `src/components/Header.tsx`
- [Bottom Navigation](https://github.com/reinhardtmarta/logiflow/blob/main/src/components/BottomNav.tsx): `src/components/BottomNav.tsx`

### Food Marketplace

- [Public Food Feed](https://github.com/reinhardtmarta/logiflow/blob/main/src/screens/GeneralFeedScreen.tsx): `src/screens/GeneralFeedScreen.tsx`
- [AI Rescue Feed](https://github.com/reinhardtmarta/logiflow/blob/main/src/screens/FeedBotScreen.tsx): `src/screens/FeedBotScreen.tsx`
- [Zero-Waste Assistant](https://github.com/reinhardtmarta/logiflow/blob/main/src/screens/AiAssistantScreen.tsx): `src/screens/AiAssistantScreen.tsx`
- [Marketplace](https://github.com/reinhardtmarta/logiflow/blob/main/src/screens/MarketplaceScreen.tsx): `src/screens/MarketplaceScreen.tsx`
- [Food Search](https://github.com/reinhardtmarta/logiflow/blob/main/src/screens/SearchScreen.tsx): `src/screens/SearchScreen.tsx`
- [Buyer-Seller Chat](https://github.com/reinhardtmarta/logiflow/blob/main/src/screens/ChatScreen.tsx): `src/screens/ChatScreen.tsx`
- [Distance Bot](https://github.com/reinhardtmarta/logiflow/blob/main/src/services/distanceBot.ts): `src/services/distanceBot.ts`
- [Distance Guidance](https://github.com/reinhardtmarta/logiflow/blob/main/src/components/DistanceBotModal.tsx): `src/components/DistanceBotModal.tsx`

### Seller Operations

- [Product Listing](https://github.com/reinhardtmarta/logiflow/blob/main/src/screens/AddProductModal.tsx): `src/screens/AddProductModal.tsx`
- [Stock Management](https://github.com/reinhardtmarta/logiflow/blob/main/src/screens/StockScreen.tsx): `src/screens/StockScreen.tsx`
- [Seller Dashboard](https://github.com/reinhardtmarta/logiflow/blob/main/src/screens/SellerDashboard.tsx): `src/screens/SellerDashboard.tsx`
- [Featured Products](https://github.com/reinhardtmarta/logiflow/blob/main/src/screens/SelectFeaturedScreen.tsx): `src/screens/SelectFeaturedScreen.tsx`

### Platform Services

- [Application Store](https://github.com/reinhardtmarta/logiflow/blob/main/src/services/store.ts): `src/services/store.ts`
- [Firebase Services](https://github.com/reinhardtmarta/logiflow/blob/main/src/services/firebase.ts): `src/services/firebase.ts`
- [Gemma AI Service](https://github.com/reinhardtmarta/logiflow/blob/main/src/services/gemmaService.ts): `src/services/gemmaService.ts`
- [Location and Distance](https://github.com/reinhardtmarta/logiflow/blob/main/src/utils/distance.ts): `src/utils/distance.ts`
- [Language Context](https://github.com/reinhardtmarta/logiflow/blob/main/src/context/LanguageContext.tsx): `src/context/LanguageContext.tsx`
- [Translations](https://github.com/reinhardtmarta/logiflow/blob/main/src/services/i18n.ts): `src/services/i18n.ts`
- [Translation Strings](https://github.com/reinhardtmarta/logiflow/blob/main/src/res/strings.ts): `src/res/strings.ts`
- [Google Pay Service](https://github.com/reinhardtmarta/logiflow/blob/main/src/services/googlePay.ts): `src/services/googlePay.ts`

### Account and Plans

- [User Profile](https://github.com/reinhardtmarta/logiflow/blob/main/src/screens/UserProfileScreen.tsx): `src/screens/UserProfileScreen.tsx`
- [Google Sign-In](https://github.com/reinhardtmarta/logiflow/blob/main/src/screens/AuthScreen.tsx): `src/screens/AuthScreen.tsx`
- [Terms and Privacy](https://github.com/reinhardtmarta/logiflow/blob/main/src/components/TermsModal.tsx): `src/components/TermsModal.tsx`
- [Account Deletion](https://github.com/reinhardtmarta/logiflow/blob/main/src/components/AccountDeletionModal.tsx): `src/components/AccountDeletionModal.tsx`
- [Seller Plans](https://github.com/reinhardtmarta/logiflow/blob/main/src/screens/UpgradeScreen.tsx): `src/screens/UpgradeScreen.tsx`
- [Payment Security Flow](https://github.com/reinhardtmarta/logiflow/blob/main/src/components/MercadoPagoSecurityBot.tsx): `src/components/MercadoPagoSecurityBot.tsx`
- [Payment Configuration](https://github.com/reinhardtmarta/logiflow/blob/main/src/config/payment.ts): `src/config/payment.ts`

### Other components

- **Consumer or Seller**
- **Browser Geolocation**
- **Google Identity**
- **Mercado Pago**

## Connections

- Consumer or Seller → App Navigation: uses
- App Navigation → Header and Account Controls: renders (evidence: `src/App.tsx`)
- App Navigation → Bottom Navigation: renders (evidence: `src/App.tsx`)
- App Navigation → Public Food Feed: routes to (evidence: `src/App.tsx`)
- App Navigation → Marketplace: routes to (evidence: `src/App.tsx`)
- App Navigation → Food Search: routes to (evidence: `src/App.tsx`)
- App Navigation → Seller Dashboard: routes to (evidence: `src/App.tsx`)
- App Navigation → AI Rescue Feed: routes to (evidence: `src/App.tsx`)
- App Navigation → User Profile: routes to (evidence: `src/App.tsx`)
- App Navigation → Application Store: reads user (evidence: `src/App.tsx`)
- App Navigation → Google Sign-In: opens sign-in (evidence: `src/App.tsx`)
- Public Food Feed → Application Store: reads products (evidence: `src/screens/GeneralFeedScreen.tsx`)
- Public Food Feed → Distance Bot: requests guidance (evidence: `src/screens/GeneralFeedScreen.tsx`)
- Public Food Feed → Distance Guidance: opens modal (evidence: `src/screens/GeneralFeedScreen.tsx`)
- AI Rescue Feed → Application Store: reads products (evidence: `src/screens/FeedBotScreen.tsx`)
- AI Rescue Feed → Location and Distance: uses distance (evidence: `src/screens/FeedBotScreen.tsx`)
- Zero-Waste Assistant → Gemma AI Service: requests AI insights
- Marketplace → Application Store: reads products (evidence: `src/screens/MarketplaceScreen.tsx`)
- Marketplace → Location and Distance: uses distance (evidence: `src/screens/MarketplaceScreen.tsx`)
- Food Search → Application Store: searches products (evidence: `src/screens/SearchScreen.tsx`)
- Food Search → Location and Distance: formats distance (evidence: `src/screens/SearchScreen.tsx`)
- Marketplace → Buyer-Seller Chat: opens chat (evidence: `src/App.tsx`)
- Food Search → Buyer-Seller Chat: opens chat (evidence: `src/screens/SearchScreen.tsx`)
- Buyer-Seller Chat → Application Store: exchanges messages (evidence: `src/screens/ChatScreen.tsx`)
- Consumer or Seller → Browser Geolocation: shares location
- Location and Distance → Browser Geolocation: requests coordinates (evidence: `src/utils/distance.ts`)
- Seller Dashboard → Application Store: reads seller metrics (evidence: `src/screens/SellerDashboard.tsx`)
- Seller Dashboard → Product Listing: opens listing (evidence: `src/App.tsx`)
- Seller Dashboard → Stock Management: opens inventory (evidence: `src/App.tsx`)
- Stock Management → Application Store: updates stock (evidence: `src/screens/StockScreen.tsx`)
- Product Listing → Application Store: adds product (evidence: `src/screens/AddProductModal.tsx`)
- Featured Products → Application Store: updates featured item (evidence: `src/screens/SelectFeaturedScreen.tsx`)
- User Profile → Application Store: updates profile (evidence: `src/screens/UserProfileScreen.tsx`)
- User Profile → Account Deletion: opens deletion (evidence: `src/screens/UserProfileScreen.tsx`)
- User Profile → Terms and Privacy: opens terms (evidence: `src/screens/UserProfileScreen.tsx`)
- Google Sign-In → Google Identity: signs in with (evidence: `src/screens/AuthScreen.tsx`)
- Google Sign-In → Firebase Services: reads profile (evidence: `src/screens/AuthScreen.tsx`)
- Google Sign-In → Application Store: sets user (evidence: `src/screens/AuthScreen.tsx`)
- Application Store → Firebase Services: reads and writes (evidence: `src/services/store.ts`)
- Seller Plans → Application Store: updates plan (evidence: `src/screens/UpgradeScreen.tsx`)
- Seller Plans → Google Pay Service: uses payment service (evidence: `src/screens/UpgradeScreen.tsx`)
- Seller Plans → Payment Security Flow: opens payment flow (evidence: `src/screens/UpgradeScreen.tsx`)
- Payment Security Flow → Application Store: completes payment (evidence: `src/components/MercadoPagoSecurityBot.tsx`)
- Payment Security Flow → Payment Configuration: reads settings (evidence: `src/components/MercadoPagoSecurityBot.tsx`)
- Payment Security Flow → Mercado Pago: opens checkout
- App Navigation → Application Store: records payment return (evidence: `src/App.tsx`)
- Language Context → Translations: subscribes and translates (evidence: `src/context/LanguageContext.tsx`)
- Translations → Translation Strings: reads translations (evidence: `src/services/i18n.ts`)
