// architecture reference

Architecture Reference

Responsive SVG system diagrams behind each case study — hand-coded vectors, no screenshots

// system architecture · 01

WhatsApp Greeter System

Enterprise Client · asia-southeast1 · Cloud Run + Firestore

Read the full case study ↗
Flow diagram: a SleekFlow Flow posts incoming WhatsApp messages to a Cloud Run greeter function, which reads and writes per-contact greeting state in Firestore and returns greeted true or false so the flow decides whether to send a greeting. A separate monthly path has Cloud Scheduler trigger a cleanup function that purges contacts older than 30 days for PDPA compliance.
Open full size ↗
// key design decisions
Date-based state (no reset job) Store greeted_{waba}: "YYYY-MM-DD" per contact. No daily reset needed — date comparison handles deduplication automatically.
Independent WABA tracking Each contact × WABA pair is tracked separately. Messaging WABA A doesn't affect WABA B greeting state.
Firestore named database Isolated from other projects in the same GCP account. Schema-free — adding new WABAs requires zero migration.
Monthly PDPA cleanup Contacts inactive for 30+ days are purged. Keeps storage lean and compliant with data minimisation principles.
// infrastructure blueprint · 02

AWS Cloud Resume Architecture

DevSecOps pipeline · S3 + CloudFront + Lambda + DynamoDB · ap-southeast-2

See it on the portfolio ↗
Flow diagram: a developer pushes to GitHub, GitHub Actions runs Snyk scans and Selenium tests then syncs to S3. Inside the AWS cloud, S3 serves content through CloudFront and Route 53 to the user, while a Lambda function URL backed by DynamoDB serves the visitor counter. CloudWatch and AWS Budgets provide observability and cost governance.
Open full size ↗
// key design decisions
S3 blocks all public access Content served exclusively via CloudFront with OAC. Eliminates direct bucket exposure — no public S3 URL is possible.
Lambda Function URL (no API Gateway) Reduces cost and latency for a single-function visitor counter. No API Gateway overhead needed at this scale.
DevSecOps pipeline as the gate Every commit triggers Snyk SCA/SAST and Selenium smoke tests. Deployment only proceeds on full pass.
Cost governance built-in AWS Budgets sends proactive alerts before thresholds are breached — keeping this workload predictably lean.
// case study architecture · 03

GenAI Lead Qualification + Human Handoff

Education · GenAI Agent · Rubric-based scoring · Human in the loop

Read the full case study ↗
Flow diagram: a user chats with a GenAI lead qualification agent that scores intent with a rubric. Qualified leads go through a consent-capturing pre-handoff, then a webhook integration layer validates with allowlisted IPs and idempotency checks, creates records, and notifies a human agent. Non-qualified visitors stay in a self-serve concierge; low-confidence cases queue for human review which feeds back into the rubric.
Open full size ↗
// key design decisions
Rubric-based scoring (not black-box AI) Lead score + confidence signal + rules engine. Qualification decisions are auditable and reduce LLM misclassification risk.
Confidence-gated human review Low-confidence cases queue for sales ops review. Review outcomes feed back into rubric refinement, improving accuracy over time.
Consent-first handoff Agent captures consent and packages a summarised conversation + intent before escalating — improving consultant efficiency and user trust.
Idempotent integration Webhook validated via IP allowlist and idempotency check on session ID + phone number. Retry-safe by design.
// case study architecture · 04

Event-Driven POS Integration

F&B · Serverless · Event-driven · Real-time order lifecycle notifications

Read the full case study ↗
Flow diagram: a customer places an order at a kiosk or POS, which sends webhook events to an integration layer that validates HMAC signatures, enforces idempotency, classifies the order event type, transforms data, creates customer and order records, and sends order received and order ready notifications asynchronously. Invalid payloads return 4xx with no retry; transient failures return 5xx and the POS retries with backoff. An SMS fallback covers degraded scenarios.
Open full size ↗
// key design decisions
Retry-safe webhook ingestion 4xx for invalid payloads (no retry). 5xx for transient failures (retry with backoff). Idempotency key on primary order ID prevents double-processing.
Explicit order event semantics Order type (received/ready) classified at validation. One pipeline handles both — simplifying extension to future order states.
Async notifications as side effects Notifications don't block the ingestion response to POS. Messaging failures can't cascade into order processing failures.
SMS fallback for degraded scenarios KDS → SMS path ensures customer communication continues during provider outages. Clear operational fallback path.
// case study architecture · 05

Booking Reconciliation

Pre-sales · Hospitality · Booking engine · Reconciliation

Read the full case study ↗
Flow diagram: a booking intent is written to a ledger as pending before create. On timeout, a read-only lookup lists and verifies bookings by guest details before a single retry. A match is adopted as reconciled; an ambiguous result goes to manual review.
Open full size ↗
// key design decisions
Ledger before retry The intent and exact payload are written as PENDING before the first create. Every retry reuses the same UUID, so ambiguity is always traceable.
Read-only reconcile A timeout triggers list and detail lookups matched on guest, dates and amount before any retry — the API has no idempotency key to lean on.
One retry, then a human A two-minute quiet period, one retry maximum, then MANUAL_REVIEW with “do not honour until confirmed”.
Payment stays in the engine No card data reaches the platform; amounts come from the confirm preview, not the conversation.
// case study architecture · 06

Salesforce Conversation Card

Demo · CRM · Lightning Web Component · Security boundary

Read the full case study ↗
Flow diagram: a Lightning Web Component on a Salesforce record page calls an Apex controller that holds the platform API key and calls the messaging API. The browser never holds the key. Phone normalisation and lifecycle alignment keep the record in sync.
Open full size ↗
// key design decisions
Apex holds the key The browser never calls the API. The key lives in a protected custom setting and the callout runs server-side.
Phone is the join key A before-save flow copies MobilePhone into Phone and the card sends digits only — one canonical field between two systems.
Paginate, don’t poll A bounded page of recent messages; no background polling and no callout loop.
Tests gate the deploy Callouts are mocked with HttpCalloutMock; 9 of 9 tests pass and run on deploy.
// case study architecture · 07

Dual-Tier Loyalty Ledger

Demo · Domain · Loyalty · Consistency

Read the full case study ↗
Flow diagram: a request carrying an idempotency key reaches a ledger gate. A known key replays the stored result; a new key applies the delta once to the campaign or evergreen balance and writes the ledger.
Open full size ↗
// key design decisions
Ledger outranks balance Balances are a projection. The ledger records the key, delta and resulting balances for every operation.
Idempotency is required Every mutation carries a key; a replay returns the stored result with idempotent_replay: true and does not re-apply.
Two buckets, no cross-spend Campaign and evergreen points have separate balances and separate catalogues.
Schema drift at runtime Option ids and field names differ between workspaces; resolve them at runtime instead of hard-coding.
// case study architecture · 08

One Pipeline, Two Doors

Pre-sales · Integration · Cloudflare Workers · R2 + Queues + D1 · sftpgo

Read the full case study ↗
Flow diagram: a browser upload over HTTPS and a partner SFTP client both land in one object-store prefix. A queue drives a single ingest worker that discovers the live contact fields, parses and validates the whole file before writing, upserts in batches of 50 and commits progress every 100 rows. Status, a per-row error file and failure notifications are written afterwards.
Open full size ↗
// key design decisions
Transport is a door, not a product Browser upload and partner SFTP converge on one prefix. The parser never learns which door a file used, so validation, mapping and reporting exist once.
Discover the schema before mapping There is no schema endpoint and users create fields, so discovery reads the live set — and counts fields with zero values as real.
Validate, then write The row cap and header check run against the whole file before the first contact is created. A rejected file writes nothing.
Batch, isolate, resume Calls carry 50 rows; a rejected batch is replayed row by row; progress commits every 100 rows so a crash resumes instead of restarting.