How tudumtendulkar/smart-food-delivery works
Smart Food Delivery is a React customer, restaurant, and admin platform backed by an Express API and Supabase. The principal customer journey is restaurant/food discovery → cart → checkout and payment → orders and invoices; customers can also receive personalized recommendations based on tracked activity. The graph includes the documented role-based applications and recommendation/chat capabilities. Some backend route registrations and frontend request paths were not excerpted, so those relationships are omitted unless documented or directly evidenced.
Main entry points: recommendationEngine.js Recommendation engine · supabase.js Supabase client · AuthContext.jsx Authentication state · ShopContext.jsx Cart and wishlist
Components 29
Web applications
- Customer app
src/apps/AppCustomer.jsx - Restaurant app
src/apps/AppRestaurant.jsx - Admin portal
src/admin/AppAdmin.jsx - Customer routing
src/App.jsx
Ordering and accounts
- Authentication state
src/context/AuthContext.jsx - Cart and wishlist
src/context/ShopContext.jsx - Food discovery
src/pages/Home.jsx - Restaurant browsing
src/pages/RestaurantDetails.jsx - Cart and checkout
src/pages/Cart.jsx - Orders and invoices
src/pages/Orders.jsx - Payment result
src/pages/PaymentSuccess.jsx - Restaurant operations
src/pages/RestaurantDashboard.jsx - Restaurant management
src/pages/AdminRestaurantPanel.jsx
Personalization and chat
- Activity tracking
src/utils/trackActivity.js - Recommendations UI
src/pages/Recommendations.jsx - Food chat
src/components/ChatWidget.jsx - Recommendation engine
server/recommendation/recommendationEngine.js - Behavior profiles
server/recommendation/behaviorEngine.js
Backend services
- Recommendation routes
server/routes/recommendationRoutes.js - Chat controller
server/chatbot/chatController.js - Order routes
server/routes/orderRoutes.js - Order controller
server/controllers/orderController.js - Restaurant routes
server/routes/restaurantRoutes.js
Persistence and integrations
- Supabase client
server/utils/supabase.js - Supabase
- Firebase Authentication
Other components
- Customer
- Restaurant user
- Administrator
Connections 29
- Customer → Customer app: uses
- Restaurant user → Restaurant app: uses
- Administrator → Admin portal: uses
- Customer app → Customer routing: renders
src/apps/AppCustomer.jsx - Customer routing → Authentication state: provides
src/App.jsx - Customer routing → Cart and wishlist: provides
src/App.jsx - Customer → Food discovery: browses
- Food discovery → Restaurant browsing: selects restaurant
- Restaurant browsing → Cart and wishlist: adds food
- Cart and wishlist → Cart and checkout: supplies cart
- Cart and checkout → Payment result: completes payment
- Payment result → Orders and invoices: continues to orders
- Customer → Authentication state: authenticates
- Authentication state → Firebase Authentication: authenticates with
- Authentication state → Supabase client: calls login API
src/context/AuthContext.jsx - Cart and wishlist → Activity tracking: tracks cart activity
src/context/ShopContext.jsx - Activity tracking → Recommendation engine: sends activity
- Recommendations UI → Recommendation engine: requests suggestions
- Recommendation engine → Behavior profiles: loads profile
server/recommendation/recommendationEngine.js - Recommendation engine → Supabase client: reads and writes
server/recommendation/recommendationEngine.js - Food chat → Chat controller: uses chat API
- Chat controller → Recommendation engine: requests suggestions
server/chatbot/chatController.js - Order routes → Order controller: routes requests
server/routes/orderRoutes.js - Order controller → Supabase client: reads and writes
server/controllers/orderController.js - Restaurant routes → Supabase client: reads and writes
server/routes/restaurantRoutes.js - Supabase client → Supabase: connects
server/utils/supabase.js - Restaurant app → Restaurant operations: supports operations
- Admin portal → Restaurant management: manages restaurants
src/admin/AppAdmin.jsx - Restaurant user → Restaurant routes: uses API