💡 Inspiration
Every single workday, over 50 million office workers lose 25 precious minutes of their lunch break to what we call the "food order tax": scrolling through 60-item menus, waiting in noisy lines outside cafes, typing 16-digit credit card numbers, and hovering awkwardly around crowded counters.
Delivery apps don't fix this—they charge \$10+ in courier fees, arrive 30 minutes late, and deliver soggy sandwiches. Meanwhile, local artisan cafes get crushed during the 12:15 PM lunch surge, losing customers to line fatigue.
We asked ourselves:
What if lunch ordered itself before hunger struck, held \$0 in payment until you physically arrived, and had freshly plated artisan food waiting in a heated pickup cubby the second you walked through the door?
That is BitePass—the autonomous proactive culinary fast-pass for workplace dining.
⚡ What It Does
BitePass bridges predictive ambient intelligence with real-world physical retail micro-commerce:
- Proactive Calendar Gap Detection: Instead of waiting for you to open an app, BitePass continuously inspects calendar windows (e.g., a 35-minute gap between meetings) and matches walking buffer times ($75\text{ m/min}$) to kitchen prep queues downstairs.
- Deterministic Culinary Intelligence: Powered by Google Gemini, the agent reasons over dining history, daily culinary rotations, and strict FDA Top-9 allergen blocklists to recommend a single, tailored lunch pass.
- 1-Tap Zero-Form Checkout: No endless menus, no coupon fields. 1 tap triggers a PayPal 2-Phase Escrow hold.
- 2-Phase Escrow Protection (\$0 Charged Upfront): Funds are authorized and held safely in escrow during kitchen assembly ($0 leaves your account). If your meeting runs long, cancel within the grace window with zero penalty.
- Kinematic Doorstep Capture ($< 50\text{ m}$): When your smartphone crosses the 50-meter threshold, the system auto-captures payment, illuminates assigned Pickup Cubby #D, and generates your scannable FASTPASS QR code.
- Zero-Second Grab & Go: You walk past a 20-person line, grab your freshly made hot artisan sandwich from the cubby, and walk out.
🛠️ How We Built It
We designed BitePass as a production-grade Hexagonal Monolith with dual-track persistence, guaranteeing offline development speed and enterprise-grade Docker parity:
- Frontend & Experience: Next.js 15 (App Router), React 19, and Tailwind CSS 3.4, implementing a responsive, glassmorphic culinary UI (
0 Bgrid overhead on the consumer pass). - Autonomous Intelligence: Google Gemini (
@google/genai) configured with strictresponseMimeType: 'application/json'and JSON Schema enums. Gemini selects strictly from pre-filtered, allergen-safe merchant catalogs—eliminating financial and menu hallucination. - Payment Escrow Engine: PayPal Orders v2 API (
intent: "AUTHORIZE") + Vault v3 multiparty payout. Implements a crash-safe 3-phase settlement state machine (CAPTURING$\to$ PayPal/capture$\to$CAPTURED) withPayPal-Request-Ididempotency. - Proximity Verification: Server-side Haversine geodesic calculation:
$$d = 2 R \arcsin \left( \sqrt{\sin^2\left(\frac{\Delta \phi}{2}\right) + \cos(\phi_1)\cos(\phi_2)\sin^2\left(\frac{\Delta \lambda}{2}\right)} \right)$$
Enforcing a 2-stage geofence:
< 250mfires kitchen prep;< 50mtriggers settlement and bay unlock. - Merchant Operations KDS: AG Grid React v33 (
ClientSideRowModelModule,TextFilterModule,NumberFilterModule) providing gloved-operator actions (Accept & Fire,Ready -> Station,+5m Delay,86 Item) with live Server-Sent Events (SSE) telemetry. - Dual-Track Persistence:
- Track 1 (Local Zero-Docker):
InMemoryKitchenRepositoryfor instantaneous offline development and CI. - Track 2 (Production Parity):
PrismaKitchenRepositoryon PostgreSQL with row-level station leasing (FOR UPDATE SKIP LOCKED) and partial unique indexing (idx_station_one_active_order).
- Track 1 (Local Zero-Docker):
📈 Unit Economics
On an average $\$15.00$ lunch ticket, BitePass delivers superior economics for both diners and merchants compared to 30% delivery app commissions:
$$\text{Gross Margin} = \frac{\text{Platform Take-Rate } (\$1.50) - \text{Processing } (\$0.44)}{\text{Platform Take-Rate } (\$1.50)} \approx 70.6\%$$
- Consumer: $\$0.00$ delivery fee, real counter prices, $25\text{ minutes}$ saved per day.
- Merchant: Retains $90\%$ of ticket revenue ($\$13.50$ vs $\$10.50$ on DoorDash).
- BitePass: $10\%$ flat transparent take-rate ($\$1.50$).
🧗 Challenges We Ran Into
- Zero Financial Hallucination in LLMs: LLMs frequently produce creative arithmetic when calculating sales tax, tips, and item totals. We solved this by stripping all pricing authority from the model: Gemini selects candidate item IDs, while all financial computation is strictly executed in TypeScript integer cents via pure basis-point arithmetic ($b \times 100$).
- Two-Stage Physical-to-Financial State Synchronization: Coordinating physical walking distance with financial states (Grace Hold $\to$ Kitchen Fired $\to$ Doorstep Capture $\to$ Settled) requires fail-closed state transitions. We engineered a formalized Finite State Machine (FSM) backed by cryptographic PayPal webhook signatures and RFC 9457 Problem Details.
- Real-Time KDS Telemetry Without Polling: High-velocity commercial kitchens cannot tolerate page refreshes or stale data. We built scoped Server-Sent Events (SSE) channels with 15-second heartbeats and visibility-aware snapshot healing.
🏆 Accomplishments That We're Proud Of
- 47/47 Automated Tests Passing: Complete Vitest unit tests, integration API route tests, and Playwright end-to-end slow-mo suites.
- 0-Warning TypeScript 5.7 & ESLint Parity: Zero
anyescapes across the entire codebase. - Sub-50ms KDS Updates: Instantaneous AG Grid cell transitions when a diner crosses the doorstep threshold.
- 2-Tap Dispute & Cubby Quarantine: Built-in diner dispute mechanism that triggers an instant PayPal refund and quarantines defective pickup bays in one tap.
🧠 What We Learned
- Agentic commerce must be anchored in trust: Consumers hesitate to let autonomous agents spend money on their behalf. Using PayPal's 2-phase authorization as an escrow hold—where $\$0$ leaves their balance until physical arrival—transformed user confidence and eliminated ordering friction.
- The physical-digital handoff is the real frontier: Software is easy; coordinating walking speeds, kitchen oven throughput, and physical pickup cubby availability is where true micro-commerce value is unlocked.
🚀 What's Next for BitePass
- BLE Beacon & NFC Tap Integration: Integrating Bluetooth Low Energy beacons directly on smart cubby doors for millisecond-level proximity handshake.
- Multi-Calendar Sync: Deep integrations with Google Workspace and Microsoft 365 to auto-negotiate lunch windows around shifting meeting schedules.
- Pilot Campus Rollout: Deploying BitePass across 5 commercial office towers in downtown business districts.
Built With
- ag-grid
- ai-agent
- docker
- ecommerce
- fintech
- foodtech
- google-gemini
- gps
- microservices
- next.js
- node.js
- openapi
- paypal
- playwright
- postgresql
- prisma
- react
- rest-api
- server-sent-events
- tailwindcss
- typescript
- vitest
- webhooks
- zod