How julianah253/food-app works
This is a restaurant food-ordering application: customers browse meals, add items to a cart, review quantities and totals, enter delivery details, and submit an order. The React app coordinates this flow through shared cart and UI-progress state; checkout posts order data to the backend. The backend file is present, but its implementation was not excerpted, so its internal behavior is not detailed here. Edges reflect visible imports, calls, and the checkout endpoint; unsampled backend internals are left unspecified.
Main entry points: Checkout.jsx Checkout Form · Cart.jsx Cart View · App.jsx React App · CartContext.jsx Cart State
Components 18
Application
- React App
src/App.jsx - Order Header
src/components/Header.jsx
Meal Catalog
- Meal Listing
src/components/Meals.jsx - Meal Card
src/components/MealItem.jsx - Meal Data
src/data/available-meals.json
Cart and Checkout
- Cart View
src/components/Cart.jsx - Cart Line Item
src/components/CartItem.jsx - Checkout Form
src/components/Checkout.jsx - Order Backend
backend/app.js
Shared UI and State
- Cart State
src/store/CartContext.jsx - UI Progress State
src/store/UserProgressContext.jsx - Modal
src/components/UI/Modal.jsx - Button
src/components/UI/Button.jsx - Form Input
src/components/UI/Input.jsx - Error Display
src/components/Error.jsx - HTTP Hook
src/hooks/useHttp.js - Currency Formatting
src/util/formatting.js
Other components
- Customer
Connections 30
- Customer → Order Header: opens cart
src/components/Header.jsx - Customer → Meal Card: adds meal
src/components/MealItem.jsx - React App → Order Header: renders
src/App.jsx - React App → Meal Listing: renders
src/App.jsx - React App → Cart View: renders
src/App.jsx - React App → Checkout Form: renders
src/App.jsx - React App → Cart State: provides state
src/App.jsx - React App → UI Progress State: provides state
src/App.jsx - Meal Listing → Meal Card: renders
src/components/Meals.jsx - Meal Listing → Meal Data: reads
src/components/Meals.jsx - Meal Card → Cart State: adds item
src/components/MealItem.jsx - Order Header → Cart State: reads count
src/components/Header.jsx - Order Header → UI Progress State: opens cart
src/components/Header.jsx - Cart View → Cart State: reads and updates
src/components/Cart.jsx - Cart View → UI Progress State: changes view
src/components/Cart.jsx - Cart View → Cart Line Item: renders
src/components/Cart.jsx - Cart Line Item → Currency Formatting: formats price
src/components/CartItem.jsx - Cart View → Modal: renders
src/components/Cart.jsx - Cart View → Button: renders
src/components/Cart.jsx - Cart View → Currency Formatting: formats total
src/components/Cart.jsx - Checkout Form → Cart State: reads and clears
src/components/Checkout.jsx - Checkout Form → UI Progress State: closes checkout
src/components/Checkout.jsx - Checkout Form → HTTP Hook: submits request
src/components/Checkout.jsx - HTTP Hook → Order Backend: posts order
- Checkout Form → Modal: renders
src/components/Checkout.jsx - Checkout Form → Form Input: renders
src/components/Checkout.jsx - Checkout Form → Button: renders
src/components/Checkout.jsx - Checkout Form → Error Display: renders failure
src/components/Checkout.jsx - Checkout Form → Currency Formatting: formats total
src/components/Checkout.jsx - Meal Card → Currency Formatting: formats price
src/components/MealItem.jsx