Pakistan's food service industry is growing rapidly, with over 100,000 restaurants operating across the country. Most rely on paper tickets, WhatsApp groups, and spreadsheets to manage daily operations. The gap between how restaurants actually work and the tools available to them is enormous. We built Orbit to close that gap with a platform designed specifically for the constraints and opportunities of the South Asian restaurant market.
The Problem: Fragmented Operations at Every Level
After spending months talking to restaurant owners in Punjab and Sindh, a pattern emerged. The problems were not unique to any single restaurant size or cuisine type. Whether it was a single-branch biryani shop in Lahore or a multi-location fast food chain in Karachi, the operational pain points were consistent:
- Order chaos: Dine-in, takeaway, and delivery orders tracked on paper slips that get lost, misread, or forgotten during rush hours. Kitchen staff guessing priorities.
- No visibility: Owners with multiple branches had no way to see what was happening across locations without physically being there or calling managers.
- Inventory blindness: Stock ran out without warning, leading to menu items being unavailable and revenue lost. Manual counting happened once a week at best.
- Staff accountability: No audit trail of who did what. Disputes over order errors, cash handling, and shift attendance were common.
- Customer disconnect: No way to track repeat customers, understand ordering patterns, or send targeted promotions.
Existing solutions were either too expensive (enterprise POS systems priced in USD), too generic (built for Western markets with incompatible workflows), or too basic (glorified calculators with no real-time capability). We saw an opportunity to build something purpose-built.
Architecture: Multi-Tenancy on Firebase
Orbit is built on Next.js 16 with the App Router, Firebase for authentication and real-time data, and Tailwind CSS for the interface. The architectural decisions were driven by three constraints: real-time performance, multi-tenant isolation, and the ability to ship fast without managing infrastructure.
Firestore Data Model
Every piece of restaurant data lives under a tenant document: tenants/{tenantId}/branches/{branchId}/orders/{orderId}. This hierarchical structure provides natural tenant isolation at the database level. Firestore Security Rules enforce that no user can read or write data outside their tenant unless they hold the superadmin role.
We chose Firestore over a traditional relational database for three reasons: built-in real-time listeners (onSnapshot), automatic scaling without connection pooling headaches, and the hierarchical document model that maps cleanly to multi-tenant restaurant data. The trade-off is limited querying capability, but for our access patterns (mostly tenant-scoped, time-ordered reads), it works well.
Real-Time Order Flow
When a customer places an order (from the QR menu, a cashier, or delivery), Firestore's onSnapshot propagates the change to every connected client within milliseconds. The kitchen display updates instantly. The branch manager's dashboard reflects the new order count. The owner's multi-branch overview ticks up. No polling, no WebSocket server to maintain.
Custom hooks like useOrders subscribe to the order collection with filters for status, date range, and order type. They return unsubscribe functions for cleanup, preventing memory leaks when components unmount.
Role-Based Access: From Superadmin to Kitchen Staff
A restaurant is not a flat organization. The owner needs to see revenue across all branches. A branch manager needs control over their location's menu and staff. A cashier only needs the POS view. Kitchen staff only needs the order queue. Orbit models this with a strict role hierarchy:
- Superadmin: Platform-level access to all tenants, user management, subscription oversight, and commission processing.
- Owner: Full access to their tenant's data across all branches. Can manage staff, view analytics, configure settings.
- General Manager: Cross-branch visibility within the tenant. Can manage branch managers and view consolidated reports.
- Branch Manager: Full control over a specific branch. Menu edits, staff management, inventory, and order oversight.
- Cashier: POS access for creating and managing orders at their assigned branch.
- Kitchen Display: Read-only order queue with status update capability.
Firebase custom claims carry the user's role and tenantId. Every API route verifies these claims before processing requests. The client-side useAuth hook exposes a can(permission) method that UI components use to conditionally render features.
QR Self-Ordering: Reducing Staff Load
One of Orbit's most impactful features is the QR code self-ordering system. Each table or location gets a unique QR code that links to the restaurant's public menu page. Customers scan with their phone camera, browse the menu, customize their order, and submit directly to the kitchen queue.
This eliminates the wait-for-waiter bottleneck during peak hours, reduces order transcription errors (the customer types exactly what they want), and frees staff to focus on preparation and service quality rather than taking orders. The public menu page is server-rendered for fast initial load and SEO, with real-time availability indicators pulled from inventory data.
AI-Powered Insights with Gemini
Orbit integrates Google's Gemini 2.0 Flash model for several AI features that help restaurant owners make better decisions:
- Menu Optimization: Analyzes order frequency, profit margins, and time-of-day patterns to suggest menu changes. Items that sell poorly but have high ingredient costs get flagged for removal or repricing.
- Customer Segmentation: Automatically categorizes customers as new, regular, VIP, or at-risk based on order frequency and recency. Enables targeted promotions without manual analysis.
- Demand Forecasting: Predicts next-week order volumes by day and meal period, helping with staff scheduling and ingredient procurement.
- Smart Inventory Scanning: AI-powered receipt and invoice scanning to auto-populate inventory entries, reducing manual data entry for stock-ins.
These features are gated by subscription tier. The free plan gets basic order management. AI features unlock progressively on Starter (PKR 3,500/mo), Growth (PKR 9,000/mo), and Enterprise (PKR 25,000/mo) plans.
Growth Engine: The Marketing Agent Program
Traditional SaaS acquisition channels (Google Ads, content marketing) are expensive for a market where restaurant owners are not actively searching for software solutions. Many do not even know these tools exist. We needed a distribution strategy that matched the market reality: personal recommendations and trust-based selling.
Orbit's referral system turns local marketers into paid acquisition agents. Each agent gets a unique referral code and QR code. When a restaurant signs up using that code and later upgrades to a paid plan, the agent earns:
- Signup bonus: PKR 500 flat per conversion
- Recurring commission: 15% of the monthly subscription fee, paid every month the restaurant stays subscribed
- Override commission: 5% on earnings from sub-agents they recruit (up to 3 tiers deep)
Agents get their own dashboard showing referral stats, pending commissions, payout history, and team performance. Payouts are processed via bank transfer, EasyPaisa, or JazzCash with a PKR 1,000 minimum threshold. This creates aligned incentives: agents earn more when their referred restaurants succeed and stay subscribed.
Multi-Branch Operations
For restaurant chains, Orbit provides a consolidated view across all locations. The owner dashboard shows real-time order counts, revenue, and alerts from every branch on a single screen. Branch-level drill-downs reveal individual performance metrics.
Each branch operates semi-independently: its own menu (with shared items optionally synced from a master menu), its own staff roster, its own inventory levels, and its own order queue. But financial reporting, customer profiles, and staff management roll up to the tenant level for centralized oversight.
Plan limits enforce branch count: Free gets 1, Starter gets 2, Growth gets 5, and Enterprise is unlimited. Upgrading is seamless because the data model already supports multi-branch from day one.
Technical Decisions That Shaped the Product
Why Next.js App Router
The App Router gives us server components for initial page loads (fast time-to-interactive, good SEO for the public menu), client components for real-time interactive dashboards, and API routes co-located with the frontend. Firebase App Hosting deploys the standalone Next.js build with zero configuration.
Why Tailwind CSS 4 with shadcn/ui
Speed of iteration. With shadcn/ui providing accessible, unstyled component primitives and Tailwind handling all visual styling, we ship UI changes in minutes rather than hours. The component library stays consistent across the platform without maintaining a custom design system.
Why Firebase over Supabase or a Custom Backend
Real-time listeners were non-negotiable for a product where kitchen staff need instant order updates. Firebase Auth's custom claims system maps perfectly to our RBAC model. And the serverless pricing model means we pay proportionally to actual usage rather than provisioning for peak load.
Security Model
Every API route verifies JWT tokens via Firebase Admin SDK. Firestore Security Rules enforce tenant isolation at the database level. Rate limiting protects against abuse. Input validation happens on every endpoint. There is no way to access another tenant's data without the superadmin role, and superadmin actions are logged.
Subscription and Payments
Pakistan's payment landscape is different from Western markets. Credit card penetration is low. We support two payment methods:
- Manual bank transfer: The restaurant transfers to our business account and uploads a receipt. A superadmin verifies and activates the subscription.
- SafePay: An online payment gateway that supports Pakistani debit cards, bank accounts, and mobile wallets for instant activation.
Plan enforcement is checked at resource creation time. When a restaurant on the Free plan tries to create a 51st order in a month, the API returns an upgrade prompt. When they try to add a third staff member beyond the limit, the UI shows the constraint clearly with an upgrade path.
What We Learned
Building for the Pakistani restaurant market taught us several lessons that apply broadly to SaaS products targeting emerging markets:
- Offline resilience matters. Internet connectivity is not guaranteed. The app needs to degrade gracefully when the connection drops mid-order.
- WhatsApp is the distribution channel. Restaurant owners live on WhatsApp. Integration for order notifications, customer messaging, and agent communication is not optional.
- Pricing must be local. PKR-denominated plans priced against local purchasing power, not converted from USD.
- Trust is earned in person. The agent referral program works because a local person explains and demonstrates the product face-to-face. Cold digital marketing alone would not work at this stage.
- Start with the order flow. Everything else (inventory, analytics, AI) is secondary to getting orders from customer to kitchen reliably. Nail that first.
Current Status and Next Steps
Orbit is live at orbit.trostrum.com and onboarding restaurants across Punjab. The immediate roadmap includes expanding the AI capabilities, adding a native mobile app for owners who need push notifications, and building integrations with food delivery aggregators like foodpanda and Cheetay.
The platform handles the full restaurant lifecycle: from a single-branch startup on the free plan discovering what operational visibility looks like, through growth into multiple locations on paid plans with AI-powered decision support, to enterprise chains needing custom workflows and dedicated support.
If you are building SaaS for emerging markets, the playbook is clear: solve a real operational problem, price for the local economy, distribute through trust networks, and build the product to work under imperfect infrastructure conditions.