Skip to content

Engineering & Architecture

How I build production systems

Practical architecture notes, code patterns, and lessons from shipping real web platforms, iOS & Android apps, and AI agents for clients in Australia, the US, and Pakistan.

01System Architecture8 min read

How to Build an Offline-First Cryptographic QR Ticket Validator with Ed25519, Hash Chaining & Fastify

When I was brought on as Lead Engineer for NodusTickets, the core requirement was deceptively simple: verify event tickets at high-volume entry gates where internet connectivity drops to zero, while making it mathematically impossible to forge a QR code or tamper with local scan logs.

TypeScriptFastifyEd25519Offline-FirstPostgreSQLCryptography
Read full guide

Key takeaways

  • Venue Wi-Fi and cellular networks fail under crowd load; relying on a live database lookup at the turnstile causes entry bottlenecks or forces staff to wave unverified screenshots through.
  • Using asymmetric Ed25519 signatures lets every scanner device verify ticket authenticity in under 2ms completely offline using only a bundled 32-byte public key — without exposing any signing secret on the device.
02Full-Stack & Mobile9 min read

Architecting Real-Time Fleet & Driver GPS Tracking with React Native, WebSockets & Supabase RLS

For nearly two years, I served as the sole engineer for Direct Transport Solutions in Australia, designing and shipping their core logistics ecosystem: an internal Admin Dispatch Portal, a Customer Portal, and an iOS/Android Driver App in React Native. Here is how the real-time GPS tracking and multi-tenant security architecture works in production.

React NativeExpoWebSocketsSupabasePostgreSQLNext.js
Read full guide

Key takeaways

  • Built and maintained the complete logistics platform for Direct Transport Solutions (Australia) as the sole engineer: Admin Portal, Customer Portal, and React Native Driver App.
  • Separating ephemeral live telemetry (WebSockets / Realtime broadcast) from durable route history (batched PostgreSQL writes) cuts database write load by over 85% while keeping map markers smooth.
03AI & Automation8 min read

Building Production AI Voice & RAG Intake Agents with Vapi, Retell, pgvector & n8n

Over the past two years I've built production AI systems for healthcare providers, real estate agencies, and service businesses — including Ellie, a 24/7 intake assistant for Achievement Behavior Services (ABS) in the US, and Riley, an AI voice scheduling agent. Here is what separates a fragile prompt demo from a production agent that books real appointments and syncs cleanly to a company's CRM.

OpenAIClaudepgvectorRAGVapiRetelln8n
Read full guide

Key takeaways

  • Static 20-field intake forms lose high-intent families and buyers after business hours; conversational AI agents capture and qualify leads 24/7 while writing structured records straight to the CRM.
  • For voice agents (built with Vapi or Retell), keeping total turn-around latency under 700ms requires streaming STT/TTS and decoupling heavy CRM/calendar webhooks into async tool calls.

02 — What's next

Got an idea?
Let's ship it.

Tell me what you're building. No sales team, no hand-offs — just the engineer who'll build it.

Rafay KhanRafay KhanYou'll talk to me directly
—in Lahore · UTC+5
Replies in a few hoursUsually around now