# parvez141300/foodhub-client-app-a-4 architecture

> Architecture diagram of the GitHub repository parvez141300/foodhub-client-app-a-4, 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/parvez141300/foodhub-client-app-a-4
- Repository: https://github.com/parvez141300/foodhub-client-app-a-4

## Overview

FoodHub is a role-based meal marketplace: customers browse meals, manage carts and wishlists, place and track orders, and review meals; providers manage meals and incoming orders; admins manage users, categories, cuisines, dietaries, and all orders. The Next.js pages and dashboards invoke server actions and services, which communicate with separate backend and authentication services. The map preserves these documented capabilities, but several dashboard and action implementations were not sampled, so their internal call links are omitted.

Main entry points: [`src/services`](https://github.com/parvez141300/foodhub-client-app-a-4/tree/main/src/services) (Domain services), [`src/app/(commonLayout)/meals/[id]/page.tsx`](https://github.com/parvez141300/foodhub-client-app-a-4/blob/main/src/app/(commonLayout)/meals/%5Bid%5D/page.tsx) (Meal details), [`src/app/(commonLayout)`](https://github.com/parvez141300/foodhub-client-app-a-4/tree/main/src/app/(commonLayout)) (Public pages), [`src/app/(dashboardLayout)/@customer/customer-dashboard`](https://github.com/parvez141300/foodhub-client-app-a-4/tree/main/src/app/(dashboardLayout)/%40customer/customer-dashboard) (Customer dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Marketplace experience"]
  node_public_pages["Public pages"]
  node_meal_detail["Meal details<br/>[page.tsx]"]
  node_auth_pages["Login and register"]
end

subgraph group_roles["Role dashboards"]
  node_customer_dash["Customer dashboard"]
  node_provider_dash["Provider dashboard"]
  node_admin_dash["Admin dashboard"]
end

subgraph group_application["Application services"]
  node_cart_action["Cart actions<br/>[cart.action.ts]"]
  node_meal_action["Meal actions<br/>[meal.action.ts]"]
  node_wishlist_action["Wishlist actions<br/>[wishlist.action.ts]"]
  node_review_action["Review actions<br/>[review.action.ts]"]
  node_user_action["User actions<br/>[user.action.ts]"]
  node_order_action["Order actions<br/>[order.action.ts]"]
  node_services["Domain services"]
end

subgraph group_integrations["External services"]
  node_backend{{"FoodHub backend"}}
  node_auth_service{{"Authentication service"}}
end

node_customer(("Customer"))
node_provider(("Provider"))
node_admin(("Admin"))

node_customer -->|"registers or logs in"| node_auth_pages
node_customer -->|"browses meals"| node_public_pages
node_public_pages -->|"opens meal"| node_meal_detail
node_meal_detail -->|"loads meal"| node_meal_action
node_meal_detail -->|"gets session"| node_user_action
node_meal_detail -->|"adds to cart"| node_cart_action
node_meal_detail -->|"adds to wishlist"| node_wishlist_action
node_meal_detail -->|"reads and submits"| node_review_action
node_customer -->|"manages shopping"| node_customer_dash
node_customer_dash -->|"places and tracks orders"| node_order_action
node_provider -->|"manages meals and orders"| node_provider_dash
node_admin -->|"manages users and catalog"| node_admin_dash
node_cart_action -->|"delegates"| node_services
node_meal_action -->|"delegates"| node_services
node_wishlist_action -->|"delegates"| node_services
node_review_action -->|"delegates"| node_services
node_user_action -->|"delegates"| node_services
node_services -->|"requests domain data"| node_backend
node_services -->|"checks session"| node_auth_service

click node_public_pages "https://github.com/parvez141300/foodhub-client-app-a-4/tree/main/src/app/(commonLayout)"
click node_meal_detail "https://github.com/parvez141300/foodhub-client-app-a-4/blob/main/src/app/(commonLayout)/meals/%5Bid%5D/page.tsx"
click node_auth_pages "https://github.com/parvez141300/foodhub-client-app-a-4/tree/main/src/app/(commonLayout)/(auth)"
click node_customer_dash "https://github.com/parvez141300/foodhub-client-app-a-4/tree/main/src/app/(dashboardLayout)/%40customer/customer-dashboard"
click node_provider_dash "https://github.com/parvez141300/foodhub-client-app-a-4/tree/main/src/app/(dashboardLayout)/%40provider/provider-dashboard"
click node_admin_dash "https://github.com/parvez141300/foodhub-client-app-a-4/tree/main/src/app/(dashboardLayout)/%40admin/admin-dashboard"
click node_cart_action "https://github.com/parvez141300/foodhub-client-app-a-4/blob/main/src/actions/cart.action.ts"
click node_meal_action "https://github.com/parvez141300/foodhub-client-app-a-4/blob/main/src/actions/meal.action.ts"
click node_wishlist_action "https://github.com/parvez141300/foodhub-client-app-a-4/blob/main/src/actions/wishlist.action.ts"
click node_review_action "https://github.com/parvez141300/foodhub-client-app-a-4/blob/main/src/actions/review.action.ts"
click node_user_action "https://github.com/parvez141300/foodhub-client-app-a-4/blob/main/src/actions/user.action.ts"
click node_order_action "https://github.com/parvez141300/foodhub-client-app-a-4/blob/main/src/actions/order.action.ts"
click node_services "https://github.com/parvez141300/foodhub-client-app-a-4/tree/main/src/services"

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_public_pages,node_meal_detail,node_auth_pages toneBlue
class node_customer_dash,node_provider_dash,node_admin_dash toneAmber
class node_cart_action,node_meal_action,node_wishlist_action,node_review_action,node_user_action,node_order_action,node_services toneMint
class node_backend,node_auth_service toneRose
class node_customer,node_provider,node_admin toneIndigo
```

## Components

### Marketplace experience

- [Public pages](https://github.com/parvez141300/foodhub-client-app-a-4/tree/main/src/app/(commonLayout)): `src/app/(commonLayout)`
- [Meal details](https://github.com/parvez141300/foodhub-client-app-a-4/blob/main/src/app/(commonLayout)/meals/%5Bid%5D/page.tsx): `src/app/(commonLayout)/meals/[id]/page.tsx`
- [Login and register](https://github.com/parvez141300/foodhub-client-app-a-4/tree/main/src/app/(commonLayout)/(auth)): `src/app/(commonLayout)/(auth)`

### Role dashboards

- [Customer dashboard](https://github.com/parvez141300/foodhub-client-app-a-4/tree/main/src/app/(dashboardLayout)/%40customer/customer-dashboard): `src/app/(dashboardLayout)/@customer/customer-dashboard`
- [Provider dashboard](https://github.com/parvez141300/foodhub-client-app-a-4/tree/main/src/app/(dashboardLayout)/%40provider/provider-dashboard): `src/app/(dashboardLayout)/@provider/provider-dashboard`
- [Admin dashboard](https://github.com/parvez141300/foodhub-client-app-a-4/tree/main/src/app/(dashboardLayout)/%40admin/admin-dashboard): `src/app/(dashboardLayout)/@admin/admin-dashboard`

### Application services

- [Cart actions](https://github.com/parvez141300/foodhub-client-app-a-4/blob/main/src/actions/cart.action.ts): `src/actions/cart.action.ts`
- [Meal actions](https://github.com/parvez141300/foodhub-client-app-a-4/blob/main/src/actions/meal.action.ts): `src/actions/meal.action.ts`
- [Wishlist actions](https://github.com/parvez141300/foodhub-client-app-a-4/blob/main/src/actions/wishlist.action.ts): `src/actions/wishlist.action.ts`
- [Review actions](https://github.com/parvez141300/foodhub-client-app-a-4/blob/main/src/actions/review.action.ts): `src/actions/review.action.ts`
- [User actions](https://github.com/parvez141300/foodhub-client-app-a-4/blob/main/src/actions/user.action.ts): `src/actions/user.action.ts`
- [Order actions](https://github.com/parvez141300/foodhub-client-app-a-4/blob/main/src/actions/order.action.ts): `src/actions/order.action.ts`
- [Domain services](https://github.com/parvez141300/foodhub-client-app-a-4/tree/main/src/services): `src/services`

### External services

- **FoodHub backend**
- **Authentication service**

### Other components

- **Customer**
- **Provider**
- **Admin**

## Connections

- Customer → Login and register: registers or logs in
- Customer → Public pages: browses meals
- Public pages → Meal details: opens meal (evidence: `src/app/(commonLayout)/page.tsx`)
- Meal details → Meal actions: loads meal (evidence: `src/app/(commonLayout)/meals/[id]/page.tsx`)
- Meal details → User actions: gets session (evidence: `src/app/(commonLayout)/meals/[id]/page.tsx`)
- Meal details → Cart actions: adds to cart (evidence: `src/app/(commonLayout)/meals/[id]/page.tsx`)
- Meal details → Wishlist actions: adds to wishlist (evidence: `src/app/(commonLayout)/meals/[id]/page.tsx`)
- Meal details → Review actions: reads and submits (evidence: `src/app/(commonLayout)/meals/[id]/page.tsx`)
- Customer → Customer dashboard: manages shopping
- Customer dashboard → Order actions: places and tracks orders
- Provider → Provider dashboard: manages meals and orders
- Admin → Admin dashboard: manages users and catalog
- Cart actions → Domain services: delegates (evidence: `src/actions/cart.action.ts`)
- Meal actions → Domain services: delegates (evidence: `src/actions/meal.action.ts`)
- Wishlist actions → Domain services: delegates (evidence: `src/actions/wishlist.action.ts`)
- Review actions → Domain services: delegates (evidence: `src/actions/review.action.ts`)
- User actions → Domain services: delegates (evidence: `src/actions/user.action.ts`)
- Domain services → FoodHub backend: requests domain data (evidence: `src/services/meal.service.ts`)
- Domain services → Authentication service: checks session (evidence: `src/services/user.service.ts`)
