All work

TWLM - POS

Restaurant POS, loyalty, wallet passes and AI menu search for Gulf retail — a B2B2C platform I designed and built from architecture to production.

Role
Senior Software Engineer · Full Stack
Company
TWLM
Timeline
Feb 2025 – Present
Status
Live
Stack
NestJS · Node · React · PostgreSQL
Live product
TWLM - POS — screenshot 1 of 6

~70%

fewer support requests

~64%

lower API latency

30+

CMS features shipped

API response timeRelative to before (100%)
Before100%
After36%

Problem

  • Businesses needed one B2B2C platform for POS and CMS: Gulf tax integrations, inventory, loyalty, gift cards, customizable e-menu storefronts and 30+ CMS features.
  • Loyalty cards, gift cards and promotions had to live in customers' Apple Wallet and Google Wallet and stay up to date in real time.

My role

  • Senior Software Engineer (full stack): designed and built the restaurant POS platform with integrated loyalty, promotions and wallet features, from architecture through production delivery.
  • Designed and developed the loyalty features: a loyalty points system, loyalty cards, and a gift card system with Apple Wallet and Google Wallet integration and real-time notification support.
  • Built a centralized promotional messaging system with Apple Wallet loyalty passes, smart geo-location targeting, and branch-based tracking and visibility.
  • Developed a dynamic, block-based page builder and a Flutter mobile app, so businesses create their own menus and storefront pages without developer help and customers can place orders online.
  • Spearheaded the OpenRouter AI (DeepSeek) integration for smart menu search and AI-based analysis of restaurant data.
  • Improved the overall UI/UX, making features more intuitive and user-friendly.

Architecture & key decisions

  • API: NestJS on Fastify, serving REST APIs to the React web apps, the storefronts and the Flutter mobile app.
  • Data: Prisma ORM on PostgreSQL, with schema migrations and query optimization for faster data access.
  • Background work: webhook-driven, event-based workflows; Redis-backed BullMQ workers process notification and wallet-update jobs asynchronously.
  • Access: RBAC with OAuth2/JWT authentication and SSO for multi-role access across the platform.
  • Integrations: Apple Wallet and Google Wallet passes, Gulf payment gateways (MyFatoorah, Moyasar), and CRM and leasing platforms to keep customer and business data in sync.
  • Frontend: React with Zustand and TanStack Query.
  • AI: OpenRouter (DeepSeek) for smart menu search and AI-based analysis of restaurant data.
system-architecture.tslive

A simplified view of the retail platforms I architect: POS, loyalty and wallets on a typed NestJS API, with Redis-backed workers and PostgreSQL underneath.

Tap a node to trace its connections

How it's builtA request, from the visitor's screen to the data
  1. Visitors

    Desktop & mobile

  2. App

    ReactFlutter
  3. UI & state

    ZustandTanStack Query
  4. API & server

    NestJSFastifyNodeREST APIs
  5. Data

    PrismaPostgreSQL
  6. External services

    Apple WalletGoogle WalletOpenRouter
Wallet pass update flow (simplified)1. webhook event 2. add job 3. run job 4. update pass 5. push 6. pass refreshesWebhook sourceNestJS APIBullMQ · RedisWorkerApple / GoogleCustomer phone1webhook event2add job3run job4update pass5push6pass refreshes

Wallet pass update flow (simplified)

  1. A webhook event reaches the NestJS API.
  2. The API adds a wallet-update job to a Redis-backed BullMQ queue.
  3. A BullMQ worker picks up the job asynchronously.
  4. The worker updates the Apple Wallet or Google Wallet pass.
  5. Apple or Google sends a push to the customer’s phone.
  6. The pass on the phone refreshes with the new data.
Background jobs with BullMQIllustrative

Notification and wallet-update jobs run in Redis-backed BullMQ workers, outside the request path. A failed job is retried instead of being lost.

TWLM loyalty passes in Apple & Google Wallet

Real stamp passes from the platform, as customers see them on their phones — the same pass issued to Apple Wallet and Google Wallet, kept up to date by webhooks and BullMQ jobs. Flip to compare.

Challenges

  • Stability after rapid development: refactored a large portion of the codebase to improve structure and maintainability, eliminate side effects caused by rapid development, and make the application more stable.
  • API performance: optimized the backend APIs, reducing latency by ~64%.
  • Real-time wallet passes and notifications: triggered by webhook flows and processed asynchronously as jobs by Redis-backed BullMQ workers.
  • Support load: reworked core user flows based on support data.

Results

  • ~70% fewer customer support requests after reworking core flows and the overall UI/UX.
  • ~64% lower API latency and better overall system performance.
  • 30+ CMS features shipped on one B2B2C platform.
  • Four loyalty features — points, loyalty passes, gift cards and discount coupons — with Apple Wallet and Google Wallet passes and real-time updates.
  • A more maintainable and stable codebase.

Stack

Used for: The TWLM API layer, on FastifyUsed in: TWLM - POSUsed for: Backends and REST APIsUsed in: TWLM - POS, Scmborba, Design DynamoUsed for: TWLM web apps and dashboardsUsed in: TWLM - POS, Design Dynamo, Portfolio WebsiteUsed for: TWLM's main database, via PrismaUsed in: TWLM - POS, Design Dynamo, EIMSUsed for: Smart menu search at TWLM and this site's BotFolioUsed in: TWLM - POSUsed for: Data layer and schema migrations at TWLMUsed in: TWLM - POSUsed for: HTTP server under NestJS at TWLMUsed in: TWLM - POSUsed in: TWLM - POSUsed for: Loyalty passes and gift cards at TWLMUsed in: TWLM - POSUsed for: Loyalty passes and gift cards at TWLMUsed in: TWLM - POSUsed for: TWLM mobile app for storefronts and online orderingUsed in: TWLM - POSUsed in: TWLM - POSUsed in: TWLM - POS