Trendverse — D2C Ecommerce
A production-ready D2C storefront for the Indian market — catalogue, variants, cart, Razorpay checkout, accounts and a nine-screen admin, built to be branded and launched rather than built again. Nothing is tied to one product category.

- Year
- 2026
- Type
- Freelance
- Role
- Solo developer · Product owner
- Status
- Live
What needed solving
Small Indian D2C brands sell through Instagram DMs and a Google Form, keep stock in a spreadsheet, and reconcile UPI screenshots by hand. The alternatives are a hosted platform that charges per order, or a theme that still leaves the hard parts — variant-level inventory, payment settlement, money that survives an audit — to be written from scratch.
The solution
The store
A complete storefront built to be configured rather than rebuilt: catalogue with variants, cart, coupons, Razorpay checkout, MSG91 phone OTP, accounts, order tracking, and an admin covering products, categories, orders, customers, coupons, reviews and settings.
Under it
Next.js 16 App Router on Supabase Postgres 17 in ap-south-1 (Mumbai), with cookie sessions the server can read during render, Postgres read models so a screen costs one query instead of a fan of round trips, and indexed full-text search with a trigram fallback for misspellings.
What changed
- Everything a brand needs to go live is already built, so launching is branding, catalogue and stock — not a build
- Categories, variants, coupons and store settings are database-backed and managed from the admin — nothing is hardcoded to a vertical, so the same storefront fits apparel, accessories, home goods or anything else with a SKU
- The homepage hero is a Server Component with zero client JavaScript: one query, and the image URL known at HTML-render time so next/image emits a real preload
- Money is integer paise end to end, converted to rupees once at render; Razorpay's API speaks paise too, so there is no conversion at the payment boundary and no rounding drift against the gateway
- Hosted in the same region as the buyers, the payment gateway and the OTP provider, so no query on the critical path crosses an ocean
Technical highlights
- Stock is reserved, never decremented — reserve_stock → commit_stock on capture or release_stock on failure, with a sweep for abandoned checkouts, so the inventory ledger always explains the count
- Razorpay settlement is idempotent: whichever of payment.captured or order.paid lands second is a no-op, and a failed write returns 500 so the gateway retries rather than dropping the payment
- Every table has row-level security plus an explicit revoke-then-narrow-grant, so a missing policy fails closed; rate-limit buckets and the audit log sit in a private schema PostgREST does not expose at all
- Every SECURITY DEFINER function pins an empty search_path and revokes execute from anon by name — Supabase grants new functions to anon separately, so a blanket revoke alone leaves them reachable
- Product pages carry Product and Breadcrumb JSON-LD, and every image is stored with its width, height and an LQIP placeholder so nothing renders at an unknown size
The engineering, written up
A payment can succeed and still go wrong: a dropped webhook, a replayed one, a signature nobody checked. Here is how I verify them, settle exactly once, and keep a ledger I can reconcile against months later.
Check-then-insert reads as correct and oversells anyway, because two requests can both pass the check before either writes. The fix is layered, and the database does almost all of the work.
// Next step
Need something like this?
I take on a small number of projects each quarter. Let's talk if your idea fits.
// More freelance work

Karloo
Free Online Tools
A browser-first catalogue of free online tools — calculators, text utilities, developer helpers, converters, and AI-assisted workflows — built to be fast, searchable, and cheap to run.
Next.js 16 · React 19 · TypeScript

Kat-Katha
NGO Giving Platform
A full-stack giving site for a Delhi NGO — a hardened Razorpay donation pipeline with live campaign progress, plus a custom CMS the team runs themselves to publish stories, programs, and campaigns.
Next.js 15 · Vercel Postgres · Razorpay

Hair Crezz
Salon Booking Template
A customizable salon-booking template — each owner gets a branded deployment with their own services, stylists, slots, payments, and SMS confirmations.
Next.js 14 · Supabase · Postgres RLS