How couchbase-examples/edge-server-meal-order-sample-app works
This is a React airline seatback meal-ordering demo with separate business- and economy-class experiences. The workflow is: a passenger opens a class menu, the app loads meals and inventory from Couchbase Edge Server, selections accumulate in a cart, and confirmation updates inventory for that seat. Edge Server supports offline access and synchronizes with remote Capella App Services when connectivity is available. The graph follows sampled calls and README-documented integrations; unsampled component details and configuration wiring are not inferred.
Main entry points: MealPage.tsx Meal browsing · Cart.tsx Cart and editing · api.ts REST client · index.ts Redux state and persistence
Components 16
Ordering experience
- Class app shell
src/App.tsx - Meal browsing
src/components/MealPage.tsx - Meal card
src/components/MealCard.tsx - Cart and editing
src/components/Cart.tsx - Order confirmation
src/components/OrderSummaryDialog.tsx - Confirmed order view
src/components/ConfirmedOrder.tsx
Order and inventory state
- Business meals
src/store/businessMealSlice.ts - Economy meals
src/store/economyMealSlice.ts - Business inventory
src/store/businessInventorySlice.ts - Economy inventory
src/store/economyInventorySlice.ts - Redux state and persistence
src/store/index.ts - Inventory change feed
src/hooks/useInventoryChanges.ts
Edge data services
- REST client
src/services/api.ts - Couchbase Edge Server
- Capella App Services
Other components
- Passenger
Connections 26
- Passenger → Class app shell: opens app
README.md - Class app shell → Meal browsing: renders
src/App.tsx - Class app shell → Cart and editing: renders
src/App.tsx - Meal browsing → Meal card: renders
src/components/MealPage.tsx - Meal browsing → Business meals: loads or selects
src/components/MealPage.tsx - Meal browsing → Economy meals: loads or selects
src/components/MealPage.tsx - Meal browsing → Business inventory: loads inventory
src/components/MealPage.tsx - Meal browsing → Economy inventory: loads inventory
src/components/MealPage.tsx - Meal browsing → Inventory change feed: subscribes
src/components/MealPage.tsx - Cart and editing → Business meals: updates selection
src/components/Cart.tsx - Cart and editing → Economy meals: updates selection
src/components/Cart.tsx - Cart and editing → Confirmed order view: renders
src/components/Cart.tsx - Cart and editing → Order confirmation: renders
src/components/Cart.tsx - Order confirmation → Business inventory: submits order
src/components/OrderSummaryDialog.tsx - Order confirmation → Economy inventory: submits order
src/components/OrderSummaryDialog.tsx - Business inventory → REST client: fetches and writes
src/store/businessInventorySlice.ts - Economy inventory → REST client: fetches and writes
src/store/economyInventorySlice.ts - Business meals → REST client: fetches meals
src/store/businessMealSlice.ts - Economy meals → REST client: fetches meals
src/store/economyMealSlice.ts - REST client → Couchbase Edge Server: REST requests
README.md - Inventory change feed → Couchbase Edge Server: streams changes
src/hooks/useInventoryChanges.ts - Couchbase Edge Server → Capella App Services: syncs when online
README.md - Redux state and persistence → Business meals: configures reducer
src/store/index.ts - Redux state and persistence → Economy meals: configures reducer
src/store/index.ts - Redux state and persistence → Business inventory: configures reducer
src/store/index.ts - Redux state and persistence → Economy inventory: configures reducer
src/store/index.ts