Files
frontend/TODO.md
T
Thanh Quy - wolf 284183098e docs: update and create comprehensive markdown documentation
- Updated README.md with current features (Auth, Cart, Feed pages)
- Updated COMPONENTS.md with CartFab and all context providers (Auth, Cart, Menu)
- Created APP.md: detailed documentation of all routes and pages
- Created LIB.md: documentation of types, constants, and contexts
- Created LAYOUTS.md: header and footer component documentation
- Updated TODO.md: reflects completed implementations and future work

This provides agents with comprehensive documentation to understand the project structure and implementation details.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-29 20:17:55 +07:00

4.9 KiB

Coffee Shop Frontend - TODO

Completed Features & Implementations

A. Documentation

  • README.md - Updated with current features (Auth, Cart, Feed, etc.)
  • COMPONENTS.md - Added CartFab, AuthContext, CartContext, MenuContext sections
  • APP.md - New file: Detailed app routes, pages, layouts
  • LIB.md - New file: Types, Constants, Contexts documentation
  • LAYOUTS.md - New file: Header & Footer detailed documentation
  • WORKFLOW.md - Architecture and workflow documentation

B. Authentication System

  • lib/auth-context.tsx - Created Auth context with login/logout/register
  • lib/types.ts - User type with roles (manager, staff, customer)
  • app/(main)/login/page.tsx - Login page with form validation
  • app/(main)/register/page.tsx - Register page with OTP verification
  • localStorage integration - Persist user across sessions
  • Mock auth database - Pre-configured accounts for testing

C. Shopping Cart System

  • lib/cart-context.tsx - Cart context with add/remove/update operations
  • Cart persistence - localStorage integration
  • CartItem interface - With id, name, description, price, quantity
  • Cart operations - addToCart, increaseQty, decreaseQty, removeFromCart, setQuantity
  • Computed totals - totalItems and totalPrice memoized

D. Menu/Category System

  • lib/menu-context.tsx - MenuContext for shared category state
  • Shared state across components - Header mobile menu + Navbar sidebar sync
  • Category filtering - Products filtered by active category

E. Product Pages

  • app/(main)/page.tsx - Main page with sidebar + product grid
  • Responsive product grid - 1-5 columns depending on sidebar & screen size
  • Product search - Search by name and description
  • Category filter - Sidebar collapsible navigation
  • Mobile category menu - Scrollable tabs on < md breakpoint
  • Empty states - Messaging when no products match filters
  • CartProduct component - Product card with image, price, buy button

F. Feed/Discovery Page

  • app/(feed)/feed/page.tsx - Shop discovery page
  • Shop grid - Responsive 1/2/3 column layout
  • Search by name and address - Sticky bottom filter bar
  • Shop cards - Image, name, address, view menu button
  • Empty state - Message when no shops match filters
  • MOCK_SHOPS constant - 5 sample coffee shops
  • layouts/header.tsx - Sticky header with brand and auth demo
  • layouts/footer.tsx - Footer with shop info, social links, WiFi
  • Responsive layouts - Mobile/tablet/desktop optimized
  • Auth state display - Guest/Manager/Staff cycling demo

H. Code Quality & Optimization

  • Dead code removed - Unused imports and exports cleaned
  • Lint passed - 0 errors, 0 warnings
  • Build passed - TypeScript clean, all pages compile
  • Type safety - Full TypeScript coverage
  • React best practices - Hooks, memoization, context patterns

Pending Features (Future Work)

Cart & Ordering

  • Implement cart checkout flow (app/(main)/cart or modal)
  • Cart sidebar/modal with item list and total
  • Order submission API integration
  • Payment page implementation (app/(main)/payment)
  • Order history/tracking page
  • Toast notifications for cart actions

Authentication & User Management

  • Real backend authentication (replace MOCK_AUTH_DB)
  • Real OTP delivery service (SMS integration)
  • User profile page with edit capability
  • Password reset/recovery flow
  • Session management and token refresh

Manager Features

  • Manager dashboard page (app/(manager)/page.tsx)
  • Product management (add/edit/delete)
  • Category management
  • Order management & tracking
  • Sales analytics/dashboard
  • Inventory management

Backend Integration

  • Replace MOCK_PRODUCTS with API calls (GET /api/products)
  • Replace MOCK_SHOPS with API calls (GET /api/shops)
  • Replace MOCK_USERS with real authentication (POST /api/auth/login)
  • Real product images (replace placeholder.jpg)
  • Image upload for products

UX Improvements

  • Dark mode toggle (CSS variables prepared, toggle UI needed)
  • Loading skeletons for product grid
  • Product detail modal/page with full description
  • Wishlist/favorites feature
  • Sort products (price, rating, etc.)
  • Filter by price range
  • Quantity selector in product card
  • Related products suggestions

Performance & SEO

  • Dynamic route generation for products (app/(main)/product/[id]/page.tsx)
  • Dynamic route generation for shops (app/(feed)/shop/[id]/page.tsx)
  • Meta tags and Open Graph for SEO
  • Image optimization and lazy loading
  • Code splitting and dynamic imports

Accessibility & Testing

  • Keyboard navigation testing
  • ARIA labels audit
  • Unit tests for contexts
  • E2E tests for user flows
  • Accessibility audit (WCAG 2.1 AA)