Complete Project Catalog: View PDF
This is a modern client-side application for a Food & Beverage ordering system that provides a seamless dining experience. The platform enables customers to browse menus, place orders, track their order status in real-time, and manage their bills efficiently.
This client website is part of a larger ecosystem that includes multiple components working together to provide a complete F&B management solution:
- Each table features a unique QR code
- Customers scan QR code to access the digital menu
- Automatic table association upon login
- Secure OTP-based authentication system
-
Table Access
- Scan table's QR code
- Enter phone number for authentication
- Receive and verify OTP
- Gain access to digital menu
-
Order Management
- Browse available menu items (controlled by kitchen)
- Add items to cart
- Place orders
- Track order status in real-time
- View order history
- Request waiter assistance
-
Service Flow
- Orders sent to kitchen admin panel
- Kitchen updates item status
- Waiters notified of ready items
- Real-time delivery tracking
- Digital bill generation
-
Admin Panel (Separate Application)
- Waiter/Captain management
- Table management
- Menu item availability control
- Order tracking and management
- Real-time kitchen coordination
- Staff assignment and monitoring
-
Waiter App (Flutter Application)
- Real-time order notifications
- Order pickup management
- Table service requests
- Delivery confirmation
- Status updates
-
Kitchen Management System
- Real-time order queue
- Item availability updates
- Order status management
- Preparation time tracking
- Instant order updates
- Live menu item availability
- Real-time waiter call system
- Synchronized order tracking
- Immediate status notifications
This client website represents the customer-facing component of a comprehensive F&B management ecosystem, designed to streamline the dining experience while providing efficient tools for staff and management.
- Overview
- Tech Stack
- Getting Started
- Project Setup
- Development Guidelines
- Testing
- Performance
- Security
- Troubleshooting
- Contributing
- API Architecture
- Data Flow
- Authentication System
- Key Features
- State Management
- API Endpoints
- Frontend Framework: React 18.2.0 with TypeScript
- State Management: Redux Toolkit with Redux Persist
- Routing: React Router DOM 6.x
- Build Tool: Vite 4.x
- Styling: TailwindCSS 3.x with custom animations
- HTTP Client: Axios
- Form Handling: React Hook Form with Zod validation
- UI Components:
- Radix UI primitives
- Headless UI components
- Hero Icons
- Lucide React icons
- Language: TypeScript 5.x
- Linting: ESLint with TypeScript parser
- Package Manager: npm/yarn
- Code Formatting: Integrated with VSCode
- Version Control: Git
fandb-client-website/
├── src/
│ ├── assets/ # Static assets
│ ├── components/ # React components
│ ├── store/ # Redux store and slices
│ ├── apis/ # API integration
│ ├── utils/ # Utility functions
│ └── lib/ # Shared libraries
├── public/ # Public assets
└── config/ # Configuration files
- Use TypeScript for type safety
- Follow ESLint rules
- Use functional components with hooks
- Implement proper error handling
- Write meaningful comments
- Use proper naming conventions
-
Component Structure
- Keep components small and focused
- Use custom hooks for logic reuse
- Implement proper prop typing
-
State Management
- Use Redux for global state
- Local state for component-specific data
- Implement proper error handling
-
Performance
- Implement proper memoization
- Lazy load components when possible
- Optimize images and assets
- Use proper caching strategies
The API structure is organized into two main categories:
apis/
├── GET/
│ ├── createBill.ts
│ ├── fetchAllMembers.ts
│ ├── fetchAllTables.ts
│ ├── fetchBillByOtp.ts
│ ├── fetchDishCategories.ts
│ ├── fetchDishes.ts
│ ├── fetchDrinkCategory.ts
│ ├── fetchDrinks.ts
│ ├── fetchMyOrders.ts
│ └── fetchRejectedItems.ts
├── POST/
│ ├── authDetails.ts
│ ├── callWaiter.ts
│ ├── fetchMemberInfo.ts
│ ├── placeOrder.ts
│ └── verifyOtp.ts
└── types.ts
-
User Authentication Flow:
LoadingsequenceDiagram participant User participant Auth API participant App State User->>Auth API: Submit phone & details Auth API->>User: Return OTP & user_id User->>Auth API: Verify OTP Auth API->>App State: Store user session
-
Order Management Flow:
LoadingsequenceDiagram participant User participant Order API participant Kitchen participant Bill System User->>Order API: Place Order (dishes/drinks) Order API->>Kitchen: Forward Order Kitchen->>Order API: Update Order Status Order API->>User: Order Status Updates User->>Bill System: Request Bill Bill System->>User: Generate Bill with Details
- Unit Testing: Jest
- Component Testing: React Testing Library
- E2E Testing: Cypress (recommended)
-
Write tests for:
- Components
- Redux reducers
- API integration
- Utils functions
-
Test Coverage:
- Aim for 80% coverage
- Focus on business-critical paths
- Include error scenarios
The authentication system uses a phone number-based OTP verification:
-
Initial Authentication (
authDetails.ts):- Accepts user details (name, phone, table number)
- Returns an OTP and user_id
-
OTP Verification (
verifyOtp.ts):- Verifies the provided OTP
- Establishes user session upon successful verification
-
Order Management:
- Separate handling for food and drinks
- Real-time order status tracking
- Support for order modifications
- Rejected items handling
-
Menu Management:
- Categorized view of dishes and drinks
- Detailed item information including prices
- Support for item descriptions and images
-
Bill Generation:
- Automatic calculation of totals
- Support for membership discounts
- Itemized bill with GST calculations
- OTP-based bill verification
The application uses Redux for state management with the following slices:
store/
├── slices/
│ ├── authSlice.ts # Authentication state
│ ├── cartDishSlice.ts # Food items in cart
│ ├── cartDrink.ts # Drinks in cart
│ ├── menuSlice.ts # Available menu items
│ └── myOrdersSlice.ts # User's order history
POST /api/client/createCustomer: Create new customer sessionPOST /api/client/verifyOtp: Verify OTP for authentication
POST /api/client/setOrders: Place new orderGET /api/client/fetchMyOrders: Retrieve user's ordersGET /api/client/fetchRejectedItems: Get rejected order items
GET /api/client/fetchDishes: Get available dishesGET /api/client/fetchDrinks: Get available drinksGET /api/client/fetchDishCategories: Get dish categoriesGET /api/client/fetchDrinkCategory: Get drink categories
GET /api/client/createBillByUserId/:user_id/:amt/:membership_id: Generate billGET /api/client/fetchBillByOtp: Retrieve bill using OTP
POST /api/client/callWaiter: Request waiter assistanceGET /api/client/fetchAllTables: Get tables informationGET /api/client/fetchAllMembers: Get membership information
Key data models include:
-
Order Model:
interface Orders { tableNo: string, user_id: string, otp: string, drinks?: OrderDrink[], dishes?: OrderDish[], }
-
Bill Details Model:
interface BillDetails { otp: string, DishItems: DishItem[], DrinkItems: DrinkItem[], grandTotal: number, dishTotal: number, drinkTotal: number, cgst: number, sgst: number }
-
User Model:
interface UserState { username: string, phoneNumber: string, otp: string, user_id: string, tableNo: string, membership_id: string, member_name: string, member_phoneNo: string, }
-
Code Splitting
- Route-based splitting
- Component lazy loading
- Dynamic imports
-
Asset Optimization
- Image optimization
- Font optimization
- CSS minification
-
Caching Strategy
- Redux persist configuration
- API response caching
- Static asset caching
- First Contentful Paint (FCP) < 1.8s
- Time to Interactive (TTI) < 3.8s
- Cumulative Layout Shift (CLS) < 0.1
-
Authentication
- OTP-based verification
- Session management
- Token expiration
-
Data Protection
- HTTPS enforcement
- XSS prevention
- CSRF protection
-
Best Practices
- Input sanitization
- Secure HTTP headers
- Regular dependency updates
-
Build Issues
# Clear node modules and lock file rm -rf node_modules package-lock.json npm install -
API Connection Issues
- Verify API URL in .env
- Check network connectivity
- Verify CORS configuration
-
State Management Issues
- Clear localStorage
- Reset Redux persist store
- Check Redux DevTools
- Fork the repository
- Create a feature branch
- Commit changes
- Submit a pull request
- Update documentation
- Add/update tests
- Ensure CI passes
- Get code review
- Follow the PR template
- Write meaningful commit messages
- Keep changes focused and atomic
- Include test coverage
This documentation provides a comprehensive overview of the F&B client website. The system is designed to be scalable, maintainable, and user-friendly, with clear separation of concerns and robust error handling. For additional support or queries, please open an issue in the repository.