Product Requirements Document (PRD)
System Architecture & Technical Specifications for Raku's Kitchen Ordering Engine
1. System Overview & Technical Architecture
The Raku's Kitchen Platform is built as a server-rendered, edge-optimized progressive web application using Next.js 14 App Router, backed by Google Cloud Firestore for real-time order state distribution and Firebase Authentication for frictionless phone OTP verification.
| Architectural Layer |
Technology Selected |
Strategic Architectural Purpose |
| Frontend & Backend |
Next.js 14.2 (App Router), React 18, TypeScript 5.6 |
Unified full-stack architecture with React Server Components (RSC) and secure server action APIs. |
| Design & Styling |
Tailwind CSS 3.4 + Lucide Icons |
Mobile-first responsive UI tailored for high-converting smartphone shopping experiences. |
| Authentication |
Firebase Auth (Phone OTP) |
Zero-friction phone number authentication eliminates customer password drop-offs. |
| Database |
Cloud Firestore (NoSQL) |
Real-time bi-directional synchronization (onSnapshot) powering the kitchen admin console. |
| Payments Gateway |
Razorpay SDK + Server Webhooks |
UPI, NetBanking, and Card payments with server-side signature verification. |
| Maps & Geocoding |
Ola Maps Autocomplete & Reverse API |
Verified address selection and high-precision latitude/longitude coordinate capture. |
| Courier Automation |
Borzo 1-Click Business API + Porter Deep-link |
Instant courier booking directly from the kitchen dashboard. |
2. Detailed Functional Specifications
Module 1: Catalog & Weight-Based Biryani Engine
- Weight Selection Model: Biryani can be ordered in ½ kg, 1 kg, 2 kg, and 3 kg weight tiers. Non-biryani gravies (Chilly Chicken, Mutton Chops) are selectable in ½ kg and 1 kg weight portions.
- Extra Meat Add-on Rules: Customers can add extra meat (in 250g increments) up to a strict cap determined by the base container weight.
- Composite Cart Keying: Cart lines are stored under composite keys (menuId, variant). Orphan extra-meat lines are automatically purged or clamped if parent lines are decremented.
- Packaging Calculation: Fixed packaging fee of ₹20 per individual item unit is computed automatically.
Module 2: Cart & Server-Side Price Verification
Server-Side Trust Boundary: The client browser is treated as untrusted. Client-submitted prices are discarded. The server function recomputeOrderTotals imports the canonical menu catalog and recalculates item base prices, variant differentials, extra meat add-ons, and quantity-based packaging fees before creating the Razorpay order.
Module 3: Slot Scheduling & Operational Constraints
- Meal Slot Picker: Customers select between Lunch (ready at 12:30 PM) and Dinner (ready at 7:30 PM).
- Date Validation: Mondays and Thursdays are blocked. Sunday dinner slots are blocked. 1-day advance booking rules are enforced at the API boundary.
Module 4: Address Verification & Geolocation
- Ola Maps Autocomplete: Real-time address typeahead restricted to Bangalore geofence.
- Structured Address Schema: Captures complete flat/door number, landmark, pin code, street address, and exact lat/lng coordinates to power courier dispatch.
Module 5: Payment Processing (Razorpay)
- Server-Side Order Creation: Next.js Route Handler calls razorpay.orders.create with strictly verified rupee amounts.
- Webhook Verification: Cryptographic HMAC SHA256 signature verification validates razorpay_signature before moving order status to Confirmed.
Module 6: Kitchen Admin Operations Dashboard (`/admin`)
- Real-Time Firestore Feed: Orders render instantaneously without page refreshes via Firestore listeners.
- Priority Status Workflow: Orders navigate through a strict state machine:
Confirmed → Preparing → Out for Delivery → Delivered (or Cancelled).
- Logistics 1-Click Booking:
- Borzo Business API: Calculates delivery quotes and books two-wheeler couriers with pickup instructions in 1 click.
- Porter Integration: Generates formatted delivery notes and launches Porter app deep-links with customer address on the clipboard.
- Customer WhatsApp Sync: Dedicated click-to-chat links prefill localized status updates with order numbers, ETA, and tracking info.
3. Cloud Firestore Data Schema
Canonical JSON structure for the orders collection:
{
"orderId": "RK-2026-1004-9842",
"customer": {
"name": "Arun Kumar",
"phone": "+919876543210",
"uid": "fb_auth_user_9921"
},
"slot": {
"date": "2026-10-05",
"meal": "lunch",
"readyTime": "12:30 PM"
},
"items": [
{
"id": "chicken-biryani",
"variant": "1kg",
"quantity": 2,
"unitPrice": 799,
"extraMeat": 250,
"extraMeatCost": 150
}
],
"financials": {
"subtotal": 1898,
"packagingFee": 40,
"deliveryFee": 0, // Paid to courier directly
"total": 1938
},
"payment": {
"provider": "razorpay",
"orderId": "order_PUh298hsdf",
"paymentId": "pay_PUh3872hf",
"status": "PAID"
},
"delivery": {
"address": "42, 2nd Cross, Jambusavari Dinne, JP Nagar 8th Phase",
"lat": 12.8712,
"lng": 77.5814,
"provider": "borzo",
"trackingId": "BORZO-99214-BLR"
},
"status": "Confirmed",
"createdAt": "2026-10-04T12:30:00Z"
}
4. Non-Functional & Security Requirements
- Security Rules: Firestore security rules guarantee customers can read only their own orders via Firebase Auth UID. Kitchen admins must have verified records in the /admins/{uid} allowlist.
- Concurrency & High Traffic: Serverless Next.js edge runtime scales to handle festive and Sunday spikes with sub-200ms API latency.
- PWA / Mobile Performance: Fast initial bundle load (<1.5s on 4G) with offline caching for catalog images.
Document Sign-off: This Product Requirements Document forms the certified technical baseline for Raku's Kitchen platform developed by Nexus Development. All described modules are built, verified, and scheduled for public Go-Live 20 calendar days following client signature execution.