Skip to content
Our Work

CASE STUDY

Kanafani Sweets & Coffee

Complete digital infrastructure — a Turborepo monorepo powering three applications, a native Android POS, and 10 shared packages. 530,000+ lines of code.

530K+ LOC155+ API endpoints58+ DB tables3 platforms

Kanafani Sweets & Coffee is a food and beverage business with multiple locations in the Greater Toronto Area. As Chief Information Officer, we designed and built their complete digital infrastructure — from internal business operations and payroll to customer-facing online ordering, a custom loyalty program, and a native Android point-of-sale system.

The platform is a Turborepo monorepo housing three applications and ten shared packages. The admin dashboard manages every operational domain — orders, menu, deliveries, HR, payroll, GPS tracking, reviews, notifications, and KDS routing. The customer website handles online ordering, rewards, catering, and multi-location support. The native Android POS runs five operating modes on in-store tablets. All three applications share a unified data layer, authentication system, and business logic — one coherent system, not three disconnected tools.

The platform at a glance

Business Hub

Internal operations dashboard

  • 200,000+ LOC
  • 131 pages
  • 80 API routes
  • 12 cron jobs

Customer Platform

Online ordering & loyalty

  • 97,000+ LOC
  • 58 pages
  • 75 API routes
  • Zustand state

Android POS

In-store point-of-sale

  • 104,000+ LOC
  • Kotlin + Compose
  • 5 operating modes
  • Room DB

530,000+ total lines of code · 155+ API endpoints · 58+ database tables · 10 shared packages

thEdiGitAI bot

|

Business Hub — Operations Dashboard

kbh.kanafani.ca · Next.js 16, React 19, TypeScript, Supabase, Turborepo

Order Management & KDS

Multi-channel order ingestion from web, POS, and kiosk. Kitchen Display System with station-based routing — orders split by preparation type and flow to the correct station. Real-time status updates via Supabase subscriptions.

Menu Architecture

Hierarchical menu system: menus → groups → items → variations → modifiers. Two-way catalog sync with Square running every 5 minutes. Location-specific pricing with percentage adjustments. Drag-and-drop ordering.

Full Canadian Payroll

Complete payroll system with pay period management, paystub generation, and tax compliance. T4 and T4A portal with OTP-verified SIN collection (AES-encrypted at rest). Provincial tax calculation and PDF export.

GPS Tracking & Delivery

Live vehicle tracking with Leaflet maps. Geofence configuration with alert rules. Trip history with snap-to-roads. Delivery management with Uber Direct integration — automated quoting, dispatch, and status tracking.

Review Intelligence

Google Reviews aggregation with AI-powered sentiment analysis. Automated review digest emails. Response suggestions. Google Business Profile integration for hours, locations, and performance metrics.

Multi-Channel Notifications

Unified notification system across email (Resend with 40+ React Email templates), SMS (Twilio), push, and in-app channels. Template management with variable interpolation. Delivery analytics and history tracking.

Customer Platform — kanafani.ca

kanafani.ca · Next.js 16, React 19, Zustand, Square Web Payments

Online Ordering System

Full ordering flow with menu browsing, item customization (variations, modifiers), cart management with Zustand, and multi-location support. Pickup and delivery with real-time address validation via Google Maps.

Custom Loyalty Program

Points-based rewards with tiered membership, streak tracking, and campaigns. QR code check-in at in-store kiosk. Referral program with automated SMS/email invitations. Reward catalog with real-time redemption.

Payment Processing

Square Web Payments SDK with credit/debit card tokenization, Apple Pay, and Google Pay. Tip selection, discount codes, and tax calculation. Idempotency keys prevent duplicate charges.

Catering Platform

Dedicated catering page with package browsing, custom order requests, and quote management. Gallery showcase with testimonial integration. Admin-side catering order tracking and fulfillment.

In-Store Kiosk Mode

Tablet-optimized rewards kiosk for in-store check-in. Phone number lookup, QR scan, loyalty point display, and reward redemption — all through a dedicated internal API surface with heartbeat monitoring.

Real-Time Order Tracking

Post-checkout order status page with live updates via Supabase real-time subscriptions. SMS and email notifications at each stage. Delivery tracking integration with estimated arrival.

Native Android POS

Kotlin 2.1 · Sunmi Hardware · Jetpack Compose, Hilt, Room, Ktor, Square Mobile Payments SDK

Five Operating Modes

Single APK supports Staff POS (full ordering), Customer Display (WebSocket-paired tablet), Self-Serve Kiosk (card-only), Kitchen Display System, and Manager Mode. Device provisioning via QR code from admin dashboard.

Offline-First Architecture

Room database for local menu cache, order queue, and offline resilience. Connectivity manager detects network state. Offline queue with automatic sync when connection restores.

Square Mobile Payments

Square Mobile Payments SDK for tap, chip, and swipe. Cash drawer management with open/close tracking. Receipt printing via ESC/POS protocol to Sunmi thermal printers.

Clean Architecture

Multi-module Gradle project: core (data, domain, ui) and feature modules (pos, kds, kiosk, customerdisplay). Hilt dependency injection. Kotlinx Serialization. Coroutines for async operations throughout.

Real-Time KDS Sync

Supabase real-time subscriptions for live order updates on kitchen displays. Station-based filtering — each KDS screen shows only its relevant items. Status updates propagate instantly across all connected devices.

Customer Display Pairing

WebSocket server on the POS tablet broadcasts order state to a paired customer-facing display. Shows line items, running total, tip selection, and payment confirmation in real time.

How everything connects

Online orders, in-store POS, and kiosk transactions all converge into a single operational pipeline — shared data, shared logic, shared packages.

01

Customer places an order — online at kanafani.ca, at the POS counter, or through the self-serve kiosk.

02

Payment processes through Square (Web Payments SDK or Mobile Payments SDK). The order writes to Supabase and syncs with Square’s system.

03

The order appears in the admin dashboard and routes to the correct KDS station based on item category and preparation type.

04

Kitchen staff track preparation on the KDS display. Status updates flow in real time to the customer’s order tracking page and the POS terminal.

05

For delivery orders, Uber Direct dispatches a driver with GPS tracking visible in the admin dashboard. Pickup orders trigger customer notifications.

06

Loyalty points accrue automatically. The customer’s reward balance, tier progress, and streak update across web, kiosk, and admin — powered by the shared business-logic package.

Technical foundation

Architecture

Turborepo monorepo with pnpm workspaces — 3 applications and 10 shared packages

Authentication

Supabase Auth with JWT, MFA support, role-based access (admin/manager/staff), middleware route protection

Payments

Square Web Payments SDK (web) + Square Mobile Payments SDK (Android) with idempotency and webhook reconciliation

Database

PostgreSQL via Supabase — 58+ tables, 228 migrations, Row Level Security on every table

Real-Time

Supabase subscriptions for order status, KDS updates, and admin dashboards. WebSocket for POS ↔ customer display pairing

Delivery

Uber Direct integration with automated quoting, dispatch, and status tracking. GPS tracking with Leaflet maps and geofencing

Notifications

Resend (40+ email templates), Twilio (SMS), push, and in-app — unified delivery layer in @repo/notifications

Native Mobile

Kotlin 2.1, Jetpack Compose Material 3, Room DB, Hilt DI, Ktor networking, multi-module Gradle architecture

Catalog Sync

Two-way Square ↔ Kanafani sync running every 5 minutes with version tracking and conflict detection

Payroll

Canadian tax compliance — T4/T4A generation, AES-256 encrypted SIN storage, provincial tax calculation, PDF export

Automation

12 Vercel cron jobs: catalog sync, order reconciliation, review analysis, loyalty processing, GBP monitoring

Monitoring

Sentry across client/server/edge in both web apps. Inngest for background job orchestration. Lighthouse CI for performance

Technology stack

Next.js 16React 19TypeScriptKotlin 2.1Jetpack ComposePostgreSQLSupabaseSquare SDKUber DirectTurborepopnpmTailwind CSSshadcn/uiRadix UIZustandZodResendTwilioSentryHiltRoomKtorInngestReact EmailFramer MotionRechartsLeafletGoogle Maps API

From v1 to full platform in fifteen months

October 2024First Kanafani platform (v1) launched
November 2025KBH monorepo — admin hub, customer web, and shared packages deployed
January 2026Native Android POS with 5 operating modes live in-store

Let's talk about what you need

A 30-minute conversation. No pitch, no pressure. We listen, understand, and tell you honestly what we can build.

Book a call

Pick a time that works for you. 30 minutes, no pitch, no pressure.

Book a Consultation

or email hello@thedigitai.com

We respond within 24 hours.

Send a message