How nguyendinhhoai1207/pizza-deluxe works
This is a customer-facing pizza ordering app with an admin dashboard. The customer flow is menu discovery and customization, cart and checkout, order creation, then tracking; administrators manage pizzas, orders, and sales summaries. The client calls a REST API, whose controllers select MongoDB or the persistent JSON fallback. Edges reflect the supplied imports, calls, route registrations, or README statements; several UI capabilities are documented but their detailed implementation was not sampled.
Main entry points: App.jsx App shell · server.js API server · orderController.js Order handling · api.js API client
Components 26
Customer app
- App shell
client/src/App.jsx - Menu browsing
client/src/components/PizzaCard.jsx - Pizza customization
client/src/components/PizzaModal.jsx - Cart state
client/src/context/CartContext.jsx - Cart drawer
client/src/components/CartDrawer.jsx - Checkout
client/src/components/CheckoutModal.jsx - Order tracking
client/src/components/OrderTracker.jsx - Admin dashboard
client/src/components/AdminDashboard.jsx - Account access
client/src/components/AuthModal.jsx - API client
client/src/services/api.js
REST API
- API server
server/server.js - Pizza routes
server/routes/pizzaRoutes.js - Order routes
server/routes/orderRoutes.js - Auth routes
server/routes/authRoutes.js
Commerce services
- Menu management
server/controllers/pizzaController.js - Order handling
server/controllers/orderController.js - Authentication
server/controllers/authController.js - Access control
server/middleware/authMiddleware.js
Persistence
- Pizza model
server/models/Pizza.js - Order model
server/models/Order.js - User model
server/models/User.js - MongoDB
server/config/db.js - JSON fallback store
server/data/store.js - Seed menu data
server/data/samplePizzas.js
Other components
- Shopper
- Administrator
Connections 42
- Shopper → App shell: uses
README.md - Administrator → Admin dashboard: manages
README.md - App shell → Menu browsing: renders
client/src/App.jsx - App shell → Pizza customization: renders
client/src/App.jsx - App shell → Cart drawer: renders
client/src/App.jsx - App shell → Checkout: renders
client/src/App.jsx - App shell → Order tracking: renders
client/src/App.jsx - App shell → Admin dashboard: renders
client/src/App.jsx - Menu browsing → API client: loads menu
client/src/App.jsx - Pizza customization → Cart state: adds item
client/src/components/PizzaModal.jsx - Cart drawer → Cart state: reads and updates
client/src/components/CartDrawer.jsx - Checkout → Cart state: reads cart
client/src/components/CheckoutModal.jsx - Checkout → API client: creates order
client/src/components/CheckoutModal.jsx - Order tracking → API client: looks up order
client/src/components/OrderTracker.jsx - Admin dashboard → API client: manages catalog and orders
client/src/components/AdminDashboard.jsx - Account access → API client: authenticates
client/src/components/AuthModal.jsx - API client → API server: HTTP requests
client/src/services/api.js - API server → Pizza routes: mounts
server/server.js - API server → Order routes: mounts
server/server.js - API server → Auth routes: mounts
server/server.js - Pizza routes → Menu management: dispatches
server/routes/pizzaRoutes.js - Order routes → Order handling: dispatches
server/routes/orderRoutes.js - Auth routes → Authentication: dispatches
server/routes/authRoutes.js - Menu management → Pizza model: queries
server/controllers/pizzaController.js - Menu management → JSON fallback store: uses when offline
server/controllers/pizzaController.js - Order handling → Order model: queries
server/controllers/orderController.js - Order handling → JSON fallback store: uses when offline
server/controllers/orderController.js - Authentication → User model: looks up users
server/controllers/authController.js - Authentication → JSON fallback store: uses when offline
server/controllers/authController.js - Auth routes → Access control: protects routes
server/routes/authRoutes.js - Access control → User model: loads user
server/middleware/authMiddleware.js - Access control → JSON fallback store: uses when offline
server/middleware/authMiddleware.js - Menu management → MongoDB: checks connection
server/controllers/pizzaController.js - Order handling → MongoDB: checks connection
server/controllers/orderController.js - Authentication → MongoDB: checks connection
server/controllers/authController.js - Access control → MongoDB: checks connection
server/middleware/authMiddleware.js - API server → MongoDB: connects
server/server.js - API server → JSON fallback store: initializes
server/server.js - JSON fallback store → Seed menu data: initializes menu from
server/data/store.js - Menu management → Administrator: supports catalog CRUD
README.md - Order handling → Administrator: supports order operations and stats
README.md - Order handling → Shopper: provides order tracking
README.md