# nereu-vitor/localeats architecture

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

- Interactive diagram: https://gitdiagram.com/nereu-vitor/localeats
- Repository: https://github.com/nereu-vitor/localeats

## Overview

LocalEats is a restaurant digital-menu and lightweight merchant-management web app. Customers browse a live product menu, filter by search and categories, build a Redux cart, choose delivery, pickup, or dine-in, and submit checkout; the server formats the order for WhatsApp and optionally emails it through Resend. Merchants enter the PIN-gated admin panel to review products, change availability, and add or delete products. The graph reflects sampled source and README capabilities; some menu and admin UI wiring is documented but its implementation was not sampled.

Main entry points: [`src/lib/supabase.ts`](https://github.com/nereu-vitor/localeats/blob/main/src/lib/supabase.ts) (Supabase client), [`src/app/page.tsx`](https://github.com/nereu-vitor/localeats/blob/main/src/app/page.tsx) (Public menu page), [`src/components/menu/menu-view.tsx`](https://github.com/nereu-vitor/localeats/blob/main/src/components/menu/menu-view.tsx) (Menu browsing), [`src/components/menu/cart-sheet.tsx`](https://github.com/nereu-vitor/localeats/blob/main/src/components/menu/cart-sheet.tsx) (Cart interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer_menu["Customer menu"]
  node_menu_page["Public menu page<br/>[page.tsx]"]
  node_menu_view["Menu browsing<br/>[menu-view.tsx]"]
  node_category_tabs["Category tabs<br/>[category-tabs.tsx]"]
  node_product_card["Product cards<br/>[product-card.tsx]"]
  node_menu_header["Search header<br/>[menu-header.tsx]"]
end

subgraph group_ordering["Cart and checkout"]
  node_cart_sheet["Cart interface<br/>[cart-sheet.tsx]"]
  node_checkout_modal["Checkout details<br/>[checkout-modal.tsx]"]
  node_checkout_api["Order formatting<br/>[route.ts]"]
  node_cart_slice["Cart state<br/>[cartSlice.ts]"]
  node_store_config["Redux store<br/>[store.ts]"]
  node_redux_provider["Redux provider<br/>[redux-provider.tsx]"]
end

subgraph group_merchant["Merchant management"]
  node_admin_page["PIN admin panel<br/>[page.tsx]"]
  node_add_product["Product creation"]
end

subgraph group_data_services["Data and services"]
  node_supabase_client["Supabase client<br/>[supabase.ts]"]
  node_products_db[("Products table")]
  node_whatsapp["Restaurant WhatsApp"]
  node_resend["Resend email"]
end

node_customer(("Customer"))
node_merchant_user(("Merchant"))

node_customer -->|"opens menu"| node_menu_page
node_menu_page -->|"queries products"| node_supabase_client
node_supabase_client -->|"reads products"| node_products_db
node_menu_page -->|"passes products"| node_menu_view
node_menu_view -->|"provides search"| node_menu_header
node_menu_view -->|"shows categories"| node_category_tabs
node_menu_view -->|"renders products"| node_product_card
node_product_card -->|"adds product"| node_cart_slice
node_menu_page -->|"renders within"| node_redux_provider
node_redux_provider -->|"provides store"| node_store_config
node_store_config -->|"registers reducer"| node_cart_slice
node_customer -->|"opens cart"| node_cart_sheet
node_cart_sheet -->|"updates and reads"| node_cart_slice
node_cart_sheet -->|"opens checkout"| node_checkout_modal
node_checkout_modal -->|"posts order"| node_checkout_api
node_checkout_api -->|"returns order link"| node_whatsapp
node_checkout_api -.->|"sends email"| node_resend
node_merchant_user -->|"enters PIN"| node_admin_page
node_admin_page -->|"loads and deletes products"| node_supabase_client
node_admin_page -->|"opens form"| node_add_product
node_add_product -->|"inserts product"| node_supabase_client
node_supabase_client -->|"reads and writes"| node_products_db

click node_menu_page "https://github.com/nereu-vitor/localeats/blob/main/src/app/page.tsx"
click node_menu_view "https://github.com/nereu-vitor/localeats/blob/main/src/components/menu/menu-view.tsx"
click node_category_tabs "https://github.com/nereu-vitor/localeats/blob/main/src/components/menu/category-tabs.tsx"
click node_product_card "https://github.com/nereu-vitor/localeats/blob/main/src/components/menu/product-card.tsx"
click node_menu_header "https://github.com/nereu-vitor/localeats/blob/main/src/components/menu/menu-header.tsx"
click node_cart_sheet "https://github.com/nereu-vitor/localeats/blob/main/src/components/menu/cart-sheet.tsx"
click node_checkout_modal "https://github.com/nereu-vitor/localeats/blob/main/src/components/menu/checkout-modal.tsx"
click node_checkout_api "https://github.com/nereu-vitor/localeats/blob/main/src/app/api/checkout/route.ts"
click node_cart_slice "https://github.com/nereu-vitor/localeats/blob/main/src/store/cartSlice.ts"
click node_store_config "https://github.com/nereu-vitor/localeats/blob/main/src/store/store.ts"
click node_redux_provider "https://github.com/nereu-vitor/localeats/blob/main/src/providers/redux-provider.tsx"
click node_admin_page "https://github.com/nereu-vitor/localeats/blob/main/src/app/admin/page.tsx"
click node_add_product "https://github.com/nereu-vitor/localeats/blob/main/src/components/admin/add-product-modal.tsx"
click node_supabase_client "https://github.com/nereu-vitor/localeats/blob/main/src/lib/supabase.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_menu_page,node_menu_view,node_category_tabs,node_product_card,node_menu_header toneBlue
class node_cart_sheet,node_checkout_modal,node_checkout_api,node_cart_slice,node_store_config,node_redux_provider toneAmber
class node_admin_page,node_add_product toneMint
class node_supabase_client,node_products_db,node_whatsapp,node_resend toneRose
class node_customer,node_merchant_user toneIndigo
```

## Components

### Customer menu

- [Public menu page](https://github.com/nereu-vitor/localeats/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Menu browsing](https://github.com/nereu-vitor/localeats/blob/main/src/components/menu/menu-view.tsx): `src/components/menu/menu-view.tsx`
- [Category tabs](https://github.com/nereu-vitor/localeats/blob/main/src/components/menu/category-tabs.tsx): `src/components/menu/category-tabs.tsx`
- [Product cards](https://github.com/nereu-vitor/localeats/blob/main/src/components/menu/product-card.tsx): `src/components/menu/product-card.tsx`
- [Search header](https://github.com/nereu-vitor/localeats/blob/main/src/components/menu/menu-header.tsx): `src/components/menu/menu-header.tsx`

### Cart and checkout

- [Cart interface](https://github.com/nereu-vitor/localeats/blob/main/src/components/menu/cart-sheet.tsx): `src/components/menu/cart-sheet.tsx`
- [Checkout details](https://github.com/nereu-vitor/localeats/blob/main/src/components/menu/checkout-modal.tsx): `src/components/menu/checkout-modal.tsx`
- [Order formatting](https://github.com/nereu-vitor/localeats/blob/main/src/app/api/checkout/route.ts): `src/app/api/checkout/route.ts`
- [Cart state](https://github.com/nereu-vitor/localeats/blob/main/src/store/cartSlice.ts): `src/store/cartSlice.ts`
- [Redux store](https://github.com/nereu-vitor/localeats/blob/main/src/store/store.ts): `src/store/store.ts`
- [Redux provider](https://github.com/nereu-vitor/localeats/blob/main/src/providers/redux-provider.tsx): `src/providers/redux-provider.tsx`

### Merchant management

- [PIN admin panel](https://github.com/nereu-vitor/localeats/blob/main/src/app/admin/page.tsx): `src/app/admin/page.tsx`
- [Product creation](https://github.com/nereu-vitor/localeats/blob/main/src/components/admin/add-product-modal.tsx): `src/components/admin/add-product-modal.tsx`

### Data and services

- [Supabase client](https://github.com/nereu-vitor/localeats/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- **Products table**
- **Restaurant WhatsApp**
- **Resend email**

### Other components

- **Customer**
- **Merchant**

## Connections

- Customer → Public menu page: opens menu
- Public menu page → Supabase client: queries products
- Supabase client → Products table: reads products
- Public menu page → Menu browsing: passes products
- Menu browsing → Search header: provides search
- Menu browsing → Category tabs: shows categories
- Menu browsing → Product cards: renders products
- Product cards → Cart state: adds product
- Public menu page → Redux provider: renders within
- Redux provider → Redux store: provides store
- Redux store → Cart state: registers reducer
- Customer → Cart interface: opens cart
- Cart interface → Cart state: updates and reads
- Cart interface → Checkout details: opens checkout
- Checkout details → Order formatting: posts order
- Order formatting → Restaurant WhatsApp: returns order link
- Order formatting → Resend email: sends email
- Merchant → PIN admin panel: enters PIN
- PIN admin panel → Supabase client: loads and deletes products
- PIN admin panel → Product creation: opens form
- Product creation → Supabase client: inserts product
- Supabase client → Products table: reads and writes
