# albertcarri/umamiveg architecture

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

- Interactive diagram: https://gitdiagram.com/albertcarri/umamiveg
- Repository: https://github.com/albertcarri/umamiveg

## Overview

##### Project type and purpose
- This is a full-stack Next.js (App Router) web application for a vegan food business.
- Purpose: display dynamic menus (congelados, repostería, tienda, menú general), let users build an order “cart” in the browser, then send that order via WhatsApp rather than a traditional payment gateway.
- Data and images live in Supabase; there’s also a custom CMS service you built that stores/retrieves content in Supabase.

##### File structure
- Top-level “app” folder: Next.js 13 App Router pages and server-side API endpoints under app/api/[…]/route.js.
- Subdirectories under app/: routes for each section (congelados, menu, reposteria, tienda, contacto).
- “components” folder: reusable React components (Footer, StoreAddCartButton, showcart, menuBurger, etc.).
- “lib” folder: data-fetch helpers (getMenu.js, getCongelados.js, getReposteria.js) that call Supabase.
- “utils/supabase”: server utility to instantiate Supabase client (server.js).
- Config files: next.config.mjs, tailwind.config.js, postcss.config.mjs, jsconfig.json.

##### README for additional insights
- Confirms Next.js + Tailwind CSS + Supabase (DB and storage).
- Dynamic content loaded via a CMS you built, also backed by Supabase.
- Orders are sent through WhatsApp integration (opening a wa.me link with order summary).

## Diagram (Mermaid)

```mermaid
flowchart TD
  %% Frontend Layer
  subgraph "Frontend (React UI)" 
    direction TB
    Home["Home Page"]:::frontend
    CongeladosPage["Congelados Page"]:::frontend
    ReposteriaPage["Repostería Page"]:::frontend
    TiendaPage["Tienda Page"]:::frontend
    MenuPage["Menú General Page"]:::frontend
    ContactoPage["Contacto Page"]:::frontend
    Layout["Global Layout"]:::frontend
    GlobalsCSS["Global Styles"]:::frontend

    Footer["Footer Component"]:::frontend
    MenuBurger["Mobile Menu Burger"]:::frontend
    MenuNoSmartPhone["Non-Smartphone Menu"]:::frontend
    ShowCart["Cart Display Component"]:::frontend
    StoreAddBtn["Add to Cart Button"]:::frontend
    WhatsappBtn["WhatsApp/PedidosYa Button"]:::frontend
  end

  %% Backend Layer
  subgraph "Backend (Next.js Server)" 
    direction TB
    AppRouter["Next.js App Router"]:::backend
    API_Cong["API Route: /api/congelados"]:::backend
    API_Rep["API Route: /api/reposteria"]:::backend
    API_Tienda["API Route: /api/tienda"]:::backend
    API_Menu["API Route: /api/menu"]:::backend

    SupaUtil["Supabase Client Util"]:::backend
    GetCong["lib/getCongelados.js"]:::backend
    GetRep["lib/getReposteria.js"]:::backend
    GetMenuFn["lib/getMenu.js"]:::backend
  end

  %% Data Layer
  subgraph "Data Layer (Supabase)" 
    direction TB
    DB["PostgreSQL Database"]:::data
    Storage["Storage Bucket"]:::data
  end

  %% CMS Service
  CMS["Custom CMS Service"]:::backend

  %% External Service
  WhatsApp["WhatsApp (wa.me)"]:::external

  %% Hosting
  Vercel["Vercel Hosting"]:::external

  %% Connections
  Home -->|renders via SSR| AppRouter
  CongeladosPage -->|renders via SSR| AppRouter
  ReposteriaPage -->|renders via SSR| AppRouter
  TiendaPage -->|renders via SSR| AppRouter
  MenuPage -->|renders via SSR| AppRouter
  ContactoPage -->|renders via SSR| AppRouter

  AppRouter -->|routes to| API_Cong
  AppRouter -->|routes to| API_Rep
  AppRouter -->|routes to| API_Tienda
  AppRouter -->|routes to| API_Menu

  API_Cong -->|calls| GetCong
  API_Rep -->|calls| GetRep
  API_Menu -->|calls| GetMenuFn

  GetCong -->|uses| SupaUtil
  GetRep -->|uses| SupaUtil
  GetMenuFn -->|uses| SupaUtil

  SupaUtil -->|queries| DB
  SupaUtil -->|fetches images| Storage

  Layout -->|loads CSS| GlobalsCSS
  Layout -->|includes| Footer
  Layout -->|includes| MenuBurger
  Layout -->|includes| MenuNoSmartPhone

  ShowCart -->|interacts with| StoreAddBtn
  ShowCart -->|interacts with| WhatsappBtn
  WhatsappBtn -->|opens link| WhatsApp

  Home -->|fetches static assets| Storage
  CongeladosPage -->|fetches static assets| Storage

  CMS -->|writes content to| DB
  CMS -->|uploads images to| Storage

  Vercel -->|hosts| AppRouter
  Vercel -->|serves| GlobalsCSS
  Vercel -->|serves static| Storage

  %% Click Events
  click Home "https://github.com/albertcarri/umamiveg/blob/master/app/page.jsx"
  click CongeladosPage "https://github.com/albertcarri/umamiveg/blob/master/app/congelados/page.jsx"
  click ReposteriaPage "https://github.com/albertcarri/umamiveg/blob/master/app/reposteria/page.jsx"
  click TiendaPage "https://github.com/albertcarri/umamiveg/blob/master/app/tienda/page.jsx"
  click MenuPage "https://github.com/albertcarri/umamiveg/blob/master/app/menu/page.jsx"
  click ContactoPage "https://github.com/albertcarri/umamiveg/blob/master/app/contacto/page.jsx"
  click Layout "https://github.com/albertcarri/umamiveg/blob/master/app/layout.jsx"
  click GlobalsCSS "https://github.com/albertcarri/umamiveg/blob/master/app/globals.css"

  click Footer "https://github.com/albertcarri/umamiveg/blob/master/components/Footer.jsx"
  click MenuBurger "https://github.com/albertcarri/umamiveg/blob/master/components/menuBurger.jsx"
  click MenuNoSmartPhone "https://github.com/albertcarri/umamiveg/blob/master/components/MenuNoSmartPhone.jsx"
  click ShowCart "https://github.com/albertcarri/umamiveg/blob/master/components/showcart.jsx"
  click StoreAddBtn "https://github.com/albertcarri/umamiveg/blob/master/components/StoreAddCartButton.jsx"
  click WhatsappBtn "https://github.com/albertcarri/umamiveg/blob/master/components/WhatsappOrPedidosya.jsx"

  click API_Cong "https://github.com/albertcarri/umamiveg/blob/master/app/api/congelados/route.js"
  click API_Rep "https://github.com/albertcarri/umamiveg/blob/master/app/api/reposteria/route.js"
  click API_Tienda "https://github.com/albertcarri/umamiveg/blob/master/app/api/tienda/route.js"
  click API_Menu "https://github.com/albertcarri/umamiveg/blob/master/app/api/menu/route.js"

  click GetCong "https://github.com/albertcarri/umamiveg/blob/master/lib/getCongelados.js"
  click GetRep "https://github.com/albertcarri/umamiveg/blob/master/lib/getReposteria.js"
  click GetMenuFn "https://github.com/albertcarri/umamiveg/blob/master/lib/getMenu.js"

  click SupaUtil "https://github.com/albertcarri/umamiveg/blob/master/utils/supabase/server.js"

  classDef frontend fill:#E3F2FD,stroke:#42A5F5,color:#0D47A1
  classDef backend fill:#E8F5E9,stroke:#66BB6A,color:#1B5E20
  classDef data fill:#FFF3E0,stroke:#FFA726,color:#E65100
  classDef external fill:#FFEBEE,stroke:#EF5350,color:#B71C1C
```
