Back to Overview
03 / 05
CASE STUDY · 03Full-Stack MERN Architecture2024

FinGo Marketplace

Multi-tenant commerce architecture for regional enterprise.

Screen 1 of 6Auto-scrolling every 3s
https://fingo-one.vercel.app
FinGo Marketplace — Store Directory
Store Directory

Verified merchants directory with city and category routing

Application Screen Flow (Click any tag to jump to that screen)
Executive Architecture

System Overview & Engineering Longevity

A scalable multi-tenant commerce platform built on the MERN stack (MongoDB, Express, React, Node.js) serving enterprise merchants and consumers across Lahore, Karachi, and Islamabad. Engineered with a 3-tier Role-Based Access Control (RBAC) architecture separating Customer, Seller, and Super Admin portals. Features JWT authentication with silent refresh token rotation, dynamic multi-store directories, multi-vendor cart splitting, and a full lifecycle order state machine.

Core Innovations

Key Engineering Highlights

3-tier RBAC architecture: Customer, Merchant & Admin portals
Cryptographic JWT auth with silent refresh token rotation
City-level geo-filtering across Lahore, Karachi & Islamabad
Multi-vendor cart with atomic order splitting and state machine
Merchant dashboard: inventory management, sales & order dispatch
Admin compliance portal for merchant verification and audits
Technologies & Protocols
React.jsNode.jsExpress.jsMongoDBJWT AuthRESTful APITailwind CSSCloudinaryVercel
Production Standard

Architected with clean domain separation, strict TypeScript contracts, and automated telemetry logging.

<45ms

Catalog Query Latency

Compound MongoDB indexing

3 Cities

Regional Coverage

Lahore, Karachi, Islamabad

3 Portals

Scoped RBAC Tiers

Customer, Seller & Admin

100%

Atomic Cart Splitting

ACID transactional order dispatch

Execution Pipeline

End-to-End System Data Flow

How user inputs, computer vision pipelines, and transaction protocols flow across the stack.

STEP 01

Regional Geo-Routing

Shopper selects city (Lahore/Karachi/Islamabad); marketplace filters verified regional stores and delivery zones.

STEP 02

Multi-Store Cart Splitting

Cart partitions items into separate vendor fulfillment streams with independent sub-totals.

STEP 03

Atomic Order Creation

MongoDB transactional session commits customer order and generates individual merchant fulfillment tickets.

STEP 04

Vendor Dispatch State Machine

Merchants receive incoming orders and advance states: Confirmed → Packing → Dispatched → Delivered.

STEP 05

Admin Verification & Oversight

Admins audit store performance, resolve customer complaints, and ensure merchant compliance.

Module Architecture

System Capabilities & 6+ Functional Modules

6 Production Subsystems
Security & Access

3-Tier RBAC Portal Architecture

Granular permission separation providing customized UI and API scopes for Customers, Merchant Sellers, and Platform Administrators.

Customer Portal (/customer): Browse stores, manage cart, track order lifecycles
Seller Portal (/seller): Manage storefronts, product catalogs, and incoming orders
Admin Portal (/admin): Approve merchants, audit stores, and supervise operations
Transactional Engine

Atomic Order Splitting & State Machine

When a customer purchases items from multiple distinct merchants in a single checkout, the backend atomically partitions the transaction into independent merchant orders with individualized status tracking.

Atomic order splitting across multiple merchant storefronts
Order state machine: Placed → Confirmed → Packing → Dispatched → Delivered
Automated stock reservation and real-time inventory decrementing
Discovery & Search

Geo-Spatial City Filtering Directory

Optimized regional filtering enabling shoppers to filter superstores, grocers, and specialty merchants based on city location (Lahore, Karachi, Islamabad).

City-level merchant aggregation and distance-based sorting
Verified merchant trust badges and local customer ratings
Category indexing for groceries, electronics, and daily essentials
Authentication Core

JWT Authentication & Silent Refresh Rotation

Security architecture utilizing short-lived access tokens paired with secure HTTP-only refresh tokens rotated silently in the background, preventing session hijacking.

Cryptographic JWT token signing with RSA keypairs
Silent background refresh rotation without user interruption
Automatic token invalidation upon password reset or logout
Vendor Tools

Merchant Catalog & Inventory Management

Full-featured vendor management suite enabling merchants to create product listings, upload imagery, configure variants, manage inventory counts, and toggle promotional deals.

Cloudinary image optimization and upload pipeline
Discount rate calculation and promotional deal banners
Low-stock alerts and automatic out-of-stock badge toggles
Platform Governance

Admin Compliance & Merchant Verification

Administrative governance suite providing document review workflows (CNIC, business licenses) to verify merchant legitimacy before stores are permitted to sell publicly.

Merchant document upload and review audit workflow
One-click store suspension or verification badge approval
Platform-wide order dispute oversight
Technical Hardening

Key Engineering Bottlenecks & Solutions

Challenge 01

Multi-Vendor Order Partitioning Without Data Inconsistencies

When a single customer cart contains items from 3 different stores, a partial failure could cause inventory anomalies. Engineered a MongoDB multi-document transactional pipeline that atomically commits all sub-orders or rolls back completely if any store inventory is depleted.

Engineered & Hardened
Challenge 02

Secure Session Persistence Across Refresh Cycles

Storing tokens in localStorage exposed credentials to XSS vulnerabilities. Implemented a dual-token architecture: short-lived access tokens stored in memory paired with HttpOnly, SameSite=Strict refresh cookies rotated on every API request.

Engineered & Hardened
Challenge 03

Low-Latency Catalog Search Across Large SKUs

Built compound compound indexes on MongoDB collections (city + category + price) and implemented debounced text search, keeping catalog query execution times under 45ms across thousands of product records.

Engineered & Hardened
Next Case Study

Evershine Academy ERP & LMS

Multi-campus educational ERP & LMS featuring live biometric fingerprint integration, 7-role portals & automated finance engine.

View Next System