
Architflix Original
Alankar Jewellers
A real client's storefront and back office: every piece is priced live from India's official IBJA gold rate, with an itemised breakup of metal, making charge, stones, hallmarking and 3% GST. Next.js 16 on Cloudflare Workers and D1, a secured staff admin, and 496 passing tests.
Overview
Alankar Jewellers is a pre-launch storefront and back office that Archit Jain built for a jeweller established in 1980 (Jadau, Polki and diamond), pricing every piece live from India's official IBJA gold rate with an itemised, GST-correct breakup, on Next.js 16 and Cloudflare Workers.
Season 1 · The Build
5 episodesA real client's storefront and back office: every piece is priced live from India's official IBJA gold rate, with an itemised breakup of metal, making charge, stones, hallmarking and 3% GST. Next.js 16 on Cloudflare Workers and D1, a secured staff admin, and 496 passing tests.
Built with Next.js, React, TypeScript, Cloudflare Workers, Cloudflare D1, and 1 more.
Shoppers see each piece's price recomputed from the current IBJA rate, broken down into metal, making charge, stones, hallmarking and 3% GST, then check out or book an appointment with a WhatsApp hand-off. A Worker cron pulls IBJA rates three times a day and expires stale ones, so the site never quotes off an old rate, and the product JSON-LD drops its price when the rate is stale and drops the offer entirely for demo pieces. Money is handled as bigint paise and rounded once per article, so invoices add up, and the pricing code encodes the relevant Indian rules: 3% composite GST, the hallmarking exemption for Kundan, Polki and Jadau, each piece's sale mode, and PAN collection at ₹2 lakh. Staff use an authenticated admin with a Today queue, orders, a piece editor, a rate override and a numbers view, secured with PBKDF2 plus a pepper (the strongest password hash Workers offers), HMAC-signed opaque sessions, CSRF protection, throttling and an audit log. The data lives in 20 Cloudflare D1 tables managed with Drizzle and forward-only migrations (rehearsed on a copy after a generated migration came out broken), CI checks that migrations are current, and a nightly GitHub Action exports, encrypts and restore-tests the database. The build is honest about where it stands: payment capture is switched off by a compile-time flag until BIS certification and payment-gateway KYC clear, so checkout currently becomes an enquiry; it runs on a workers.dev preview while the client's domain still serves their old site; and the catalogue is small, five real pieces plus four clearly labelled demo pieces, with much of the imagery AI-generated. 496 tests in 22 files pass, with zero TypeScript errors and zero lint warnings. Built by Archit with Claude as the AI coding assistant.
- Live pricing from the IBJA gold rate, ingested by a Worker cron three times a day; stale rates expire instead of being quoted
- Itemised statutory price breakup (metal, making, stones, hallmarking, 3% GST) with exact bigint-paise arithmetic
- Cart and checkout that respect each piece's sale mode and collect PAN at ₹2 lakh
- Staff admin with a Today queue, orders, piece editor, rate override and numbers; PBKDF2 + pepper, HMAC-signed sessions, CSRF, throttling and an audit log
- Appointment booking with a WhatsApp hand-off
- Product JSON-LD that withholds prices on stale rates and offers on demo pieces
- Nightly encrypted D1 backups with an automated restore test
Every project hits walls. Here's what nearly broke Alankar Jewellers — and how it shipped anyway.
- Exact money: bigint paise, rounded once per article so line items and invoice totals always agree
- Encoding Indian jewellery law: 3% composite GST, hallmarking exemptions for Kundan, Polki and Jadau, and PAN thresholds
- Scheduling a UTC cron against IST's half-hour offset, with an idempotent ingest keyed on the rate slot
- Forward-only D1 migrations rehearsed on a copy after the generator produced a broken one, plus a CI check that migrations are current
- Password storage on Workers, which only offers PBKDF2: strengthened with a pepper and throttling
Every build leaves residue. The takeaways from Alankar Jewellers that carry forward.
- Real clients bring real constraints: certification and payment KYC, not code, decide when checkout goes live
- Prices that change three times a day need freshness rules everywhere they appear, including structured data
- Never use floating point for money
- Ship honestly: demo pieces are labelled as demos, and payments stay off until they are legally allowed