How fewxxt/healthy-food works
HealthyFood is a Thai-language healthy-food ordering site. Customers browse a locally defined menu, add items to a browser-persisted cart, apply coupons, choose a payment method, and reach a confirmation page with simulated delivery progress. Google sign-in gates ordering and profile access; reviews have a separate authenticated submission and admin deletion flow. The README documents these capabilities, while sampled source confirms the cart/order and review API behavior. Payment processing and order persistence are demo-level; unsampled page details are represented only where documented.
Main entry points: cart/page.tsx Cart and checkout · auth.ts Google authentication · app/page.tsx Home page · reviews/page.tsx Review page
Components 26
Storefront and catalog
- Home page
src/app/page.tsx - Menu browsing
src/app/order/page.tsx - Food catalog
src/lib/foods.ts - Food types
src/lib/types.ts - Popular menu
src/components/PopularMenu.tsx - Navigation
src/components/Navbar.tsx - Footer
src/components/Footer.tsx
Cart and ordering
- Cart and checkout
src/app/cart/page.tsx - Cart state
src/components/Providers.tsx - Coupon collection
src/app/coupons/page.tsx - Order API
src/app/api/orders/route.ts - Order confirmation
src/app/success/page.tsx - Popup dialogs
src/components/Dialog.tsx
Identity and profile
- Customer profile
src/app/profile/page.tsx - Login page
src/app/login/page.tsx - Google authentication
src/auth.ts - Auth route
src/app/api/auth/[...nextauth]/route.ts - Access control
src/middleware.ts
Customer reviews
- Review page
src/app/reviews/page.tsx - Review displays
src/components/HomeReviews.tsx - Star ratings
src/components/Stars.tsx - Reviews API
src/app/api/reviews/route.ts - Review storage
src/app/api/reviews/route.ts
Other components
- Customer
- Upstash Redis
- Google OAuth
Connections 35
- Customer → Home page: browses
README.md - Home page → Popular menu: renders
src/app/page.tsx - Home page → Review displays: renders
src/app/page.tsx - Home page → Footer: renders
src/app/page.tsx - Home page → Menu browsing: links to
src/app/page.tsx - Menu browsing → Food catalog: reads
src/app/order/page.tsx - Food catalog → Food types: uses type
src/lib/foods.ts - Popular menu → Food catalog: reads
src/components/PopularMenu.tsx - Customer → Menu browsing: selects dishes
README.md - Customer → Cart and checkout: checks out
README.md - Menu browsing → Cart state: adds dishes
README.md - Cart and checkout → Cart state: reads and updates
src/app/cart/page.tsx - Coupon collection → Cart state: collects codes
README.md - Cart and checkout → Customer profile: requests details
src/app/cart/page.tsx - Cart and checkout → Order API: submits order
src/app/cart/page.tsx - Order API → Google authentication: checks session
src/app/api/orders/route.ts - Cart and checkout → Order confirmation: routes after order
src/app/cart/page.tsx - Order confirmation → Customer: shows progress
README.md - Customer → Login page: signs in
README.md - Login page → Google authentication: starts sign-in
- Auth route → Google authentication: uses handlers
src/app/api/auth/[...nextauth]/route.ts - Google authentication → Google OAuth: authenticates with
src/auth.ts - Access control → Google authentication: checks access
src/middleware.ts - Customer → Customer profile: updates delivery details
README.md - Customer → Review page: writes reviews
README.md - Review page → Reviews API: submits and deletes
src/app/reviews/page.tsx - Review displays → Reviews API: fetches reviews
src/components/HomeReviews.tsx - Reviews API → Google authentication: checks session
src/app/api/reviews/route.ts - Reviews API → Review storage: loads and saves
src/app/api/reviews/route.ts - Review storage → Upstash Redis: uses when configured
src/app/api/reviews/route.ts - Review displays → Star ratings: renders ratings
src/components/HomeReviews.tsx - Review page → Star ratings: renders ratings
src/app/reviews/page.tsx - Cart and checkout → Popup dialogs: prompts customer
src/app/cart/page.tsx - Review page → Popup dialogs: prompts customer
src/app/reviews/page.tsx - Navigation → Customer: provides navigation
README.md