2025·Commerce platform·Live

Leo Hydra Studio

Production e-commerce platform I hand-coded from scratch and run end-to-end for a Dubai art studio. 20 to 30 orders per day, every limited-edition drop sells out within 7 days of going live, every line of code is mine. Dual-rail crypto + bank checkout, server-side Meta CAPI, transactional email pipeline, security-audited migration history. ~12 Postgres tables, ~30 migrations, ~22 API routes, ~50 React components.

Next.js 14·TypeScript·Postgres·Supabase·Resend·Vercel Cron·ethers.js·Meta CAPI·React Flow·Framer Motion·Tailwind CSS·Next.js 14·TypeScript·Postgres·Supabase·Resend·Vercel Cron·ethers.js·Meta CAPI·React Flow·Framer Motion·Tailwind CSS·

I built the entire site from zero. No template, no inherited codebase, no rebuild of someone else's work. Sole operating team for an art studio based in Dubai. Artist makes the work; I designed, coded, and ship everything else from Mumbai. Live at leohydra.com.

Leo Hydra Studio homepage: large-format original on a luxurious interior wall, with the LEO HYDRA DUBAI · ORIGINAL WORKS · LIMITED EDITIONS positioning

Scale today

30
Orders per day
20 to 30 across prints and originals
7d
Sell out window
every drop, post launch
100%
Drops cleared
no SKU has expired unsold
1
Engineer / operator
no team, no agency

It's a real business at a real cadence. Every drop sells out inside a week of going live. Originals are priced on inquiry but they move through the same operator, the same calendar, the same warehouse. One pipeline, two SKUs.

What I built

A production-grade Next.js 14 e-commerce platform that I architected and wrote from scratch:

  • Dual-rail checkout: USDT-on-Polygon (verified on-chain via ethers plus a Vercel Cron scanner walking USDT Transfer events every ~2 minutes) and bank transfer (admin manual confirm, UTR uniqueness enforced at the DB via partial unique index).
  • Micro-offset payment discriminator: every crypto order gets a unique 1 to 999 µUSDT offset added to its expected amount, enforced by a partial unique index on payments(expected_amount_micro) WHERE status='initiated'. Two pending orders with identical cart totals can never collide on-chain. Reserved and released by status-change triggers.
  • Race-locked payment confirmation: confirm_payment_atomic does SELECT … FOR UPDATE on the order row at the very top, then status-guarded UPDATEs to serialize against admin-cancel, auto-expire, and cron-expire (migration 031). Three cascading triggers on orders handle payment-row expiry, stock release, and micro-offset release in lockstep.
  • Transactional email pipeline: Resend-backed sends across six lifecycle email kinds (order confirmation, bank instructions, bank reference submitted, bank confirmed, order recovery, studio notifications). Every send writes a row to an append-only order_email_events audit table. Admin "Resend" UI is synced with the API route mapping so what's offered and what's sent stay in sync.
  • Meta Pixel + Conversions API across every conversion surface (checkout, inquiry / contact / project-request forms, newsletter, product pages, site-wide PageView), all dedup-aware via a shared eventID, PII hashed SHA-256 per Meta spec. Browser PageView uses navigator.sendBeacon with a fetch keepalive fallback.

One order, end to end

What it actually looks like when someone buys a print. A real $199 Chromatic print order, paid in USDT on Polygon, walked across every system I built. Auto-plays; hover to pause; click any step to jump.

Order lifecycle· 01 of 09
Product
01Product

Reader lands on the print page. $199, edition of 50, 29 remaining. Every state (preorder, available, fully collected) is its own variant of this same UI.

Swipe to navigate

Why this depth

The race locked confirmation, the micro offset discriminator, the cron scanner. These look heavy for a single operator studio. They're not. They exist for the same reason real e-commerce shops use them. Every drop launch is a 7 day rush window where concurrent purchases are realistic. On-chain payments settle through a public mempool, and the order of events is not under your control. A payment confirmation bug at any volume above zero is an unrecoverable customer trust event.

The engineering is sized for the worst case minute of any given launch day, not the average minute. At low traffic these patterns cost nothing. At launch traffic they're the difference between "shipped clean" and "manually reconciling for a week".

Engineering scale

12
Postgres tables
orders hub + 4 standalone
30
Forward-only migrations
drift-checked vs pg_dump
22
API routes
26 pages · 50 components
11
Security commits
3 audit rounds, migrations 027 to 031

The full breakdown: ~12 Postgres tables (orders, order_items, payments, bank_transfer_payments, crypto_payments, products, leads, newsletter, order_email_events, payment_micro_reserved, order_scan_throttle, rate_limit_buckets). ~30 forward-only migrations applied via Supabase SQL editor, with verified live-DB drift checks against nightly pg_dump backups. Three documented security audit rounds harden rate limiting, brute-force lockout, CSRF Origin checks, PII redaction, and three isolated HMAC secrets + CSP and security headers in next.config.js.

Mini Map

The actual database schema, interactive. Drag tables around, pinch or scroll to zoom, click the minimap to jump, hit "Reset layout" to restore. The seven FK relationships between orders, order_items, payments, crypto_payments, bank_transfer_payments, order_email_events, order_scan_throttle, and products are drawn as animated edges. The four standalone tables (leads, newsletter_subscribers, rate_limit_buckets, payment_micro_reserved) sit independently. They belong to inquiry, marketing, infrastructure, and crypto discriminator subsystems respectively. None of them need referential ties to the order graph.

A separate commerce model for originals

Original-artwork detail page (The Turn): acrylic-on-canvas spec, "AVAILABLE" status, certificate / signature / worldwide-delivery features, "Price: Available on inquiry", INQUIRE TO ACQUIRE CTA. A separate commerce model from the prints, unique pieces priced on inquiry, not point of sale.

Originals don't run through the checkout above. Unique pieces are priced on inquiry, captured into the leads table, and routed to the studio manually. Two commerce models, one codebase.

Arnav handles everything technical at Leo Hydra. Site, payments, emails, admin panel, the whole damn thing. We've been live and selling since launch and I haven't touched a line of code. I make the work, he ships it.

Lev·Principal artist · Leo Hydra Studio·Dubai·@leeohydra

The non-code half

Run Meta ad campaigns end-to-end. Manage limited-edition print production with printing houses. Coordinate fulfillment from the Dubai warehouse. Hire and direct video editors. Sound design and multi-platform posting (Behance / Tumblr / Instagram). Scale Reels generation with modern creative tooling.

Live at leohydra.com.

See it live

leohydra.com