# cyberfox2005/food-platform architecture

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

- Interactive diagram: https://gitdiagram.com/cyberfox2005/food-platform
- Repository: https://github.com/cyberfox2005/food-platform

## Overview

Gravity Grill is a restaurant ordering and operations product with a web storefront, an Express API, and a separate Kotlin product-browsing app. A customer browses the menu, adds items to a locally persisted cart, and submits an order through the web API; account access and staff/admin workflows are also supported. The backend exposes product, order, and authentication routes, with order status updates available over Socket.IO. The tree and excerpts do not establish persistence or a connection between the Android app and this backend, so those links are omitted.

Main entry points: [`web-frontend/src/App.jsx`](https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/App.jsx) (Web app router), [`backend-express/server.js`](https://github.com/cyberfox2005/food-platform/blob/main/backend-express/server.js) (API server), [`web-frontend/src/pages/Checkout.jsx`](https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/pages/Checkout.jsx) (Checkout), [`web-frontend/src/pages/Menu.jsx`](https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/pages/Menu.jsx) (Menu browsing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web storefront"]
  node_webapp["Web app router<br/>[App.jsx]"]
  node_menu["Menu browsing<br/>[Menu.jsx]"]
  node_catalog["Menu catalog<br/>[menuData.js]"]
  node_productcard["Product cards<br/>[ProductCard.jsx]"]
  node_cartpage["Cart review<br/>[Cart.jsx]"]
  node_cartstate[("Cart state<br/>[CartContext.jsx]")]
  node_checkout["Checkout<br/>[Checkout.jsx]"]
  node_account["Account access<br/>[AuthAccount.jsx]"]
  node_profile["Customer profile<br/>[Profile.jsx]"]
  node_userstate[("User state<br/>[UserContext.jsx]")]
  node_api["HTTP client<br/>[api.js]"]
end

subgraph group_ops["Operations workflows"]
  node_admin["Admin dashboard<br/>[AdminDashboard.jsx]"]
  node_productadmin["Product management"]
  node_inventory["Inventory management<br/>[AdminInventory.jsx]"]
  node_analytics["Analytics<br/>[Analytics.jsx]"]
  node_kitchen["Kitchen workflow<br/>[Kitchen.jsx]"]
  node_delivery["Delivery workflow<br/>[Delivery.jsx]"]
end

subgraph group_api["Express API"]
  node_server["API server<br/>[server.js]"]
  node_products["Product routes<br/>[products.js]"]
  node_orders["Order routes<br/>[orders.js]"]
  node_auth["Authentication routes<br/>[auth.js]"]
  node_socket["Order status events<br/>[server.js]"]
end

subgraph group_android["Android app"]
  node_androidmain["Android entry<br/>[MainActivity.kt]"]
  node_androidscreen["Product list screen"]
  node_mainvm["Product view model<br/>[MainViewModel.kt]"]
  node_menuvm["Menu view model<br/>[MenuViewModel.kt]"]
  node_foodservice["Food API service<br/>[FoodApiService.kt]"]
  node_productmodel["Product model<br/>[Product.kt]"]
end

node_customer(("Customer"))
node_httpclients(("API clients"))

node_customer -.->|"uses"| node_webapp
node_webapp -->|"routes to"| node_menu
node_webapp -->|"routes to"| node_cartpage
node_webapp -->|"routes to"| node_checkout
node_webapp -->|"routes to"| node_account
node_webapp -->|"routes to"| node_profile
node_webapp -->|"routes to"| node_admin
node_webapp -->|"routes to"| node_inventory
node_webapp -->|"routes to"| node_analytics
node_webapp -->|"routes to"| node_kitchen
node_webapp -->|"routes to"| node_delivery
node_menu -->|"reads catalog"| node_catalog
node_menu -->|"renders"| node_productcard
node_productadmin -->|"loads initial items"| node_catalog
node_cartpage -->|"uses cart"| node_cartstate
node_checkout -->|"uses cart"| node_cartstate
node_checkout -->|"uses account state"| node_userstate
node_checkout -->|"submits order"| node_api
node_account -->|"authenticates"| node_api
node_profile -->|"uses profile state"| node_userstate
node_userstate -->|"updates order status"| node_api
node_httpclients -.->|"sends requests"| node_server
node_server -->|"mounts route"| node_products
node_server -->|"mounts route"| node_orders
node_server -->|"mounts route"| node_auth
node_server -->|"dispatches events"| node_socket
node_androidmain -->|"opens screen"| node_androidscreen
node_androidscreen -->|"uses view model"| node_mainvm
node_mainvm -->|"requests products"| node_foodservice
node_foodservice -->|"returns products"| node_productmodel
node_androidscreen -->|"renders products"| node_productmodel

click node_webapp "https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/App.jsx"
click node_menu "https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/pages/Menu.jsx"
click node_catalog "https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/data/menuData.js"
click node_productcard "https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/components/ProductCard.jsx"
click node_cartpage "https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/pages/Cart.jsx"
click node_cartstate "https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/context/CartContext.jsx"
click node_checkout "https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/pages/Checkout.jsx"
click node_account "https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/pages/AuthAccount.jsx"
click node_profile "https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/pages/Profile.jsx"
click node_userstate "https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/context/UserContext.jsx"
click node_admin "https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/pages/AdminDashboard.jsx"
click node_productadmin "https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/pages/AdminProductManager.jsx"
click node_inventory "https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/pages/AdminInventory.jsx"
click node_analytics "https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/pages/Analytics.jsx"
click node_kitchen "https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/pages/Kitchen.jsx"
click node_delivery "https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/pages/Delivery.jsx"
click node_api "https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/lib/api.js"
click node_server "https://github.com/cyberfox2005/food-platform/blob/main/backend-express/server.js"
click node_products "https://github.com/cyberfox2005/food-platform/blob/main/backend-express/src/routes/api/v1/products.js"
click node_orders "https://github.com/cyberfox2005/food-platform/blob/main/backend-express/src/routes/api/v1/orders.js"
click node_auth "https://github.com/cyberfox2005/food-platform/blob/main/backend-express/src/routes/api/v1/auth.js"
click node_socket "https://github.com/cyberfox2005/food-platform/blob/main/backend-express/server.js"
click node_androidmain "https://github.com/cyberfox2005/food-platform/blob/main/android-kotlin/app/src/main/kotlin/com/cosmicfood/ui/MainActivity.kt"
click node_androidscreen "https://github.com/cyberfox2005/food-platform/blob/main/android-kotlin/app/src/main/kotlin/com/cosmicfood/ui/screens/ProductListScreen.kt"
click node_mainvm "https://github.com/cyberfox2005/food-platform/blob/main/android-kotlin/app/src/main/kotlin/com/cosmicfood/viewmodel/MainViewModel.kt"
click node_menuvm "https://github.com/cyberfox2005/food-platform/blob/main/android-kotlin/app/src/main/kotlin/com/cosmicfood/viewmodel/MenuViewModel.kt"
click node_foodservice "https://github.com/cyberfox2005/food-platform/blob/main/android-kotlin/app/src/main/kotlin/com/cosmicfood/data/FoodApiService.kt"
click node_productmodel "https://github.com/cyberfox2005/food-platform/blob/main/android-kotlin/app/src/main/kotlin/com/cosmicfood/model/Product.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_webapp,node_menu,node_catalog,node_productcard,node_cartpage,node_cartstate,node_checkout,node_account,node_profile,node_userstate,node_api,node_httpclients toneBlue
class node_admin,node_productadmin,node_inventory,node_analytics,node_kitchen,node_delivery toneAmber
class node_server,node_products,node_orders,node_auth,node_socket toneMint
class node_androidmain,node_androidscreen,node_mainvm,node_menuvm,node_foodservice,node_productmodel toneRose
class node_customer toneIndigo
```

## Components

### Web storefront

- [Web app router](https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/App.jsx): `web-frontend/src/App.jsx`
- [Menu browsing](https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/pages/Menu.jsx): `web-frontend/src/pages/Menu.jsx`
- [Menu catalog](https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/data/menuData.js): `web-frontend/src/data/menuData.js`
- [Product cards](https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/components/ProductCard.jsx): `web-frontend/src/components/ProductCard.jsx`
- [Cart review](https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/pages/Cart.jsx): `web-frontend/src/pages/Cart.jsx`
- [Cart state](https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/context/CartContext.jsx): `web-frontend/src/context/CartContext.jsx`
- [Checkout](https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/pages/Checkout.jsx): `web-frontend/src/pages/Checkout.jsx`
- [Account access](https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/pages/AuthAccount.jsx): `web-frontend/src/pages/AuthAccount.jsx`
- [Customer profile](https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/pages/Profile.jsx): `web-frontend/src/pages/Profile.jsx`
- [User state](https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/context/UserContext.jsx): `web-frontend/src/context/UserContext.jsx`
- [HTTP client](https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/lib/api.js): `web-frontend/src/lib/api.js`

### Operations workflows

- [Admin dashboard](https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/pages/AdminDashboard.jsx): `web-frontend/src/pages/AdminDashboard.jsx`
- [Product management](https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/pages/AdminProductManager.jsx): `web-frontend/src/pages/AdminProductManager.jsx`
- [Inventory management](https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/pages/AdminInventory.jsx): `web-frontend/src/pages/AdminInventory.jsx`
- [Analytics](https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/pages/Analytics.jsx): `web-frontend/src/pages/Analytics.jsx`
- [Kitchen workflow](https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/pages/Kitchen.jsx): `web-frontend/src/pages/Kitchen.jsx`
- [Delivery workflow](https://github.com/cyberfox2005/food-platform/blob/main/web-frontend/src/pages/Delivery.jsx): `web-frontend/src/pages/Delivery.jsx`

### Express API

- [API server](https://github.com/cyberfox2005/food-platform/blob/main/backend-express/server.js): `backend-express/server.js`
- [Product routes](https://github.com/cyberfox2005/food-platform/blob/main/backend-express/src/routes/api/v1/products.js): `backend-express/src/routes/api/v1/products.js`
- [Order routes](https://github.com/cyberfox2005/food-platform/blob/main/backend-express/src/routes/api/v1/orders.js): `backend-express/src/routes/api/v1/orders.js`
- [Authentication routes](https://github.com/cyberfox2005/food-platform/blob/main/backend-express/src/routes/api/v1/auth.js): `backend-express/src/routes/api/v1/auth.js`
- [Order status events](https://github.com/cyberfox2005/food-platform/blob/main/backend-express/server.js): `backend-express/server.js`

### Android app

- [Android entry](https://github.com/cyberfox2005/food-platform/blob/main/android-kotlin/app/src/main/kotlin/com/cosmicfood/ui/MainActivity.kt): `android-kotlin/app/src/main/kotlin/com/cosmicfood/ui/MainActivity.kt`
- [Product list screen](https://github.com/cyberfox2005/food-platform/blob/main/android-kotlin/app/src/main/kotlin/com/cosmicfood/ui/screens/ProductListScreen.kt): `android-kotlin/app/src/main/kotlin/com/cosmicfood/ui/screens/ProductListScreen.kt`
- [Product view model](https://github.com/cyberfox2005/food-platform/blob/main/android-kotlin/app/src/main/kotlin/com/cosmicfood/viewmodel/MainViewModel.kt): `android-kotlin/app/src/main/kotlin/com/cosmicfood/viewmodel/MainViewModel.kt`
- [Menu view model](https://github.com/cyberfox2005/food-platform/blob/main/android-kotlin/app/src/main/kotlin/com/cosmicfood/viewmodel/MenuViewModel.kt): `android-kotlin/app/src/main/kotlin/com/cosmicfood/viewmodel/MenuViewModel.kt`
- [Food API service](https://github.com/cyberfox2005/food-platform/blob/main/android-kotlin/app/src/main/kotlin/com/cosmicfood/data/FoodApiService.kt): `android-kotlin/app/src/main/kotlin/com/cosmicfood/data/FoodApiService.kt`
- [Product model](https://github.com/cyberfox2005/food-platform/blob/main/android-kotlin/app/src/main/kotlin/com/cosmicfood/model/Product.kt): `android-kotlin/app/src/main/kotlin/com/cosmicfood/model/Product.kt`

### Other components

- **Customer**
- **API clients**

## Connections

- Customer → Web app router: uses
- Web app router → Menu browsing: routes to (evidence: `web-frontend/src/App.jsx`)
- Web app router → Cart review: routes to (evidence: `web-frontend/src/App.jsx`)
- Web app router → Checkout: routes to (evidence: `web-frontend/src/App.jsx`)
- Web app router → Account access: routes to (evidence: `web-frontend/src/App.jsx`)
- Web app router → Customer profile: routes to (evidence: `web-frontend/src/App.jsx`)
- Web app router → Admin dashboard: routes to (evidence: `web-frontend/src/App.jsx`)
- Web app router → Inventory management: routes to (evidence: `web-frontend/src/App.jsx`)
- Web app router → Analytics: routes to (evidence: `web-frontend/src/App.jsx`)
- Web app router → Kitchen workflow: routes to (evidence: `web-frontend/src/App.jsx`)
- Web app router → Delivery workflow: routes to (evidence: `web-frontend/src/App.jsx`)
- Menu browsing → Menu catalog: reads catalog (evidence: `web-frontend/src/pages/Menu.jsx`)
- Menu browsing → Product cards: renders (evidence: `web-frontend/src/pages/Menu.jsx`)
- Product management → Menu catalog: loads initial items (evidence: `web-frontend/src/pages/AdminProductManager.jsx`)
- Cart review → Cart state: uses cart (evidence: `web-frontend/src/pages/Cart.jsx`)
- Checkout → Cart state: uses cart (evidence: `web-frontend/src/pages/Checkout.jsx`)
- Checkout → User state: uses account state (evidence: `web-frontend/src/pages/Checkout.jsx`)
- Checkout → HTTP client: submits order (evidence: `web-frontend/src/pages/Checkout.jsx`)
- Account access → HTTP client: authenticates (evidence: `web-frontend/src/pages/AuthAccount.jsx`)
- Customer profile → User state: uses profile state (evidence: `web-frontend/src/pages/Profile.jsx`)
- User state → HTTP client: updates order status (evidence: `web-frontend/src/context/UserContext.jsx`)
- API clients → API server: sends requests
- API server → Product routes: mounts route (evidence: `backend-express/server.js`)
- API server → Order routes: mounts route (evidence: `backend-express/server.js`)
- API server → Authentication routes: mounts route (evidence: `backend-express/server.js`)
- API server → Order status events: dispatches events (evidence: `backend-express/server.js`)
- Android entry → Product list screen: opens screen (evidence: `android-kotlin/app/src/main/kotlin/com/cosmicfood/ui/MainActivity.kt`)
- Product list screen → Product view model: uses view model (evidence: `android-kotlin/app/src/main/kotlin/com/cosmicfood/ui/screens/ProductListScreen.kt`)
- Product view model → Food API service: requests products (evidence: `android-kotlin/app/src/main/kotlin/com/cosmicfood/viewmodel/MainViewModel.kt`)
- Food API service → Product model: returns products (evidence: `android-kotlin/app/src/main/kotlin/com/cosmicfood/data/FoodApiService.kt`)
- Product list screen → Product model: renders products (evidence: `android-kotlin/app/src/main/kotlin/com/cosmicfood/ui/screens/ProductListScreen.kt`)
