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 - managing 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 required modern self-service ordering. The legacy workflow relied on phone calls, PDFs, and manual price lookups. Product data was stored in LodDepot (their ERP), while images were scattered across Azure, Shopify, and AWS, resulting in no unified catalog experience. Every price was unique to each 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 paired with a GraphQL/Express backend, PostgreSQL for product data, and Redis for high-performance caching. The platform syncs with the LodDepot ERP on an hourly basis to provide up-to-date inventory and pricing. It supports customer-specific pricing based on account relationships and delivers 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 - all without writing 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 account relationships. Supports percentage-based discounts, 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 the LodDepot API. Smart collections automatically rebuild when new products appear. Sync logs track all operations with error reporting. Manual sync can be triggered from the admin panel.

03GraphQL Admin API

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

04Smart Collections

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

05Multi-Source Image Pipeline

Product images migrated from Azure, Shopify, and AWS into unified S3 storage. Automatic format optimization via S3 query parameters. Products support up to 5 images each. Brand logos and headers are managed separately through the admin UI.

06Intelligent Redis Caching

Variable TTL strategy: products 10 minutes, collections 15 minutes, pricing 2 minutes, search 3 minutes, sessions 24 hours. Reduces LodDepot API calls by approximately 80%. Cache invalidation occurs on admin updates. Session storage uses 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 and brand with custom logos, headers, descriptions, and product listings. Country-based browsing enables discovery of specialty products. All content is editable in the admin panel with SEO fields.

09Wholesale Order Flow

Shopping cart with local persistence, bulk quantity input, and unit conversion display (kg, cs, pcs). Supports PO numbers, delivery or pickup selection, and order history from LodDepot. Includes customer registration and vendor application forms.

10B2B Account Management

Account-based authentication using JWT tokens. Sessions stored in Redis with a 24-hour TTL. Account numbers are automatically included in pricing API requests. Customer-specific catalog views based on account relationships.

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. Includes sync status monitoring, vendor application review, and user management.

12Docker-First Architecture

Fully containerized stack: PostgreSQL 16, Redis 7, Express backend with automatic migrations, and a Next.js frontend with Turbopack. Docker Compose orchestration. Designed for horizontal scaling 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