GMI Trading

GMI Trading

GMI TradingB2B headless e-commerce for wholesale food distribution

Year
2025
Stack
Next.js 16GraphQLPostgreSQLRedisPrismaFirebaseDocker
Live
gmi-trading.com

The Challenge

GMI Trading is a specialty food import and distribution company serving wholesale buyers across 48+ states. Their existing systems couldn't keep up — tens of thousands of SKUs from hundreds of international brands, customer-specific pricing with volume discounts, real-time inventory that changes hourly, and a wholesale buyer base that needed modern self-service ordering. The legacy workflow relied on phone calls, PDFs, and manual price lookups. Product data lived in LodDepot (their ERP), images were scattered across Azure, Shopify, and AWS, and there was no unified catalog experience. Every price was different for every customer, making a standard e-commerce approach impossible.

Our Solution

We built a fully headless B2B e-commerce platform from scratch — a decoupled Next.js frontend with a GraphQL/Express backend, PostgreSQL for product data, and Redis for aggressive caching. The system syncs with LodDepot ERP hourly to pull live inventory and pricing, serves customer-specific prices based on account relationships, and provides a modern self-service ordering experience for wholesale buyers. The admin panel gives GMI's team full control over products, collections, brands, marketing content, and vendor applications without touching code.
GMI Trading  screenshot 1
GMI Trading  screenshot 2
GMI Trading  screenshot 3
GMI Trading  screenshot 4
GMI Trading  screenshot 5
GMI Trading  screenshot 6
GMI Trading  screenshot 7
GMI Trading  screenshot 8
GMI Trading  screenshot 9
GMI Trading  screenshot 10
GMI Trading  screenshot 11
GMI Trading  screenshot 12

What We Built

01Dynamic B2B Pricing Engine

Every price is calculated per-customer based on their account relationship. Supports rate discounts (percentage off), volume discounts (quantity tiers), and free goods promotions. Prices update in real-time from LodDepot with 2-minute cache intervals.

02Real-Time ERP Sync

Hourly automated sync pulls product data, inventory levels, and category structures from LodDepot API. Smart collections auto-rebuild when new products appear. Sync logs track every operation with error reporting. Manual sync trigger available in admin.

03GraphQL Admin API

Fully typed GraphQL layer for all admin operations: product management, collection CRUD, category editing, analytics queries. Firebase Admin auth middleware protects all mutations. Cache invalidation triggers automatically on data changes.

04Smart Collections

Filter-based collections with complex AND/OR logic. Automatically match products against vendor, country, categories, and custom attributes. Rebuild hourly during sync. Support manual, auto (synced from ERP), and smart (rule-based) types.

05Multi-Source Image Pipeline

Migrated product images from Azure, Shopify, and AWS into unified S3 storage. Automatic format optimization via S3 query params. Products support up to 5 images each. Brand logos and headers managed separately with upload UI.

06Intelligent Redis Caching

Variable TTL strategy: products 10min, collections 15min, pricing 2min, search 3min, sessions 24h. Reduces LodDepot API calls by ~80%. Cache invalidation on admin changes. Session storage with HttpOnly cookies.

07SEO & Discovery System

Dynamic XML sitemaps for 10K+ products. SEO-friendly slugs for brands, countries, and collections with automatic 301 redirects for migrated URLs. Server-side rendering for meta tags, Open Graph, and structured data.

08Brand & Country Discovery

Dedicated pages for each vendor/brand with custom logos, headers, descriptions, and product listings. Country-based product browsing for specialty food discovery. All with admin-editable content blocks and SEO fields.

09Wholesale Order Flow

Shopping cart with local persistence, bulk quantity entry, unit conversion display (KG, CS, PCS). PO number support, delivery/pickup selection, order history from LodDepot. Customer registration and vendor application forms.

10B2B Account Management

Account-based authentication via JWT tokens. Sessions stored in Redis with 24h TTL. Account numbers auto-injected into all pricing API requests. Customer-specific catalog views based on relationship data.

11Admin Dashboard

Product management with full-text search and pagination across 10K+ items. Drag-and-drop product curation for featured sections. Rich text editor (TipTap) for collection content. Sync status monitoring, vendor application review, and user management.

12Docker-First Architecture

Full containerized stack: PostgreSQL 16, Redis 7, Express backend with auto-migrations, Next.js frontend with Turbopack. Docker Compose orchestration. Horizontal scaling ready with stateless Redis sessions.

Results

10K+
products synced
48+
US states served
~80%
API calls cached
<2min
price freshness
Hourly
auto ERP sync
100%
headless architecture
← All Projects
GMI Trading — GMI Trading | WhyNotGlobal