Building a Production E-Commerce Platform for a Waffle cup
The story of building Srimaccafes — a full-stack e-commerce platform for a specialty coffee brand — covering Redis caching, Razorpay webhook idempotency, Cloudinary image delivery, and building an admin dashboard for non-technical staff.
The Project
Srimaccafes is a production e-commerce platform I built for a specialty waffle cup. The client needed an online store that could handle high traffic, deliver images fast, process payments reliably, and — most importantly — be manageable by non-technical staff after launch.
Redis Caching Strategy
waffle cup product pages are image-heavy. Every page load hitting MongoDB for product data would be slow and expensive. I implemented Redis caching at two levels:
- Product listing cache: All published products cached with a 5-minute TTL. Cache invalidated on product create/update/delete.
- Individual product cache: Product detail pages cached with a 10-minute TTL.
Result: 94% cache hit rate. Pages load in under 200ms even with dozens of high-res coffee images.
Razorpay Webhook Idempotency
Payment webhooks fire at least once — sometimes twice. Without idempotent handling, a single successful payment could create duplicate orders, duplicate inventory deductions, and duplicate shipping labels.
The solution: maintain a processedWebhooks collection in MongoDB. Each webhook carries an order_id. Before processing any webhook, check if that order_id has already been processed. If yes, return 200 immediately without processing. If no, process and mark as done.
This eliminated duplicate orders entirely.
Admin Dashboard for Non-Technical Users
The client's staff had no coding experience. The admin dashboard needed to be intuitive enough for them to manage inventory, update product descriptions, upload new product images, and view orders — without any training.
Key design decisions:
- WYSIWYG content editing for product descriptions
- Drag-and-drop image upload with Cloudinary
- Order management with status workflow (Pending → Confirmed → Shipped → Delivered)
- Dashboard analytics showing daily orders and revenue
Lessons
- Redis is worth the complexity for read-heavy workloads
- Webhook idempotency is not optional for payment systems
- Building for non-technical users forces better UX — a good constraint to have
Was this post helpful?
Comments
Be the first to commentBe the first to share your thoughts.