MERN Fashion E-Commerce Store
A MERN clothing store with a customer storefront and an admin panel: filtered product listings, search, verified-purchase reviews, cart, saved addresses and PayPal checkout, plus product, banner and order management. Redesigned UI on shadcn/ui and fully containerised with Docker Compose.
- React
- JavaScript
- Redux Toolkit
- Node.js
- Express.js
- MongoDB
- Mongoose
- JWT
- PayPal
- Cloudinary
- Tailwind CSS
- shadcn/ui
- Docker
Architecture
Overview
A full-stack e-commerce store for clothing. Shoppers browse and filter products, search, read and write reviews, manage a cart and an address book, and pay with PayPal. Admins manage products and their images, the home-page banners and order statuses.
System
React 18 SPA (Vite)
│ Redux Toolkit (10 slices) · Tailwind CSS · shadcn/ui
│ Role-based route guard (shop / admin)
▼
Express REST API
│ /api/auth · /api/shop/* · /api/admin/* · /api/common/feature
│ JWT in an httpOnly cookie
├──► MongoDB via Mongoose (users, products, carts, orders, addresses, reviews)
├──► Cloudinary (product and banner images)
└──► PayPal (create → approve → capture)
Docker Compose: mongo · api · clientKey design decisions
Filters live in the URL. Category, brand and sort options are kept in the query string, so filtered listings can be shared and survive a refresh. The server turns them into MongoDB $in queries and a sort.
Reviews only from buyers. Before accepting a review, the API checks that the user has an order containing that product.
Two-step PayPal checkout. The API creates the payment and redirects to PayPal for approval. On capture it marks the order paid, decrements each product's stock and clears the cart.
No files on disk. Uploaded images are buffered in memory with multer and sent straight to Cloudinary, so the API container stays stateless.
One command to run. The client, API and MongoDB each run in their own container, wired together with Docker Compose.
Key Implementation Highlights
Built a role-aware route guard that sends users to the shop or the admin panel based on the role in their JWT
SecurityImplemented server-side filtering and sorting with MongoDB $in queries, driven by URL search parameters
BackendAdded case-insensitive keyword search across title, description, category and brand
BackendAllowed reviews only from verified buyers by checking the user's orders before saving a review
DataIntegrated a two-step PayPal create, approve and capture flow that updates stock and clears the cart on capture
PaymentsStreamed product and banner images from memory to Cloudinary, so nothing is written to the server's disk
MediaRedesigned the storefront, checkout and admin pages with shadcn/ui and Tailwind CSS
FrontendContainerised the client, API and MongoDB with Dockerfiles and Docker Compose, with configuration moved to environment variables
DevOps
Interested in the technical details?
Let's Talk