Six years of engineering high throughput backend infrastructure, resilient distributed queues, and multitenant architectures. Specialized in the load bearing layers of production software: the webhook that cannot return a 502, the queue that must never drop a paid event, the migration that would take an exclusive table lock at peak traffic, and the static analyzers that keep teams from introducing silent failures.
Founder of The Regret Index (backed by Google Cloud for Startups & MongoDB for Startups). Author of 11 open source packages. 450+ delivered commercial projects.
Originally shipped as a single tenant proposal studio: GrapesJS visual canvas, a ~900 line server renderer, headless Chrome PDF generation via Spatie Browsershot, and cryptographic HMAC sealing. The challenge was converting it into a true multitenant SaaS without compromising security or breaking backward compatibility.
Tenancy is not a database query filter; it is an impenetrable security boundary. Every B2B data leak postmortem reveals the same root cause: someone treated tenant isolation as an optional query scope instead of an architectural invariant that queries cannot escape.
flowchart TD
C["Company<br/><i>tenant · billing entity</i>"]
T["Team<br/><i>grouping inside a company</i>"]
U["User<br/><i>1 company · 0..n teams</i>"]
R1["Owner · Admin · Member"]
R2["team_admin · member"]
C -->|"SECURITY BOUNDARY<br/>never removed"| T
T -->|"VISIBILITY FILTER<br/>layered on top"| U
U -.company role.-> R1
U -.team role.-> R2
classDef sec fill:#132E5C,stroke:#1F6FEB,stroke-width:2px,color:#F0F6FC
classDef vis fill:#2A1B4D,stroke:#8957E5,stroke-width:2px,color:#F0F6FC
classDef ent fill:#161B22,stroke:#30363D,color:#C9D1D9
classDef role fill:#0D1117,stroke:#21262D,color:#8B949E
class C sec
class T vis
class U ent
class R1,R2 role
Important
CompanyScope applies no filter at all when no tenant resolves in context. That sounds counterintuitive, but it is deliberate so that background workers, migrations, and CLI maintenance commands function seamlessly. It is safe for exactly one architectural reason: users.company_id is defined as NOT NULL. An authenticated user session can never resolve to null and view global records. Make that column nullable, and the boundary collapses into a critical vulnerability.
| Invariant | System Failure Prevented |
|---|---|
| Scope narrows, never swaps | Team visibility is built strictly by layering on top of company scope, never by replacing it. Prevents cross tenant leaks. |
| Fails open, deliberately | Console commands and system queues continue running safely while users.company_id remains NOT NULL. |
| Roles are per company | Spatie's team_foreign_key explicitly targets company_id. Pointing it at teams.id causes permissions to bleed across tenants. |
| Authorisation self scopes | User::can() automatically binds to the user's active tenant, preventing silent false denials inside queues. |
| Two distinct locale axes | users.locale controls the sender's dashboard chrome; proposals.locale governs the legal rendered document (25 locales supported). |
Proposals become quasi legal contracts the second a client signs. To guarantee immutability:
- HMAC-SHA256 Document Sealing: Upon acceptance, the rendered HTML, CSS AST, signature bitmap, and client IP/user agent are serialized and cryptographically hashed with
APP_KEY. Any manual database alteration invalidates the seal. - Queued PDF Pre Warming: Headless Chrome rendering is isolated to asynchronous background queues (
SendProposalEmailJob), pre warming the document cache upon status change so public downloads execute in milliseconds without spinning up headless Chrome on the web request thread.
A high scale decision journaling platform that quantifies decision quality, revisits outcomes on an automated schedule, and helps individuals calibrate intuition.
flowchart LR
subgraph INGESTION["Multi Subreddit Ingestion"]
CRON["GCP Cloud Scheduler"] --> RUN["GCP Cloud Run Worker"]
RUN --> REDDIT["75+ Decision Subreddits<br/><i>9 Categories</i>"]
REDDIT --> CHUNK["Semantic Chunker & Sanitizer"]
end
subgraph AI_PIPELINE["Dual Auditor AI Pipeline"]
CHUNK --> V3["Vertex AI Gemini 3<br/><i>gemini-3.8-flash</i>"]
V3 --> FACT["Fact-Checking & Claim Verification"]
FACT --> IMAGEN["Vertex AI Imagen 3"]
end
subgraph STORAGE["Edge & Data Layer"]
IMAGEN --> R2["Cloudflare R2 Storage"]
FACT --> ATLAS["MongoDB Atlas<br/><i>22 Collections</i>"]
USER["Web Client / Next.js 15"] --> UPSTASH["Upstash Redis<br/><i>Sliding Window</i>"]
UPSTASH --> ATLAS
end
classDef c1 fill:#132E5C,stroke:#1F6FEB,stroke-width:1px,color:#F0F6FC
classDef c2 fill:#2A1B4D,stroke:#8957E5,stroke-width:1px,color:#F0F6FC
classDef c3 fill:#161B22,stroke:#30363D,color:#C9D1D9
class INGESTION c1
class AI_PIPELINE c2
class STORAGE c3
- Vertex AI Gemini 3 Migration: Migrated the core reasoning pipeline from retiring Gemini 2.5 to GA Gemini 3 (
gemini-3.8-flashfor high throughput draft synthesis andgemini-3.1-flash-imagefor multimodal context extraction). - Automated Social Signal Ingestion: Orchestrates GCP Cloud Scheduler and Cloud Run endpoints to systematically ingest and index decision outcomes across 75+ specialized subreddits in 9 categories, bypassing Cloudflare bot challenges through direct service networking.
- Async Background Polling: Implemented an asynchronous polling engine with sentence completion safeguards to prevent Cloudflare 524 gateway timeouts on deep analytical drafts up to 8,192 tokens.
- Edge Storage & Caching: Automated image synthesis via Vertex AI Imagen 3 with fallback SVG pipelines, stored in Cloudflare R2 and served through an Upstash Redis sliding window rate limiter.
Meta does not wait for slow downstream queue workers. If an ingestion endpoint takes longer than a few hundred milliseconds, Meta marks the webhook unhealthy and throttles live advertising campaigns. Real work must never execute on the request thread.
sequenceDiagram
autonumber
participant M as Meta Lead Ads
participant W as Webhook Endpoint
participant D as MySQL / InnoDB
participant Q as Redis Queue Worker
participant A as WhatsApp Cloud API
M->>W: POST lead payload
W->>W: verify X-Hub-Signature-256 via hash_equals()
W->>D: INSERT (unique meta_leadgen_id)
Note over D: Replays collide here at schema level,<br/>not in mutable application code
W-->>M: 200 OK (< 50ms)
W->>Q: Dispatch FetchLeadDataJob + SendWhatsAppJob
Q->>A: Send templated WhatsApp message
A--xQ: 5xx Transient Error / Rate Limit
Q->>Q: Time bounded exponential backoff
Q->>A: Retry dispatch
A-->>Q: 200 Delivered & Logged
- Two Independent Integrity Gates: The HMAC SHA-256 signature verification validates payload authenticity. A unique database index on
meta_leadgen_idguarantees that webhook replays are rejected by the MySQL storage engine, where race conditions cannot bypass application logic. - Cronless Queue Draining (
DrainQueueAfterResponse): For environments where system level cron daemons or supervisor instances are restricted, an HTTP terminable middleware triggers background job processing immediately after the fast response is flushed to Meta. - Automatic Graph API Pagination: Built into
PageManagerto transparently fetch high volume ad lead forms with System User token renewal safeguards. - Filament 3 Operational Hub: Admin configurable campaign-to-recipient mappings, round robin lead allocation, and real time session health widgets.
Active packages built to solve structural problems in production and published to Packagist, npm, and GitHub.
|
Cross-boundary static security analyzer and Row Level Security (RLS) auditor for Next.js, TanStack Start, Lovable (Vite), and Supabase apps. Correlates TypeScript AST with SQL migrations to catch critical vulnerabilities before deploy.
|
Zero-bootstrap static AST security analyzer and reliability linter for Laravel queues, Horizon, and background jobs. Prevents database connection exhaustion, money-losing non-idempotent retries, and race conditions before deploy.
|
|
Zero overhead static analysis and AST security scanner for multitenant Laravel SaaS applications. Prevents cross tenant data leaks across database queries, unique validation rules, cache collisions, Filament resources, queued jobs, and route bindings.
|
Catches dangerous, table locking, or destructive database migrations in CI before they reach production. The
|
|
Passive API contract monitoring for strictly typed PHP 8.3+. Silently samples live HTTP payloads via Guzzle middleware, infers deep JSON Schema structures probabilistically, locks a hardened baseline, and alerts when upstream providers introduce breaking schema drift.
|
Unified, driver based Laravel package for multi channel inventory and catalog synchronization across Shopify, WooCommerce, Amazon SP-API, and Etsy.
|
|
Enterprise notification microservice and domain package built for Laravel 12 & PHP 8.4. Provides unified dispatching across 7 channels (Email, SMS, Push, Slack, WhatsApp, Reverb WebSockets, Database).
|
Static analysis for WordPress hooks. Detects orphaned listeners, unheard hooks, and typo ridden actions/filters by analyzing source code AST directly without booting WordPress.
|
|
Decoupled, high performance authentication and registration engine for WooCommerce and WordPress multisite.
|
Static accessibility analyzer for Laravel Blade & Livewire views enforcing 73 WCAG 2.1 AA rules aligned with the European Accessibility Act (EAA).
|
|
Comprehensive concurrency and throughput benchmark comparing modern PHP runtimes (RoadRunner, Swoole, PHP-FPM 8.3) against idiomatic Go under high concurrency.
|
|
Building production systems that connect LLMs, autonomous agents, and real world tools via the Model Context Protocol (MCP).
flowchart LR
AGENT["AI Agent / Claude / Assistant"] -->|"Model Context Protocol<br/>JSON-RPC / SSE"| MCP_HUB{"MCP Server Layer"}
MCP_HUB --> UPWORK["Upwork MCP Agent<br/><i>Job matching, scoring & WhatsApp alerts</i>"]
MCP_HUB --> LINKEDIN["LinkedIn MCP Server<br/><i>Profile, company & job queries</i>"]
MCP_HUB --> WP["WordPress AI MCP<br/><i>Semantic chunking & llms.txt</i>"]
UPWORK --> WA["Meta WhatsApp Cloud API"]
UPWORK --> AI["Vercel AI SDK<br/><i>Proposal synthesis</i>"]
- Job Alert Upwork MCP: Full stack monorepo (
@job-radar/web+@job-radar/jobs) connecting directly to Upwork's official MCP server via@modelcontextprotocol/sdkand OAuth 2.1 Dynamic Client Registration. Evaluates jobs against strict criteria with a 0 to 100 matching engine, triggers automated proposal generation via the Vercel AI SDK, and delivers alerts to WhatsApp in real time. 100% TOS compliant zero scraping architecture. - LinkedIn MCP Server: Open source MCP server giving AI agents direct tool calling access to professional profiles, companies, jobs, and communication channels. Dockerized with
uv, Python, and AWS Bedrock support. - WordPress AI MCP: Exposes any WordPress site to AI search agents over REST with semantic content chunking, FAQ extraction, media indexing,
llms.txt, and full MCP manifests. - Self Hosted vLLM GPU Cloud Infrastructure: Automated AWS EC2 lifecycle tooling managing GPU instances running vLLM inference server for open weights models (e.g., Qwen-Coder 30B), optimizing compute costs with automated elastic IP attachment and instance hibernation.
Long running browser automation and system level telemetry engineered for stability, evasion, and zero leak operations.
- Resilient Session Keepalive Daemon: Stealth browser automation daemon operating under Linux systemd and Xvfb on AWS EC2. Built with Python, Playwright, and asyncio. Features state machine CAPTCHA resolution, Fernet encrypted session cookie storage, humanized jittered mouse/scroll behavioral simulations, and memory managed Chromium lifecycle recycling.
- Consular Service Appointment Monitor: Manifest V3 Chrome extension providing real time visa wait time calculation and tracking directly on diplomatic consular candidate portals with local only DOM parsing and zero external data transmission.
- Network Telemetry & Fiber Health Monitor: Multi threaded PowerShell system tray widget running in background STA runspaces with C# P/Invoke. Polls LAN HTTP router diagnostic endpoints to track live optical fiber health (Rx/Tx dBm, optical temperature, line latency) with zero WAN bandwidth impact.
- Chapter Link Log: Cross platform web and native iOS application built with TanStack Start (SSR), TanStack Router, TanStack Query, Tailwind CSS v4, Capacitor iOS, and Supabase.
- Pure Korea: Korean skincare e-commerce platform built with Next.js, Firebase Firestore live sitemaps, JSON-LD rich schema markup, and Cloudflare Web Analytics.
- European SME Enterprise Web Architecture: Delivered production platforms and bespoke digital systems for precision craftsmanship, gastronomy, and retail businesses across European commercial markets.
- Client Track Record: 450+ completed projects across international clients on Upwork, top freelance platforms, and direct enterprise contracts with a verified 5.0★ rating.
| CORE | |
| DATA | |
| INFRA | |
| FRONT | |
| AI & MCP | |
| TEST |
A test that never disagrees with you is decoration. Write the test that fails when the invariant breaks, not the one that passes today. In a multitenant system, the tests worth having are the ones that go red the second someone collapses two tenant axes into one.
Fail loudly at the boundary, gracefully in the middle. Reject a malformed payload at ingestion where validation is cheap and full request context exists. The alternative is a half written row three services deep that a customer finds for you next week.
Write down the deviation and the reason. Specifications and plans are always incomplete in places. Six months later, the useful artefact is not the original plan; it is knowing why the implementation diverged and what constraints governed the choice.
Comments explain why. Code explains what. If a block needs a comment to explain what it does, rewrite the block. Reserve comments for non obvious constraints you cannot deduce from syntax, such as an upstream provider bug that presents as an auth timeout.
Based in Pakistan · Working remotely with teams worldwide
adnanhaider0347@gmail.com · codebyadnan.tech · LinkedIn · The Regret Index




