AqsA Baig
MERNAWSE-CommerceRazorpayJWT

Building Mahalaxmi Tailors — MERN Full-Stack E-Commerce with AWS

How I built a production MERN e-commerce platform for Mahalaxmi Tailors with Razorpay payments, JWT RBAC, and AWS CloudFormation in 3 days.

A
10 min read1,100 views

Mahalaxmi Tailors needed a complete digital presence — an e-commerce storefront where customers could browse catalogues, place tailoring orders, and make secure payments. I built and deployed the full system in three days using the MERN stack and AWS.

Tech Stack Decisions

MongoDB for flexible product schemas, Express.js for REST APIs, React for the storefront, and Node.js on the backend. AWS CloudFormation was used to define the entire infrastructure as code — EC2 instances, RDS, S3 buckets, and CloudFront CDN — so the deployment is fully reproducible.

Authentication with JWT and RBAC

Three roles — Customer, Staff, and Admin — each with strictly scoped permissions. JWT access tokens (15-minute expiry) and refresh tokens (7-day expiry) stored in HTTP-only cookies prevent XSS-based token theft.

Razorpay Payment Integration

Orders are created server-side and Razorpay webhook signatures are verified with HMAC-SHA256 before updating order status. This prevents fraudulent order confirmations. Every payment event is logged for audit trails.

AWS CloudFormation Infrastructure

The entire AWS infrastructure is defined in a single CloudFormation template — making the deployment reproducible, version-controlled, and disaster-recoverable within minutes. EC2 runs the Node.js backend behind an Application Load Balancer, with CloudFront caching static assets globally.

"Build it once, deploy it anywhere — that's what Infrastructure as Code gives you."
Tags:MERNAWSE-CommerceRazorpayJWT

Written by AQSA ZAM ZAM MIRZA JOHAR BAIG

AI/ML Engineer & Full-Stack Developer

B.Tech CSE (AI/ML) at VIIT Pune (CGPA 8.77) and BSc Data Science at IIT Madras. AWS Certified Cloud Practitioner. Writes about DSA, ML, AWS, and full-stack engineering.

More Articles by AQSA ZAM ZAM MIRZA JOHAR BAIG

Discussion

Join the discussion — log in to comment.

Log In to Comment