Case Study Overview
# NexusMart: A Scalable Multi-Vendor Ecosystem
NexusMart is designed as a robust multi-vendor marketplace platform where multiple sellers can list products and users can shop seamlessly. Built with **Next.js 15**, it focuses on scalability, high performance, and a superior user experience.
## 🏗 Architecture & Tech Stack
- **Frontend:** Next.js 15 (App Router) & TypeScript
- **State Management:** Redux Toolkit (Cart, Wishlist, Compare Logic)
- **Styling:** Tailwind CSS (Responsive Design System)
- **API Integration:** Dynamic data fetching for products, categories, and user profiles
## 🚀 Key Highlights
- **Vendor-Ready Catalog:** Scalable product pages capable of handling inventory from diverse categories.
- **Dynamic Vendor Comparison:** Users can compare similar products from the marketplace side-by-side to make better decisions.
- **Advanced Filtering:** Powerful search capabilities allowing filtering by category, price, and specs simulating a real multi-vendor environment.
- **Optimized Checkout:** A streamlined, distraction-free checkout process designed to reduce cart abandonment.
The Challenge
One of the major hurdles was managing persistent state across server-side rendered (SSR) pages and the client side. Specifically, accessing localStorage during the SSR process caused hydration mismatches and build failures, as the server does not have access to the browser's storage API. Additionally, synchronizing the "Product Comparison" state dynamically for up to 3 items while ensuring the UI updated instantly was a logic-heavy task.
My Solution
To resolve the SSR storage issue, I implemented a custom createWebStorage utility in Redux. This utility checks for the window object's existence before attempting to access localStorage, providing a fallback no-op storage for the server environment. This ensured the app hydration was smooth and error-free. For the comparison feature, I leveraged Redux actions to strictly enforce the 3-item limit and used conditional rendering in React components to provide immediate visual feedback (like the floating counter) to the user.