Below is a detailed breakdown of the system requirements
Functional Requirements
1. User Management & Authentication
o User Registration & Login: Users must be able to register and log in to the application using secure methods (JWT-based authentication). o User Authorization: Differentiate access levels (e.g., regular customers vs. admin users) so that only authorized users can access administrative functions. 2. Menu & Collection Item Management o Browse Collection Items: Customers should be able to view a list of available Collection items with details such as description, price, and image. o Search & Filter: Enable users to search for food items and filter by categories or other criteria. 3. Cart & Order Processing o Cart Functionality: Customers can add, update, or remove items from their cart before placing an order. o Order Placement: Allow customers to place orders based on the items in their cart. o Order Tracking: Once an order is placed, the system should provide real- time tracking of the order status and history. 4. Payment Integration o Rozorpay Payment Gateway: Secure integration with Stripe to handle payment processing, including support for test (dummy) and live transactions. 5. Admin Panel o Menu Management: Admin users can add, edit, or remove menu items. o Order Management: Provide an interface for administrators to manage, update, and track orders received from customers. 6. API & Data Handling o RESTful API Endpoints: The backend must expose secure endpoints for user management, menu items, orders, and payments. o Data Validation & Error Handling: Ensure that all inputs are validated and errors are managed gracefully.
Non-Functional Requirements
1. Performance & Scalability
o Responsiveness: The application should load quickly and handle multiple simultaneous requests without performance degradation. o Scalability: The system should be designed to scale easily, both vertically and horizontally, to support an increasing number of users and transactions. 2. Security o Data Protection: Sensitive data such as user credentials and payment information must be encrypted and securely stored. o Secure Authentication: Use robust JWT authentication and follow best practices to prevent unauthorized access. o Compliance: Ensure that the application complies with relevant security standards, especially around payment processing. 3. Reliability & Availability o High Availability: The system should be designed for minimal downtime and quick recovery from failures. o Error Tolerance: Implement fault tolerance mechanisms to handle unexpected issues without affecting the user experience. 4. Maintainability & Extensibility o Clean Code & Documentation: The codebase should follow best practices for maintainability, including modular design and comprehensive documentation. o Ease of Updates: The architecture should support adding new features or making changes with minimal impact on existing functionality. 5. Usability & Accessibility o User-Friendly Interface: Both the customer-facing and admin interfaces should be intuitive and easy to navigate. o Responsive Design: The application must be compatible with a variety of devices and browsers. 6. Interoperability o API Integration: Ensure that the system can integrate smoothly with external services (e.g., Rozorpay for payments) and other future integrations. ER DIAGRAM Admin Usecase Diagram User Usecase Diagram Class Diagram Admin Activity Diagram User Activity Diagram Sequence Diagram Collabration Diagram Data Dictionary
1. User
Field Type Description
_id ObjectId Unique User ID (Auto-generated) name String User's full name email String User's email (Unique) password String Hashed password role String User role (user or admin) orders Array List of user’s previous orders (Order references)
2. Admin
Field Type Description
_id ObjectId Unique Admin ID (Auto-generated) name String Admin's full name email String Admin's email (Unique) password String Hashed password role String Always set to "admin"
3. Collection
Field Type Description
_id ObjectId Unique Collection ID name String Collection Name photo String Image URL for the Collection variety Array List of Variety IDs available in the Collection
4. Variety
Field Type Description
_id ObjectId Unique Variety ID name String Name of the Variety description String Details about the variety category String Variety category (e.g., Male, Female) price Number Price of the Variety inventory Number Stock availability count collection ObjectId Reference to the Collection photo String Image URL for the Variety
5. Cart
Field Type Description
_id ObjectId Unique Cart ID user ObjectId Reference to User items Array List of dish items (each item contains variety Id, quantity, price) totalPrice Number Total price of all items in the cart
6. Order
Field Type Description
_id ObjectId Unique Order ID user ObjectId Reference to User who placed the order collection ObjectId Reference to Collection items Array List of Variety items ordered totalPrice Number Total cost of the order status String Order status (Pending, Preparing, Out for Delivery, Delivered) payment ObjectId Reference to Payment collection
7. Payment
Field Type Description
_id ObjectId Unique Payment ID
order ObjectId Reference to Order collection
paymentMethod String Payment type (e.g., Credit Card, UPI, Razorpay)
status String Payment status (Pending, Completed, Failed)
transactionId String Razorpay Transaction ID
createdAt Date Payment timestamp
8. Report (For Admin Analytics)
Field Type Description
_id ObjectId Unique Report ID totalSales Number Total number of orders totalRevenue Number Total earnings from orders topVariety Array List of top-selling dishes topCollection Array List of top-performing Collection generatedAt Date Timestamp when the report was generated