Fashion Commerce Platform
Production Live
DRS Blouse

Fashion Commerce Platform

Full-stack B2B/B2C e-commerce platform with real-time features and async processing.

Role
Full-Stack Developer & System Architect
Duration
December 2024 - January 2026
Live Site
Visit
API Docs
View
FastAPI
React
PostgreSQL
Redis
Celery
WebSockets
ImageKit

The Challenge

A traditional fashion wholesale business needed to transition from manual order processing to a modern e-commerce platform. Key challenges included serving both B2B and B2C customers with different pricing, handling high-resolution fashion images (10-15MB each), real-time inventory sync, and mobile-first design for 70%+ mobile traffic.

The Solution

Developed a comprehensive platform with role-based pricing engine (automatic B2B/B2C switching based on user verification), async image pipeline (Celery workers process uploads in background, optimizing from 12MB → 2MB), WebSocket real-time updates (instant UI updates when images finish processing), and infinite scroll with server-side sorting for smooth browsing.

Architecture

System Design

Performance

Key Results

Image Size Reduction
12MB2MB
83% smaller
Memory Optimization
270MB80MB
70% reduction
Form Response Time
15s500ms
30× faster
DOM Elements
100015 rendered
98% reduction
API Response
800ms<200ms
Redis cached
Database Load
100%30%
70% reduction via caching
Features

Key Features

Dual Pricing Engine (B2B/B2C)

Role-based pricing with automatic switching. User model stores role (admin/b2b/b2c) and verification status. Products have price_b2b, price_b2c, and mrp fields.

Dual Pricing Engine (B2B/B2C)
Click to expand

Async Image Processing Pipeline

Fire-and-forget upload with Celery background processing. Forms close instantly while workers optimize images to 1.8-2.5MB and notify via WebSocket when complete.

Async Image Processing Pipeline
Click to expand

Infinite Scroll with Server-Side Sorting

useInfiniteQuery with IntersectionObserver. Backend handles sorting (new, price_asc, price_desc, popular) to prevent item jumping during pagination.

Infinite Scroll with Server-Side Sorting
Click to expand

Product Variant Management

UPSERT pattern with unique constraint on (product_id, color_id, size_id). SKU format: DRS-{product_id}-{random}-{COLOR}-{SIZE}.

Product Variant Management
Click to expand

Real-Time WebSocket Updates

Redis PubSub + WebSocket for real-time notifications. After background image processing, UI updates instantly without page refresh.

Real-Time WebSocket Updates
Click to expand

Admin Dashboard

Product CRUD with variant management, order management with status workflow, upload failures monitoring (DLQ), virtualized tables with react-window.

Admin Dashboard
Click to expand
Stack

Tech Stack

Frontend
React 18 + Vite + TailwindCSS + React Query
Backend
FastAPI + Python 3.12 + SQLAlchemy 2.0
Database
PostgreSQL (Render Managed)
Caching
Redis (Session + API Cache)
Queue
Celery (Async Image Processing)
Storage
ImageKit (CDN + Transformations)
Deployment
Vercel (Frontend) + Render (Backend + Workers)
Domain
Cloudflare (DNS + SSL + Protection)
Diagrams

System Flowcharts

Before vs After: Order Processing

Transformation from manual WhatsApp-based order processing to automated e-commerce platform

Dual Pricing Engine Flow

Role-based pricing with automatic B2B/B2C switching based on user verification

Async Image Processing Pipeline

Fire-and-forget upload with Celery background processing and WebSocket notifications

Infinite Scroll with Server-Side Sorting

useInfiniteQuery with IntersectionObserver for smooth pagination

Product Variant Data Model

UPSERT pattern with unique constraint on (product_id, color_id, size_id)

Real-Time WebSocket Updates

Redis PubSub + WebSocket for instant UI updates after background processing

Infrastructure

Deployment Architecture

Gallery

Screenshots Gallery

Homepage
Full homepage with hero section and product showcase
Products Page
Products listing with filters and infinite scroll
Mobile View
Mobile-first responsive design
Product Detail
Product detail with B2B/B2C pricing
Admin Dashboard
Admin overview with real-time stats
Admin Products
Virtualized product management table
Product Form
Product creation with variant matrix
Orders Management
Order tracking and status workflow
Upload Failures
Dead Letter Queue monitoring
Reports
Analytics and reporting dashboard
Insights

Key Learnings

1

ImageKit SDK doesn't support upload-time transformations → Use REST API directly

2

Celery concurrency=2 means 2 workers (not 2 tasks/worker). Memory is per-worker.

3

Redis PubSub subscriptions made during app startup are lost when listener starts. Subscribe inside the listener task.

4

FastAPI Form Data always receives strings, even for boolean parameters. Manual type conversion required.

5

Create WebSocket connection manager outside React tree to prevent multiple connections.

Interested in Similar Solutions?

Let's discuss how I can help build your next project.