A specialty coffee brand needed an online store that could handle high-volume product listings, secure payments, and image-heavy product pages — all while loading fast on mobile devices. Off-the-shelf solutions were either too expensive or too rigid.
Built a custom e-commerce platform from scratch using Next.js and MongoDB. Prioritized mobile-first design, SEO-friendly server-side rendering, and a non-technical admin dashboard that the client could manage independently.
- Frontend: Next.js with SSR, Tailwind CSS, mobile-first responsive design
- Backend: Next.js API routes, MongoDB with Prisma
- Caching: Redis for product queries and session data
- Payments: Razorpay with webhook validation and idempotent order handling
- Media: Cloudinary for responsive image delivery and transformations
- Admin: Custom dashboard for inventory, orders, and content management
Payment webhook idempotency was critical. Razorpay fires webhooks with at-least-once delivery, and without idempotent handling, duplicate orders would corrupt inventory and billing. Implemented a webhook deduplication layer using order IDs and a processed-events collection in MongoDB.
- Redis cache hit rate: 94% for product listings
- Zero duplicate orders after idempotent webhook handling
- Server-side rendering improved Lighthouse SEO score from 54 to 92
- Admin dashboard usable by non-technical staff with zero training
Lessons Learned
Every project comes with tradeoffs. If I were to rebuild this today, I would invest more time in automated testing early in the cycle — catching edge cases in payment webhooks and encryption boundaries before they reach production. The architecture decisions held up well, but the test coverage should have matched the complexity from day one.
Was this project helpful?
Comments
Be the first to commentBe the first to share your thoughts.