Back to Projects
TrendWave
CompletedMongoDBExpress.jsReact+6 more

TrendWave

A scalable MERN e-commerce platform with user authentication, PayPal payments, media uploads, and role-based dashboards for Admin, Vendor, and User.

Timeline

3 Months

Role

Full Stack Developer

Team

Solo

Status
Completed

Technology Stack

MongoDB
Express.js
React
Node.js
Tailwind CSS
PayPal
Cloudinary
JWT
Redis

Key Challenges

  • Role-based access control
  • Reliable payment flows
  • Efficient media handling
  • Scaling reads/writes

Key Learnings

  • Secure JWT auth & RBAC
  • PayPal subscription & order flows
  • Cloudinary image/video pipeline
  • Caching with Redis for performance

Overview

TrendWave is a scalable MERN e-commerce application built for modern marketplaces.
It supports secure user authentication, vendor product management, PayPal checkout, media uploads (images & video), and role-based dashboards for Admins, Vendors, and Customers.

The aim was to build a production-ready marketplace that handles media-rich product catalogs, robust payment flows, and clear operational dashboards.


Key Features

Authentication & Authorization

  • Email/password + social OAuth sign-in
  • JWT-based authentication with refresh tokens
  • Role-Based Access Control (Admin, Vendor, User)

Product & Media Management

  • Vendor dashboard to create/edit products with images & videos
  • Direct uploads to Cloudinary (or S3) with server-side validation
  • Automatic image transformations and CDN delivery

Checkout & Payments

  • PayPal REST/Checkout integration for one-time payments and subscriptions
  • Webhooks for order confirmation, refunds, and subscription events
  • Secure server-side order creation and capture

Dashboards

  • Admin: user management, analytics, order oversight, dispute handling
  • Vendor: product stats, order list, payout history, inventory controls
  • User: order history, saved items, profile & payment methods

Performance & Scalability

  • MongoDB schema design with indexes for fast product search
  • Redis caching for hot product lists and sessions
  • Background workers for media processing and email/webhook retries

API Endpoints

Auth

POST /api/auth/register
POST /api/auth/login
POST /api/auth/refresh-token
POST /api/auth/logout

### **Users**
```ts
GET /api/users/:id
PATCH /api/users/:id
GET /api/users/me

### **Products**

```ts

GET /api/products
GET /api/products/:id
POST /api/products           
PATCH /api/products/:id     
DELETE /api/products/:id    
POST /api/products/:id/media /

### **Orders**
```ts
POST /api/orders/create      // create order server-side
POST /api/paypal/create      // create PayPal order
POST /api/paypal/capture     // capture/confirm payment
POST /api/paypal/webhook     // webhook handler
GET /api/orders/:id

## Challenges

### Role-based access control
- Designing middleware to enforce RBAC across routes  
- Securing vendor-only actions and admin-level overrides  

### Reliable payment flows
- Handling PayPal order creation, capture, and edge cases (pending, failed)  
- Verifying webhooks and reconciling orders with DB state  

### Efficient media handling
- Secure direct uploads with signed URLs  
- Processing thumbnails, video transcoding, and managing storage costs  

### Scaling reads/writes
- Hot product lists and search performance under load  
- Using Redis and pagination to reduce database pressure  

## Learnings
- Implemented secure JWT + refresh token flows and robust RBAC middleware  
- Built reliable PayPal workflows with proper webhook verification/handling  
- Designed media pipelines with Cloudinary for transformations and CDN delivery  
- Applied Redis caching and background workers to boost performance  
- Structured schemas and indexes for fast product search and analytics  

Design & Developed by Suraj Sakhare
© 2025. All rights reserved.