Work04 — FeaturedE-Commerce & Generative AI

Thrift Plug.

AI-powered premium thrift e-commerce with real-time atomic inventory locking.

Visit Live Project
CLIENT
Thrift Plug (Cameroon)
ROLE
Lead Fullstack & DevOps Engineer
YEAR
2026
DURATION
3 Months
STATUS
In Production
thrift-plug
§01 — OVERVIEW
Thrift Plug is a custom-engineered e-commerce platform built to solve the unique operational and inventory challenges of the vintage retail market in Cameroon (serving Douala and Yaoundé). Unlike standard e-commerce sites where items have multiple quantities, thrift stores deal exclusively with one-of-a-kind products. This platform features a high-performance headless Next.js frontend integrated with Payload CMS, automated multimodal AI cataloging via Google Gemini, a custom atomic stock-locking engine to prevent double-purchasing race conditions, and a fully containerized CI/CD DevOps pipeline for continuous delivery.
§02 — CHALLENGE

Race Conditions in Unique-Item Inventory

Since every thrifted garment is one-of-a-kind, standard database checkouts create a critical vulnerability: if two customers attempt to buy the same item at the exact same millisecond, both transactions might process, resulting in double-selling. Traditional database reads and writes are not fast enough to prevent this race condition.

Garment Cataloging Bottlenecks

Uploading hundreds of unique garments weekly requires manual data entry for brands, sizes, colors, categories, and descriptions. This process represents a massive operational bottleneck that limits business scalability and introduces human error.

Asset Bandwidth & Delivery Costs

Thrift shoppers rely entirely on high-resolution image galleries to assess garment condition. Storing and serving thousands of heavy images directly from a application server is expensive and severely degrades website performance on slower local mobile networks.

§03 — THE BUILD
thrift-plug
thrift-plug
[ Image Placeholder ]
Thrift Plug homepage grid featuring premium one-of-a-kind vintage apparel
§04 — APPROACH
To build a seamless and high-performing experience, I designed a multi-layered technical architecture: 1. Atomic Lock Strategy: I implemented a custom Next.js Server Action that directly communicates with raw MongoDB collections. Using the atomic findOneAndUpdate operation, items are marked as 'locked' for 10 minutes at the exact microsecond checkout is initiated. Any concurrent checkout attempt is automatically blocked and rolled back. An n8n-triggered cron worker hits a secure API route periodically to sweep and release expired locks. 2. AI-Assisted Cataloging Pipeline: I wrote a Payload CMS beforeChange hook that intercepts newly uploaded garment images and sends them to the multimodal Google Gemini Flash API. The model analyzes the photo and automatically generates the product name, brand, color, category, and an engaging sales description in French. A secondary hook automatically registers new categories into the global settings, removing manual database entries. 3. CDN-Backed Media Storage: Integrated Cloudflare R2 object storage using an S3 adapter and routed all assets through a high-speed custom CDN domain to ensure lightning-fast image loading and zero database load. 4. Enterprise CI/CD & Testing: Engineered a production-grade GitHub Actions pipeline. On every commit to production, the runner initiates a Docker container environment, spins up an isolated MongoDB database service, executes automated Vitest integration tests, compiles the Next.js production build, and pushes a lightweight Docker image to the GitHub Container Registry (GHCR) for immediate Kubernetes/VPS deployment.
STACK
Next.js 15Payload CMSMongoDBGemini Flash AICloudflare R2DockerGitHub ActionsVitest
§05 — OUTCOMES
100%
Zero Double-Purchasing Errors in Production
< 5s
Multimodal AI Garment Cataloging and Analysis Time
100%
Automated DevOps CI/CD Deployment Pipeline
NEXT PROJECT
05 / 4
Nextise

An enterprise-grade SaaS and AI automation ecosystem empowering DACH businesses through scalable workflows and custom LLMs.