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!

System Requirements

System Requirement Document
Page 1 of 8

System Requirements Document for frozen-architecture

Introduction

The purpose of this document is to outline the system requirements for the "frozen-architecture" project, a production-ready food delivery platform inspired by Zomato/Swiggy functionality. The platform will feature original branding, UI, code, and assets, ensuring a scalable, secure, and commercial-grade application.

System Overview

The "frozen-architecture" project aims to deliver a comprehensive food delivery platform with distinct applications for customers, restaurant owners, delivery partners, and administrators. The platform will support real-time tracking, robust payment systems, and extensive testing, ensuring all calculations occur server-side and implementing secure practices throughout.

Page 2 of 8

Product Interpretation and Delivery Boundary

  • Domain Descriptors:

    • Food Delivery Platform: Designed to facilitate food ordering and delivery services.
    • Real-Time Order Management: Essential for order tracking and delivery.
  • What is being built:

    • A food delivery platform with original branding and functionality inspired by Zomato/Swiggy.
    • Custom UI for various user roles and real-time features.
  • Excluded Assumptions:

    • Generic e-commerce features.
    • Non-food related services.
  • Access:

    • Application-owned identity with persistent identity management.
  • Behavior Contracts:

    • Customer Order Placement: Customers can select items, proceed to checkout, and place orders.
    • Restaurant Order Management: Restaurant owners manage orders and update preparation status.
    • Real-Time WebSocket Connection: Establishes real-time updates for users.
    • Payment Verification: Secure payment processing and verification.
    • Delivery Assignment: Automated process for finding and ranking delivery partners.
Page 3 of 8

Page Content and Component Coverage

  • Customer App:

    • Search for restaurants and food items.
    • View restaurant details, menu, and reviews.
    • Manage cart and checkout process.
    • Real-time order updates and notifications.
  • Restaurant Dashboard:

    • Manage restaurant listings, menus, and orders.
    • View analytics and revenue reports.
    • Respond to customer reviews.
  • Delivery Partner App:

    • Accept and fulfill delivery assignments.
    • Track earnings and manage availability.
  • Admin Dashboard:

    • User, restaurant, and driver management.
    • Monitor orders and handle support tickets.
    • Manage coupons, refunds, and analytics.
Page 4 of 8

Functional Requirements as Story Points

  • As a Customer, I should be able to authenticate using phone OTP, email, or Google login.
  • As a Customer, I should be able to search for restaurants, food items, and cuisines.
  • As a Customer, I should be able to filter search results by rating, distance, and price.
  • As a Customer, I should be able to manage my cart, apply coupons, and proceed to checkout.
  • As a Restaurant Owner, I should be able to manage my restaurant's menu and orders.
  • As a Delivery Partner, I should be able to accept delivery assignments and track orders.
  • As an Admin, I should be able to manage users, restaurants, and drivers.
  • As a System, I should ensure all financial calculations are performed server-side.
  • As a System, I should verify payments using secure webhooks.

User Personas

  • Customer: End-user who orders food through the platform.
  • Restaurant Owner: Manages restaurant listings and orders.
  • Delivery Partner: Handles food delivery to customers.
  • Admin: Oversees platform operations and user management.
  • Super Admin: Has elevated privileges for platform management.
  • Support Agent: Provides customer support and resolves issues.
Page 5 of 8

Core User Flows

  1. Customer Order Flow:

    • Search for restaurants.
    • Select food items and add to cart.
    • Proceed to checkout and place order.
    • Receive real-time order updates.
  2. Restaurant Management Flow:

    • Manage restaurant details and menu.
    • Accept or reject orders.
    • Update order preparation status.
  3. Delivery Partner Flow:

    • Accept delivery assignments.
    • Navigate to pickup and delivery locations.
    • Confirm delivery completion.
  4. Admin Management Flow:

    • Manage platform users and entities.
    • Monitor orders and handle support tickets.
Page 6 of 8

Visuals Colors and Theme

  • Primary: #FF5733 (Dominant brand color)
  • Primary Light: #FF8A66 (Hover states and secondary UI)
  • Secondary: #333333 (Supporting neutral color)
  • Accent: #FFC300 (Emphasis for CTAs and active states)
  • Highlight: #DAF7A6 (Hover states and notifications)
  • Background: #FFFFFF (Page background color)
  • Surface: #F2F2F2 (Card/panel background)
  • Text: #000000 (Primary text/heading color)
  • Text Muted: #666666 (Secondary text, labels)
  • Border: #DDDDDD (Subtle accessible border color)

Signature Design Concept

The design concept for the "frozen-architecture" project will focus on a clean, modern aesthetic with a user-friendly interface. The Customer App's landing page will feature a prominent search bar and categories for easy navigation. The use of vibrant colors and clear typography will enhance readability and user engagement.

Interaction Model & Motion Direction

  • Interaction Model: Animated
    • Moderate scroll-triggered reveals and hover transitions.
    • Spring physics on interactive elements for a polished experience.
Page 7 of 8

Non-Functional Requirements

  • Security: Implement HTTPS, JWT Authentication, rate limiting, input validation, SQL injection prevention, XSS protection, secure cookies, secret management, and audit logs.
  • Performance: Ensure server-side calculations for financial transactions.
  • Scalability: Support for real-time updates and notifications.

Tech Stack

  • Frontend: Next.js + React + TypeScript, Tailwind CSS + shadcn/ui, Responsive PWA
  • Backend: Node.js + NestJS, 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

Assumptions and Constraints

  • All prices, discounts, taxes, and delivery fees must be calculated on the server.
  • Implement idempotency to prevent duplicate orders.
  • Secure webhooks for payment verification.
  • Coupon calculations must happen server-side.
Page 8 of 8

Glossary

  • RBAC: Role-Based Access Control
  • PWA: Progressive Web App
  • OTP: One-Time Password
  • API: Application Programming Interface
  • UI/UX: User Interface/User Experience
  • JWT: JSON Web Token

This document serves as a comprehensive guide for the development of the "frozen-architecture" project, ensuring all requirements are met for a successful implementation.

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