MK Gare Jewelers – Jewellery E-Commerce Platform
A full-stack jewellery e-commerce platform with static page generation, real-time metal price-driven product pricing, a making charge discount engine, inventory-aware order management, and PayU checkout with coupon support.
Tech Stack
Responsibilities
- Built a jewellery e-commerce platform with Next.js static page generation for SEO-optimized product and category pages
- Designed a dynamic pricing engine that calculates product prices in real time based on live gold and silver metal rates — keeping prices consistent across the entire application
- Engineered a making charge discount system supporting both percentage-based and flat amount discounts, scoped strictly to making charges and never applied to the base metal value
- Developed an inventory management system with over-order prevention logic to block purchases that exceed available stock
- Built a billing system with itemized breakdowns — metal value, making charges, discount, and final amount — maintaining pricing integrity across orders
- Integrated PayU Payment Gateway for order checkout with coupon code application and discount validation at the payment stage
- Maintained a key log of all jewellery records to track pricing history, discount applications, and inventory movements
Case Study
Jewellery prices are not fixed — they float with gold and silver market rates. Every product price had to be computed dynamically from the current metal rate, weight, and making charges, and that computed price had to stay consistent whether the customer saw it on the listing page, the product page, the cart, or the final invoice. A standard e-commerce pricing model, where prices are stored as fixed values, would not work here.
Static page generation added a layer of tension. Product pages were statically generated at build time for SEO performance, but the pricing layer had to remain live and dynamic. I separated the two concerns cleanly: static content — product details, images, categories — was generated at build time and served from the CDN, while all price resolution always fetched live metal rates at request time. The product page shell was fast and crawlable; the price displayed was always current.
The pricing formula is: (metal weight × live rate) + making charge − applicable discount = final price. The discount engine was a strict business requirement — discounts could only ever apply to the making charge component, never to the metal value itself. I built this as a constraint at the data model level: price components are stored and computed separately, so there is no path for a coupon or offer to reduce the metal value, regardless of how it is applied.
Inventory management introduced a concurrency problem. The system needed to block purchases that exceeded available stock, including the case where two customers attempt to buy the last unit at the same moment. I implemented stock validation at order creation with database-level locking to prevent overselling under concurrent load.
The billing system locked in the metal rate at order creation time. This meant a price change after checkout would not affect an already-placed order — the invoice always reflected the rate at the moment the customer paid. Every order stored an itemised breakdown: metal value, making charges, discount applied, and final payable amount.
A key log maintained a full audit trail of every jewellery record — metal rate snapshots at each transaction, making charge history, discount applications, and inventory movements. This gave the business a reliable reference for pricing decisions and dispute resolution without relying on memory or reconstructing history from orders.
PayU was integrated for checkout with server-side coupon validation running before the payment was initiated — discounts were verified and applied to the correct price components before the final amount was handed to the payment gateway, preventing any client-side manipulation of the discount.
Key Decisions
SSG for pages, live API for prices
Product pages are statically generated at build time for SEO. Pricing always resolves from a live metal rate API at request time — the static shell is fast and crawlable, the price is always current.
Discount scoped to making charges only
Discounts are a strict business rule: they apply only to the making charge component, never the metal value. This is enforced at the data model level — price components are stored separately so no code path can discount the metal value.
Metal rate locked at order creation
The gold/silver rate at the moment of purchase is written into the order record. Price changes after checkout do not affect placed orders, and every invoice is auditable against the rate on the day.