// system architecture · 01
WhatsApp Greeter System
TRIGGER
💬
SleekFlow Flow
Contact sends message
to any WABA number
to any WABA number
POST /handleIncomingMessage
{ waba_number, contact_number }
{ waba_number, contact_number }
CLOUD RUN
⚡
Greeter Function
greeter service
Node.js 22
Node.js 22
Read / Write
greeted_{waba}: date
greeted_{waba}: date
FIRESTORE
🗄️
contacts collection
Named DB · isolated
per contact × WABA
per contact × WABA
▼
SleekFlow continues flow
🔀
Flow Decision
true → send greeting
false → skip
false → skip
Monthly Cleanup Path
SCHEDULER
🕛
Cloud Scheduler
0 0 1 * *
1st of month, midnight SGT
1st of month, midnight SGT
POST /cleanupOldContacts
triggers monthly
triggers monthly
CLOUD RUN
🧹
Cleanup Function
greeter-cleanup
Node.js 22
Node.js 22
Delete docs where all
fields older than 30 days
fields older than 30 days
FIRESTORE
🗄️
contacts collection
Stale contacts purged
PDPA compliance
PDPA compliance
// 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
Continuous Integration
🧑💻
Dev
Local machine
VS Code + Snyk IDE
VS Code + Snyk IDE
git push
VCS
🐙
GitHub
Remote repo
Triggers Actions
Triggers Actions
on: push to main
CI
⚙️
GitHub Actions
① Snyk SCA + SAST
② Selenium smoke tests
③ S3 sync on all pass
② Selenium smoke tests
③ S3 sync on all pass
▼
☁ AWS Cloud · ap-southeast-2
📊
CloudWatch
Lambda metrics
Dashboards + alerts
Dashboards + alerts
💸
AWS Budgets
Cost governance
Proactive alerts
Proactive alerts
Static delivery path
ORIGIN
🪣
Amazon S3
Block all public access
Bucket policy (OAC only)
Bucket policy (OAC only)
🌐
Amazon CloudFront
Origin access control
Global edge caching
Global edge caching
🔗
Amazon Route 53
Custom DNS
jabircode.com
jabircode.com
Serverless compute path
COMPUTE
⚡
AWS Lambda
Function URL (CORS)
Python 3.x · Boto3
Visitor counter handler
Python 3.x · Boto3
Visitor counter handler
read / write
DATASTORE
🗃️
Amazon DynamoDB
Visitor count table
On-demand · atomic incr.
On-demand · atomic incr.
Route53 + CloudFront → browser
Lambda Fn URL → JS fetch
Lambda Fn URL → JS fetch
▶
👤
User
jabircode.com
HTTPS
HTTPS
// 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
↺
Human agent connects with qualified hot lead — completing the feedback loop back to the user
🧑
User
initiates chat
GenAI Lead Qualification Agent
🤖
Live Chat Agent
Rubric-based scoring:
lead score · confidence
score · rules engine
lead score · confidence
score · rules engine
Qualified ✓
✅
Pre-handoff
① Ask for user details
② Summarise conversation
③ Capture consent
② Summarise conversation
③ Capture consent
handoff payload
Integration Layer
🔌
Webhook Ingestion
endpoint
🔒
Validation
① Whitelisted IPs
② Idempotency check
(session ID + phone)
② Idempotency check
(session ID + phone)
📝
Actions
① Create/update record
② Summarised int. note
③ Notify human agent
② Summarised int. note
③ Notify human agent
notify
🧑💼
Human Agent
▼
Not Qualified
🤝
Self-serve Concierge
Non-qualified visitors stay
in self-serve flow
in self-serve flow
▼
Low confidence score
👥
Human Review Queue
① Queue for sales ops
② Give user nearest
probability reference
② Give user nearest
probability reference
▲
Review feeds back to rubric
// 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
👨🍳
Kitchen Staff
Trigger Order Ready
↓ into POS
▼
🧑
User
Place Order
Client System
POS
🖥️
Kiosk / POS
Order entry + routing
Sends webhook events
Sends webhook events
▼
📟
KDS
Kitchen Display System
Order visible to staff
Order visible to staff
▼
degraded path
📱
SMS Fallback
When digital delivery fails
webhook events
Status 400
Integration Layer
🔌
Webhook Ingestion
endpoint
🔒
Validation
① HMAC signature
② Idempotency (primary key)
③ Order type: received/ready
② Idempotency (primary key)
③ Order type: received/ready
▼
async · order ready event
🔔
Order Ready
notification sent async
to customer
to customer
🔄
Data Transform
Normalise to schema
Map to platform model
Map to platform model
👤
Create / Update
Customer record (UUID)
+ Order record
+ Order record
▼
📬
Order Received
notification sent
to customer
to customer
// 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.