ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β KITCHEN DISPLAY SYSTEM - API MAP β
β IntelliDine API Integration β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β KITCHEN PAGE (http://localhost:3001/kitchen) β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β [π Refresh] [βΈοΈ Pause] [βΆοΈ Resume] β β
β βββββββββββββββββ¬βββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββ€ β
β β PENDING β PREPARING β READY β β
β β (Yellow) β (Blue) β (Green) β β
β βββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββββββββββββββββββ€ β
β β β β β β
β β βββββββββββββ β βββββββββββββ β βββββββββββββ β β
β β β Order #42 β β β Order #41 β β β Order #39 β β β
β β β Table 5 β β β Table 2 β β β Table 1 β β β
β β β $590 β β β $450 β β β $320 β β β
β β β β β β β β β β β β
β β β[Start...] β β β[Mark ...] β β β[Complete]β β β
β β βββββββββββ¬ββ β βββββββββββ¬ββ β ββββββββ¬βββββ β β
β β β β β β β β β
β β (Click)ββββ β (Click)ββββ β (Click)β β β
β β β β β β
β βββββββββββββββββ΄βββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β β
β β β
βΌ βΌ βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β API CALLS MADE BY KITCHEN SYSTEM β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β EVERY 15 SECONDS (Auto-Refresh) β
β ββ GET /api/orders β
β β ββ Query: tenant_id, limit=50, offset=0 β
β β ββ Headers: Authorization, X-Tenant-ID β
β β ββ Returns: [Order, Order, Order, ...] β
β β β
β WHEN STATUS BUTTON CLICKED β
β ββ PATCH /api/orders/{id}/status β
β β ββ Body: { "status": "in_preparation" | "ready" | "completed" } β
β β ββ Headers: Authorization, X-Tenant-ID β
β β ββ Returns: Updated Order object β
β β β
β WHEN CANCEL BUTTON CLICKED β
β ββ PATCH /api/orders/{id}/cancel β
β β ββ Body: { "reason": "cancellation reason" } β
β β ββ Headers: Authorization, X-Tenant-ID β
β β ββ Returns: Cancelled Order object β
β β β
β WHEN MANUAL REFRESH CLICKED β
β ββ GET /api/orders (same as every 15s, but forced immediately) β
β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
β NETWORK REQUEST
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β INTELLIDINE API GATEWAY β
β https://intellidine-api.aahil-khan.tech β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β β
GET /api/orders β Order Service (retrieve orders) β
β β
PATCH /api/orders/{id}/status β Order Service (update status) β
β β
PATCH /api/orders/{id}/cancel β Order Service (cancel order) β
β β
GET /api/orders/{id} β Order Service (get details) β
β β
β Authentication: β
β β’ Header: Authorization: Bearer {jwt_token} β
β β’ Header: X-Tenant-ID: {tenant_id} β
β β’ Rate Limit: 100 requests/minute β
β β’ Timeout: 10 seconds β
β β’ Retry: 3 attempts on GET failure β
β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ORDER SERVICE (Backend) β
β Database: PostgreSQL β
β β’ Stores order details β
β β’ Manages status transitions β
β β’ Enforces multi-tenant isolation β
β β’ Logs all changes β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β RESPONSE BACK TO KITCHEN DISPLAY β
β { β
β "success": true, β
β "data": [ β
β { order details... }, β
β { order details... } β
β ] β
β } β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β REACT QUERY CACHE β
β β’ Cache fresh for 5 seconds β
β β’ Garbage collect after 10 minutes β
β β’ Optimistic updates for fast UI response β
β β’ Automatic refetch on error β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β COMPONENT RE-RENDER β
β β’ Orders grouped into 3 columns (Pending, Preparing, Ready) β
β β’ Color-coded cards (Yellow, Blue, Green) β
β β’ Updated with new status β
β β’ Toast notification sent (success or error) β
β β’ Ready for next action β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
REQUEST:
GET https://intellidine-api.aahil-khan.tech/api/orders?tenant_id=11111111-1111-1111-1111-111111111111&limit=50&offset=0
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
X-Tenant-ID: 11111111-1111-1111-1111-111111111111
Content-Type: application/jsonRESPONSE (200 OK):
{
"success": true,
"data": [
{
"id": "order_001",
"tenant_id": "11111111-1111-1111-1111-111111111111",
"table_id": "5",
"order_number": 42,
"customer_name": "John Doe",
"status": "pending",
"items": [
{
"menu_item_id": "item_001",
"quantity": 2,
"name": "Biryani",
"special_instructions": "Extra spicy"
}
],
"subtotal": 500,
"tax": 90,
"total_amount": 590,
"created_at": "2025-11-09T10:30:00Z",
"updated_at": "2025-11-09T10:30:00Z"
},
{
"id": "order_002",
"tenant_id": "11111111-1111-1111-1111-111111111111",
"table_id": "2",
"order_number": 41,
"customer_name": "Jane Smith",
"status": "in_preparation",
"items": [...],
"subtotal": 400,
"tax": 72,
"total_amount": 472,
"created_at": "2025-11-09T10:15:00Z",
"updated_at": "2025-11-09T10:20:00Z"
}
]
}REQUEST:
PATCH https://intellidine-api.aahil-khan.tech/api/orders/order_001/status
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
X-Tenant-ID: 11111111-1111-1111-1111-111111111111
Content-Type: application/json
{
"status": "in_preparation"
}RESPONSE (200 OK):
{
"success": true,
"data": {
"id": "order_001",
"status": "in_preparation",
"updated_at": "2025-11-09T10:35:00Z"
}
}UI UPDATE:
- Order card immediately changes color: Yellow β Blue
- Toast: β "Order status updated"
- Optimistic update makes change instant
- API refetch confirms in background
REQUEST:
PATCH https://intellidine-api.aahil-khan.tech/api/orders/order_001/cancel
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
X-Tenant-ID: 11111111-1111-1111-1111-111111111111
Content-Type: application/json
{
"reason": "Customer requested cancellation"
}RESPONSE (200 OK):
{
"success": true,
"data": {
"id": "order_001",
"status": "cancelled",
"cancelled_at": "2025-11-09T10:40:00Z"
}
}UI UPDATE:
- Order removed from display
- Toast: β "Order cancelled"
- Next auto-refresh will confirm
Filter for API calls:
Name Method Status Type Time
/api/orders?tenant_id=... GET 200 xhr 456ms
/api/orders/order_001/status PATCH 200 xhr 234ms
/api/orders?tenant_id=... GET 200 xhr 423ms
Request Headers:
GET /api/orders?tenant_id=11111111-1111-1111-1111-111111111111&limit=50&offset=0 HTTP/1.1
Host: intellidine-api.aahil-khan.tech
Authorization: Bearer {jwt_token}
X-Tenant-ID: 11111111-1111-1111-1111-111111111111
Response:
{
"success": true,
"data": [...]
}- Can reach
https://intellidine-api.aahil-khan.tech - GET /api/orders returns orders
- PATCH .../status updates status
- PATCH .../cancel cancels order
- JWT token automatically injected
- X-Tenant-ID header present
- Responses parse correctly
- Error handling works
- No 401/403 errors
- Auto-refresh works every 15s
- Manual refresh works
- Pause/resume works
- Toast notifications appear
- Browser DevTools show correct requests
| Code | Meaning | Action |
|---|---|---|
| 200 | β Success | Process data |
| 400 | β Bad Request | Check parameters |
| 401 | β Unauthorized | Re-authenticate |
| 403 | β Forbidden | Check permissions |
| 404 | β Not Found | Order doesn't exist |
| 429 | β Too Many Requests | Wait & retry |
| 500 | β Server Error | Retry later |
| 503 | β Service Unavailable | API maintenance |
Healthy Kitchen System:
ββ Every 15 seconds βββββββ
β GET /api/orders β β 300-500ms
β Parse response β β 50-100ms
β Update React cache β β <10ms
β Re-render UI β β 100-200ms
β Total cycle: ~800ms β
ββββββββββββββββββββββββββ
When status changes:
ββ Status Change Flow βββββ
β User clicks button β β <10ms
β Optimistic UI update β β <10ms
β PATCH request sent β β 200-400ms
β Response received β β <10ms
β Cache updated β β <10ms
β UI refreshed β β 50-100ms
β Toast shown β β <10ms
β Total: ~800ms β
ββ User sees update: β
β In <100ms (optimistic)β
ββββββββββββββββββββββββββ
System Status: β
PRODUCTION READY
API Integration: β
COMPLETE
Documentation: β
COMPREHENSIVE
Ready to deploy! π