kariem.dev
← all work
mineplatformliveAug 2025 —

HVAR

One organism, four systems: a phone-OTP storefront wired live into a Laravel ERP, a reconciliation hub running four state machines across shipping and accounting, and an MCP server exposing all of it as 101 AI tools — bound together by one identity key, the customer's phone number.

Founder, full-stack — commerce, ops, and AI infrastructure

هفار — four systems that read as one, joined by a single fact: the customer’s phone number. A storefront, a warehouse ERP, a call-center reconciliation hub, and an AI tool server, all resolving the same identity across three MySQL pools and one webhook queue. Here’s how they connect — then switch between the four systems below.

webhook · MySQL readread / writeMCRM APIAPIphone # = identity key · Store · ERP · HubCustomersStoreERP · LaravelHub · MCRMMCP · 101 toolshvarstore.comhvar_erpone database

The seam that’s most of the work

HVAR Portal is the storefront and admin console behind hvarstore.com — Arabic-first, RTL, one codebase serving both customers and the team running /admin. Stock and product truth live in an external ERP the storefront doesn’t own: Portal reads that ERP live, layers its own pricing and content on top, and pushes every order back out through a durable webhook queue — 8 retries, exponential backoff. Three MySQL pools, deliberately unmixed: the site DB owns everything the storefront writes, the ERP DB is read-only truth for what the warehouse holds, joined at query time with no foreign keys across the boundary.

The honest specifics

Installment plans (ValU, Souhoola, Aman) · Kashier card payments · Bosta delivery · passwordless phone-OTP login · a webhook-outbox monitor in /admin for catching stuck ERP syncs before a customer notices. Repair and warranty tickets sync straight into the same call-center queue Hub runs — one customer record, not three systems pretending to agree. No automated test suite or CI yet: verification today is bun run lint plus hands-on flows against the live site.

Customers

Phone-OTP passwordless auth, optional Facebook enrichment — browse, buy, track, open service tickets. Arabic-first RTL throughout.

pos/README.md:49,163-165

Admin / Owner

Gated by ADMIN_PHONES / OWNER_PHONES comma-separated env allowlists — no DB-backed role table, literally a phone allowlist.

admin.ts:28,940,969-971

BunHonoAstroReactTypeScriptTailwind CSSMySQLDrizzle ORMFlaskPythonJWTREST APILaravelPHPMCPBosta API