1. Deep Dive: Technology Stack & Infrastructure
This platform is engineered for high availability, zero initial recurring costs, and strict type safety across the entire MERN stack.
💻 Client-Side (Frontend & Admin Dashboard)
- Core Framework: React.js / Next.js. Next.js provides Server-Side Rendering (SSR) which is critical for E-commerce SEO (allowing Google to index product pages like Sarees and Bangles).
- Language & Type Safety: TypeScript. Strict mode is enabled. The
any keyword is strictly prohibited across the codebase. All API responses and React props must be bound to specific interfaces.
- State Management: Zustand or Redux Toolkit. Required for managing complex, multi-step cart calculations (e.g., adding GST on the fly, applying COD surcharges, and handling cart quantities).
- Styling: Tailwind CSS for rapid, responsive UI development.
- Hosting: Vercel (Edge network, auto-SSL, global CDN for instant page loads).
⚙️ Server-Side (API & Business Logic)
- Core Runtime: Node.js with Express.js.
- Image Processing Pipeline: Cloudinary. When the Admin uploads a 5MB raw photo of a product, the Node backend buffers it directly to Cloudinary. Cloudinary converts it to
.webp, compresses it, and returns a secure URL. Our MongoDB only stores the URL string, keeping the database lightning fast.
- Asynchronous Jobs (Queues): BullMQ backed by Redis.
• Why: When 50 customers click "Notify Me" on out-of-stock glass bangles, sending 50 emails synchronously will freeze the Node single thread. BullMQ offloads this to a background worker, ensuring the main checkout API remains highly responsive.
- Email Service: Nodemailer connected to a custom SMTP server or free-tier transactional email provider.
🗄️ Database & Storage
- Database: MongoDB Atlas (M0 Sandbox).
- ODM: Mongoose.
- Architecture Pattern: Polymorphic Document Schema. * Explanation: Relational SQL databases struggle when product attributes vary wildly (e.g., a Bangle needs a "Diameter" and "Fragile flag", while Unstitched Fabric needs "Meters" and "Custom Tailoring Measurements"). MongoDB allows all 50 diverse items to live in one
Products collection while enforcing required fields at the application layer via Mongoose schemas.
☁️ Cloud Infrastructure (Bare Metal Deployment)