frozen-architecture

byHuzaifa Anwar

Production-Ready Food Delivery App (Zomato-Style) Master Prompt Act as a Principal Software Architect, Senior Full-Stack Engineer, UI/UX Designer, DevOps Engineer, Security Expert, QA Engineer, and Database Architect. Build a production-ready food delivery platform inspired by Zomato/Swiggy functionality, but create completely original branding, UI, code, and assets. Do not copy copyrighted designs, logos, or proprietary code. Tech Stack Frontend: - Next.js + React + TypeScript - Tailwind CSS + shadcn/ui - Responsive PWA Backend: - Node.js + NestJS (or Next.js API) - REST API with versioning Database: - PostgreSQL + Prisma Cache & Jobs: - Redis - BullMQ Real-Time: - WebSocket / Socket.IO Storage: - AWS S3 compatible storage Payments: - Razorpay, PhonePe, Cashfree abstraction layer Maps: - Google Maps or Mapbox abstraction --- User Roles - Customer - Restaurant Owner - Delivery Partner - Admin - Super Admin - Support Agent Implement RBAC (Role-Based Access Control). --- Customer Features Authentication: - Phone OTP - Email login - Google login - Session management Home Page: - Search bar - Categories - Nearby restaurants - Popular restaurants - Offers - Recommendations Search: - Restaurants - Food items - Cuisines Filters: - Rating - Distance - Veg/Non-Veg - Delivery time - Price Location: - Current location - Multiple saved addresses - Delivery radius checking Restaurant Page: - Images - Ratings - Menu - Variants - Add-ons - Offers - Reviews Cart: - Add/remove items - Customizations - Coupons - Taxes - Delivery fee Important: All prices, discounts, taxes, and delivery fees must be calculated on the server. --- Checkout Flow 1. Verify address 2. Verify restaurant availability 3. Validate cart 4. Apply coupon 5. Calculate taxes 6. Create order 7. Process payment 8. Verify payment 9. Notify restaurant Implement idempotency to prevent duplicate orders. --- Order Status CREATED → PAID → RESTAURANT_ACCEPTED → PREPARING → READY → DRIVER_ASSIGNED → PICKED_UP → OUT_FOR_DELIVERY → DELIVERED Support: - Cancelled - Rejected - Refunded --- Restaurant Dashboard Features: - Restaurant onboarding - Menu management - Variants - Pricing - Images - Order acceptance - Analytics - Revenue reports - Reviews --- Delivery Partner App Features: - Registration - Document verification - Online/Offline mode - Accept deliveries - Navigation - Pickup confirmation - Delivery confirmation - Earnings dashboard Track location only when online. --- Delivery Assignment Algorithm 1. Find nearby drivers 2. Calculate distance 3. Rank drivers 4. Send request 5. Reassign if rejected 6. Expand search radius --- Real-Time Features Use WebSockets for: - Order updates - Driver tracking - Restaurant notifications --- Payments Create PaymentService: Methods: - createPayment() - verifyPayment() - refundPayment() Support: - UPI - Cards - Wallets - COD Verify payments using secure webhooks. Never trust frontend payment success. --- Coupons Support: - Percentage - Flat discount - Minimum order - First order - Expiry date - Usage limits Coupon calculations must happen server-side. --- Reviews Customers can rate: - Restaurant - Food - Delivery Support: - 1–5 stars - Comments - Restaurant replies --- Notifications Channels: - Push - SMS - Email - In-app Events: - OTP - Order updates - Payment success - Refunds - Promotions Use background jobs. --- Admin Dashboard Features: - User management - Restaurant approval - Driver approval - Order monitoring - Coupons - Refunds - Analytics - Commission settings - Support tickets Metrics: - Orders - Revenue - Active users - Restaurants - Drivers - Cancellation rate --- Finance Track: Customer Payment → Platform Commission → Restaurant Earnings → Driver Earnings → Refunds Create immutable ledger entries. --- Database Tables users roles restaurants menus menu_items variants addons addresses carts cart_items orders order_items payments refunds delivery_partners driver_locations reviews coupons notifications tickets ledger_entries audit_logs Use: - UUIDs - Indexes - Foreign keys - Timestamps --- Security Implement: - HTTPS - JWT Authentication - Rate limiting - Input validation - SQL injection prevention - XSS protection - Secure cookies - Secret management - Audit logs Never expose API keys. --- API Structure /api/v1/auth /api/v1/restaurants /api/v1/menus /api/v1/cart /api/v1/orders /api/v1/payments /api/v1/reviews /api/v1/admin Response format: { "success": true, "data": {}, "error": null } --- Testing Create: - Unit Tests - Integration Tests - E2E Tests Test: Customer → Restaurant → Driver → Delivery → Payment → Settlement --- Deployment Create: - Docker setup - docker-compose - CI/CD pipeline - Production environment configs Environment Variables: DATABASE_URL REDIS_URL JWT_SECRET PAYMENT_KEYS MAP_KEYS STORAGE_KEYS --- Documentation Generate: - README - API docs - Database schema - Deployment guide - Security guide --- Final Requirement Do not build a demo. Build a scalable, secure, commercial-grade food delivery platform with: - Customer App - Restaurant Dashboard - Delivery App - Admin Dashboard - Payments - Real-time tracking - Analytics - Notifications - Security - Tests - Production deployment support Start by: 1. Architecture 2. Database design 3. API design 4. Authentication 5. Core features 6. Deployment Implement incrementally and ensure every feature is fully functional before proceeding.

LandingAuthenticationDelivery Partner AppRestaurant DashboardCustomer App
Landing

Comments (0)

No comments yet. Be the first!

Landing design preview
Authentication: Admin signs in
Admin Dashboard: Admin accesses dashboard to manage platform entities
Admin Dashboard: Users, restaurants, drivers, coupons, refunds, and analytics managed
Admin Dashboard: Operation not completed or rejected
Landing design preview
Authentication: Admin signs in
Admin Dashboard: Admin accesses dashboard to manage platform entities
Admin Dashboard: Users, restaurants, drivers, coupons, refunds, and analytics managed
Admin Dashboard: Operation not completed or rejected