Building the real-time operational backbone for a global tea brand's US launch

CHAGEE is one of the world's fastest-growing tea beverage brands, with over 6,000 stores across Asia. When they decided to enter the US market, they needed a technology partner who could stand up an entire US tech stack — POS integration, custom label printing hardware, real-time order displays, and financial reporting — in roughly 90 days with a non-negotiable opening date. Happy Cog delivered on schedule.

Services

Development

Industry

Food

Launching a US tech stack from scratch in 90 days

CHAGEE serves thousands of drinks per day per location — a high-velocity operation where a mislabeled cup or a stalled order screen isn't a UX inconvenience, it's a line out the door. Their first US store at Westfield Mall in Los Angeles had a fixed opening date, and the tech had to be ready.

The challenge was that none of CHAGEE's systems talked to each other natively. The systems included a proprietary ordering platform with its own internal API, Square for point-of-sale and catalog management, automated tea machines that read QR codes to configure each drink, thermal label printers for drink preparation, customer-facing pickup screens, and Restaurant365 for accounting. Happy Cog needed to build a central integration layer that merges data from both CHAGEE's internal API and Square, keeping all of these systems in sync reliably, in real time, and with minimal manual intervention.

Adding to the complexity, CHAGEE operates between Los Angeles and Shanghai HQ. Their internal tooling runs on Lark, a Chinese enterprise platform. Their primary contact reported directly to the CEO — meaning delays or ambiguity had a short path to leadership.

A real-time event pipeline at the core

The heart of the platform is a real-time event pipeline powered by Firebase Realtime Database. When an order is placed or updated in Square, a webhook hits the API, where order data is transformed — resolving line items, modifiers, fulfillment status, and nutritional information — and synced to Firebase. From there, two things happen simultaneously:

Pickup screens at each location subscribe to Firebase and display live order status updates to customers as drinks move from queued - to in progress - to ready. No polling, no delays — changes appear instantly. The screens feature a custom UI with smooth transitions and animations designed to match CHAGEE's branding.

Thermal label printing is triggered through the same pipeline. Each line item generates a print job in a Firebase-backed queue. A custom iPad kiosk application — built with Expo and React Native in TypeScript — monitors the queue and drives the printing workflow on-site. The app is designed for unattended, always-on operation: it locks to landscape orientation, keeps the screen awake, and presents a minimal status UI showing the current location, connection state, and print activity.

Labels include dynamically calculated nutrition facts and a generated QR code — both computed at order time based on the specific drink configuration. The QR codes encode machine-readable instructions that CHAGEE's automated tea machines scan to configure drink preparation parameters without manual input from baristas.

Dynamic nutrition and QR code generation

Every label requires precise, order-specific data. The system starts with base nutritional values — calories, caffeine, protein, and sodium — defined per item variation, then additively applies modifier-specific adjustments. Choosing oat milk or extra sugar, as examples, modifies the base values in real time. When an order comes in, the platform resolves selected modifiers against the item's nutrition matrix, sums the values, and includes the final computed data for label rendering.

QR codes are generated dynamically per line item, encoding the order ID, the item's machine code, and machine codes for each selected modifier — organized by segment (size, ice level, sugar level, and alternative milk) — into a pipe-delimited string. Labels are rendered server-side by converting HTML templates to images via Browsershot, then translating those images to ESC/POS thermal printer commands. Print jobs are sent directly to the printer over a raw TCP socket.

The integration architecture

The API acts as a hub merging data from two primary sources:

Square POS provides real-time order and payment data via webhooks, along with catalog and location information through its REST API. Square's catalog data is surfaced as in-memory Eloquent models, giving the admin panel and label rendering system instant access to item names, modifiers, and pricing without duplicating Square's data into a separate database.

CHAGEE's internal API provides complementary data — detailed order information including items, specs, discounts, payments, and refunds — that isn't available through Square alone. The platform ingests this data through an automated daily pipeline into a dedicated database, merging it with Square data to build a complete picture of each store's operations. This combined data is transformed into nine distinct CSV export formats and delivered to Restaurant365 via FTP for accounting and reporting. An automated monitoring system verifies that all expected files arrive and alerts the team if anything is missing.

The platform uses a dual-database architecture: one for application concerns (users, printers, print logs, OAuth, settings) and another dedicated to CHAGEE's order and financial data — keeping each system's data independently manageable.

Fully serverless, built to scale

The entire platform runs serverlessly on AWS Lambda via Laravel Vapor, scaling automatically with store traffic. Even label rendering — which requires a headless browser — runs on Lambda through Sidecar, keeping the architecture fully serverless end to end.

The iPad kiosk app is built and distributed through Expo Application Services, with separate build profiles for development, preview, and production. Updates are pushed over the air via expo-updates, allowing the team to ship fixes and configuration changes to every store's device without App Store review or manual intervention at the location.

A Filament-powered admin panel gives the CHAGEE team visibility and control over the system: managing store locations, monitoring printer status, assigning machine codes to catalog items, and editing per-item nutrition data — all inline, with a hierarchical structure that supports precise calculations for any combination of size, sweetness, and milk choice.

What it takes to launch in 90 days

Getting a brand-new US technology stack live before opening day isn't primarily a development challenge — it's a coordination challenge.

Happy Cog's approach was straightforward: track everything, flag problems early, and keep the client focused on decisions rather than status updates. On a project spanning a Square POS integration, custom label hardware, a real-time pickup screen, financial data pipelines, and a BI dashboard, the variables that threaten a launch date are rarely code — they're a printer that ships to the wrong address, a spec that gets interpreted two ways, a dependency no one thought to track. CHAGEE's team knew at any given point what was done, what was in progress, what was at risk, and what they needed to weigh in on. That transparency is what made March 2025 possible.