How roth-sorayuth/foodlink works
Foodlink is a surplus-food rescue platform with separate customer and merchant web apps backed by an API and realtime gateway. Customers discover nearby listings, reserve food, and manage pickup orders; merchants manage listings and stores, fulfill orders, and view analytics. The graph preserves those distinct stages and notification/realtime capabilities. Source excerpts are partial, so some page-to-page and client-to-endpoint wiring is represented only where supported by the tree or documentation.
Main entry points: src/App.jsx Customer app shell · src/App.jsx Merchant app shell · api.js Merchant API client · index.js API route dispatch
Components 34
Customer app
- Customer app shell
customer/src/App.jsx - Discover listings
customer/src/components/customer/CustomerExploreFeed.jsx - Map exploration
customer/src/components/customer/ExploreView.jsx - Bakery details
customer/src/components/customer/BakeryDetailPage.jsx - Checkout and claim
customer/src/components/customer/CustomerCheckoutFlow.jsx - Active pickup
customer/src/components/customer/CustomerActivePickup.jsx - Customer profile
customer/src/components/customer/CustomerProfile.jsx - Local session state
customer/src/utils/userSession.js - Customer API client
customer/src/services/api.js
Merchant portal
- Merchant app shell
merchant/src/App.jsx - Listing management
merchant/src/pages/Listings/MerchantListings.jsx - Create listing
merchant/src/pages/Listings/CreateListingPage.jsx - Order fulfillment
merchant/src/pages/Orders/MerchantOrders.jsx - Pickup verification
merchant/src/pages/Orders/VerifyPickupPage.jsx - Merchant dashboard
merchant/src/pages/Dashboard/MerchantDashboard.jsx - Merchant analytics
merchant/src/pages/Analytics/MerchantAnalytics.jsx - Store profile
merchant/src/pages/StoreProfile/MerchantProfile.jsx - Merchant API client
merchant/src/services/api.js - Merchant realtime client
merchant/src/services/socket.js
API and realtime
- API server
server/src/index.js - API route dispatch
server/src/routes/index.js - Listing routes
server/src/routes/listings.js - Order routes
server/src/routes/orders.js - Store routes
server/src/routes/stores.js - Notification routes
server/src/routes/notifications.js - Analytics routes
server/src/routes/analytics.js - Listing operations
server/src/controllers/listingsController.js - Order and pickup operations
server/src/controllers/ordersController.js - Store operations
server/src/controllers/storesController.js - Notification operations
server/src/controllers/notificationsController.js - Analytics operations
server/src/controllers/analyticsController.js - Socket.IO gateway
server/src/index.js
Other components
- Customer
- Merchant
Connections 48
- Customer → Customer app shell: uses
- Customer app shell → Discover listings: renders
- Customer app shell → Map exploration: renders
- Customer app shell → Bakery details: renders
- Customer app shell → Checkout and claim: renders
- Customer app shell → Active pickup: renders
- Customer app shell → Customer profile: renders
- Customer app shell → Local session state: saves cart and order
- Customer app shell → Customer API client: requests data
- Discover listings → Customer API client: fetches listings
- Map exploration → Discover listings: filters rescues
- Bakery details → Customer API client: loads store
- Checkout and claim → Customer API client: places order
- Active pickup → Customer API client: verifies pickup
- Merchant → Merchant app shell: uses
- Merchant app shell → Listing management: renders
- Merchant app shell → Create listing: renders
- Merchant app shell → Order fulfillment: renders
- Merchant app shell → Pickup verification: renders
- Merchant app shell → Merchant dashboard: renders
- Merchant app shell → Merchant analytics: renders
- Merchant app shell → Store profile: renders
- Listing management → Merchant API client: manages listings
- Create listing → Merchant API client: publishes listing
- Order fulfillment → Merchant API client: loads orders
- Pickup verification → Merchant API client: verifies pickup
- Merchant dashboard → Merchant API client: loads dashboard
- Merchant analytics → Merchant API client: loads analytics
- Store profile → Merchant API client: updates store
- Customer API client → API server: HTTP requests
- Merchant API client → API server: HTTP requests
- API server → API route dispatch: dispatches API
- API route dispatch → Listing routes: mounts routes
- API route dispatch → Order routes: mounts routes
- API route dispatch → Store routes: mounts routes
- API route dispatch → Notification routes: mounts routes
- API route dispatch → Analytics routes: mounts routes
- Listing routes → Listing operations: dispatches
- Order routes → Order and pickup operations: dispatches
- Store routes → Store operations: dispatches
- Notification routes → Notification operations: dispatches
- Analytics routes → Analytics operations: dispatches
- API server → Socket.IO gateway: hosts sockets
- Order and pickup operations → Socket.IO gateway: emits order events
- Listing operations → Socket.IO gateway: emits listing events
- Merchant realtime client → Socket.IO gateway: connects
- Listing operations → API server: returns API response
- Order and pickup operations → API server: returns API response