How iyiu9akhan/pizzahub works
PizzaHub is a role-based pizza ordering platform. Customers browse and review items, place and track orders, and manage a profile; vendors manage menus and incoming orders, with Premium upgrades; admins moderate users and items and inspect transactions. The Next.js app uses Better Auth and server-side API helpers to connect the user experience to a separately maintained Express/MongoDB backend, plus Stripe and ImgBB. Backend request details and several dashboard implementations were not sampled, so those links are grounded in README descriptions rather than inspected handlers.
Main entry points: menu/page.tsx Menu browsing · dashboard Vendor dashboard · customer/page.tsx Customer dashboard · admin/page.tsx Admin dashboard
Components 27
Public discovery
- Home and featured menu
app/(home)/page.tsx - Menu browsing
app/menu/page.tsx - Search and filters
components/menu/browse/MenuBrowser.tsx - Item details
components/menu/details/MenuItemDetails.tsx - Item reviews
components/menu/details/ItemReviewsSection.tsx
Identity and access
- Login and registration
components/auth/AuthLayout.tsx - Auth client
lib/auth-client.ts - Auth and sessions
lib/auth.ts
Customer experience
- Customer dashboard
app/dashboard/customer/page.tsx - Order history
app/dashboard/customer/my-orders/page.tsx - Wishlist
lib/api/wishlist.ts
Vendor and admin operations
- Vendor dashboard
app/dashboard - Menu item management
lib/actions/ItemActions.ts - Incoming order management
components/dashboard/admin/orders/ManageOrders.tsx - Admin dashboard
app/dashboard/admin/page.tsx - User and item moderation
app/dashboard/admin - Platform transactions
components/dashboard/admin/transactions/ManageTransactions.tsx
Integrations and data access
- Role and API access
lib/core/server.ts - Order data access
lib/api/orders.ts - PizzaHub API
- MongoDB
lib/mongodb.ts - Checkout session route
app/api/checkout_sessions/route.ts - Stripe
- Payment webhook
app/api/webhook/route.ts - Image upload route
app/api/upload/route.ts - ImgBB hosting
lib/core/imgbb.ts
Other components
- Visitor or customer
Connections 33
- Visitor or customer → Home and featured menu: opens
app/(home)/page.tsx - Visitor or customer → Menu browsing: browses
app/menu/page.tsx - Home and featured menu → Menu browsing: features items
app/(home)/page.tsx - Menu browsing → Search and filters: renders
app/menu/page.tsx - Menu browsing → Item details: opens item
- Menu browsing → PizzaHub API: fetches items
app/menu/page.tsx - Item details → Item reviews: renders
components/menu/details/ItemReviewsSection.tsx - Item reviews → PizzaHub API: submits reviews
- Visitor or customer → Login and registration: signs in
- Login and registration → Auth client: uses
app/login/page.tsx - Auth client → Auth and sessions: configures client
lib/auth-client.ts - Auth and sessions → MongoDB: persists auth
lib/auth.ts - Customer dashboard → Role and API access: requires role
app/dashboard/customer/page.tsx - Customer dashboard → Order data access: loads orders
app/dashboard/customer/page.tsx - Customer dashboard → PizzaHub API: loads statistics
app/dashboard/customer/page.tsx - Order history → Order data access: loads history
app/dashboard/customer/my-orders/page.tsx - Visitor or customer → PizzaHub API: places orders
- Visitor or customer → Wishlist: manages wishlist
- Vendor dashboard → Menu item management: manages items
README.md - Vendor dashboard → Incoming order management: handles orders
README.md - Vendor dashboard → Checkout session route: starts upgrade
README.md - Checkout session route → Stripe: creates session
app/api/checkout_sessions/route.ts - Stripe → Payment webhook: sends event
README.md - Payment webhook → MongoDB: records payment
app/api/webhook/route.ts - Vendor dashboard → Image upload route: uploads images
README.md - Image upload route → ImgBB hosting: uploads image
app/api/upload/route.ts - Admin dashboard → Role and API access: requires role
app/dashboard/admin/page.tsx - Admin dashboard → User and item moderation: provides controls
README.md - Admin dashboard → Platform transactions: views transactions
README.md - Menu item management → PizzaHub API: manages catalog
- Incoming order management → PizzaHub API: updates orders
- User and item moderation → PizzaHub API: moderates platform
- Order data access → PizzaHub API: fetches orders
lib/api/orders.ts