Case Study · Loyalty Platform

StampEzee

Digital loyalty platform for cafés, salons, restaurants and retail chains

StampEzee replaces paper stamp cards with branded digital stamp cards, points programs, automated campaigns and gamification. Retailers run everything from a web dashboard, staff stamp at the counter, and customers collect and redeem through the StampEzee Rewards app on iOS and Android.

Backend Team Lead2025 — PresentiOS · Android · Web Dashboard
Users
Retailers · Staff · Customers
Services
4 deployables, 1 monorepo
Channels
Push · WhatsApp · SMS · Email
Billing
Stripe subscriptions, plan-gated

The problem

Small businesses lose repeat customers to paper cards that get forgotten, lost or faked. StampEzee gives them the loyalty tooling large chains have — branded cards, campaigns, analytics — at a monthly price a single café can afford.

The product serves three audiences with different needs: retailers who design programs and pay for plans, loyalty executives (staff) who stamp and redeem at the counter, and customers who carry every card in one app. The backend has to keep all three consistent in real time, while every feature is gated by the retailer's subscription plan.

My role

  • Lead the backend team: architecture, code review, task planning and production releases.
  • Designed the service split — back-office API, integration gateway, background worker and real-time hub — sharing one NestJS monorepo.
  • Built the points engine, campaign engine and multi-channel notification pipeline.
  • Owned Stripe subscription billing, plan permissions, invoicing and coupon logic.
  • Integrated Apple Wallet and Google Wallet passes that stay in sync with live stamp progress.
  • Ran a full production-readiness audit and shipped the resulting fixes across security, data integrity and reliability.

What the product does

Stamp cards & completion paths

Retailers design branded cards with main, tiered and sign-up rewards. Lightning bonus cards, scratch rewards and exclusive rewards keep customers engaged past one cycle. Edits to live cards go through an admin-reviewed request flow.

EzeePoints

Spend-based points with fixed or tiered earning, join bonuses, caps and cooldowns. Every change is written to a ledger; rolling expiry drains the oldest batch first, and scheduled jobs handle fixed-window and inactivity resets.

EzeeCodes

Single-use or bulk reward codes for menus, receipts, influencers and events. Customers collect stamps or points without staff involvement; redemption rates are tracked per batch.

Campaign engine

Birthday and anniversary clubs, lapsed-customer win-back, refer-and-earn, scratch-and-win, segmented email campaigns and approved push blasts — each with its own scheduler, worker and delivery tracking.

Proximity campaigns

Geofenced offers evaluated on the device, verified on the server with cooldowns, then fanned out as push, WhatsApp or email notifications.

Gamification

XP, levels, badges and leaderboards for customers, driven by real-time activity events.

Wallet passes

Apple Wallet and Google Wallet passes rendered from the card design, updated as stamps land.

POS & e-commerce integrations

An integration gateway with an adapter interface per platform: OAuth connect, HMAC-signed sale webhooks, and staff endpoints to issue stamps, points and OTP-verified redemptions from the till.

Architecture

One NestJS monorepo, four independently deployed services. They share schemas, repositories and infrastructure modules, and talk to each other only through BullMQ queues on Redis.

01

API

Back-office REST surface for admins, retailers, staff and customers. Guards enforce role, branch and subscription-plan permissions at the service layer.

02

Gateway

The surface third-party systems talk to — POS OAuth, sale webhooks, staff phone-OTP auth, stamp and point issuance, redemptions and EzeeCodes.

03

Worker

Headless BullMQ consumer plus cron schedulers: campaigns, multi-channel notifications, invoices, geofence checks, report exports and thumbnails.

04

Stream Hub

Socket.IO gateway with a Redis adapter for horizontal scale. API, Gateway and Worker publish events; the hub pushes them to dashboards and apps.

MongoDBMongooseRedisAWS S3

Engineering highlights

  1. 01

    Plan-gated features

    Every gated capability — card customisation, spend-based stamping, tiered rewards, scratch paths, branch limits — is checked against the retailer's billing permissions on create, update and publish, not just hidden in the UI.

  2. 02

    Transactional side effects

    Stamps, points and rewards are written inside MongoDB transactions. Notifications are published only after the transaction commits, so a rollback never sends a message about a reward that doesn't exist.

  3. 03

    One notification pipeline

    Push, WhatsApp, SMS and email go through a single multi-channel queue with per-channel templates and per-user merging, instead of each feature calling providers directly.

  4. 04

    Provider-agnostic messaging

    SMS, OTP and WhatsApp sit behind a provider switch, so the platform can change vendors per environment without touching feature code.

  5. 05

    Observability

    Structured pino logs, Sentry, Prometheus metrics on every HTTP service and a composite health check covering MongoDB, Redis, disk and heap.

Tech stack

Backend

Node.jsTypeScriptNestJSExpress

Data

MongoDBMongooseRedisAWS S3

Async & Realtime

BullMQSocket.IOCron schedulers

Integrations

StripeTwilioFirebase FCMApple WalletGoogle WalletBrevoOpenAI

Ops

DockerSentryPrometheuspino

Frontend

Next.jsRedux ToolkitTailwind CSS

What I took away

Subscription rules belong in the domain layer. Checking plan permissions in one service kept dozens of features honest as plans changed.
Queues are the seams of a monorepo. Splitting into services was cheap because modules already communicated through jobs, not direct calls.
Loyalty is accounting. A points ledger with batch-level expiry made balance disputes answerable instead of guesswork.