Back to Projects
onemkts
AI/ML

onemkts

Full-Stack AI Engineer & Team Lead

NestJSNext.jsMongoDBRedisOpenAIAtlas Vector SearchSocket.ioAgoraMuxStripe

About the Project

onemkts (One Markets, branded WorldMarkt) is a cross-border e-commerce marketplace and the largest codebase I have worked on: three independently deployed applications over a 51-module NestJS API, plus a mobile client consuming the same endpoints. I lead the engineering team on it and own the AI layer end to end. Beyond the commerce core — products, orders, cart, checkout, vendors, categories, shipping, returns, payouts — it runs live commerce (Agora broadcasts, Mux video, auctions, stories, buyer-seller calls), a multi-currency wallet with KYC gating and platform escrow, RFQs, ads and promos, and an AI layer that reaches into moderation, search, fraud, support and notifications rather than sitting in one corner as a chatbot. Nothing here is a monorepo: each project is its own git repository with its own remote and dependency tree, so a change spanning the API and its consumers lands as separate commits in separate repos.

What It's Made Of

Core API

NestJS 11 · MongoDB · Redis · Socket.IO · Bull

51 domain modules, each typically split into a public controller and an admin.* controller with elevated permissions. Effective permissions are the union of the user's role, their staff department, their staff role and per-user extras, so staff roles are DB-backed and seeded rather than hardcoded in guards. Every response goes out through one envelope interceptor; uploads, notifications and emails run on Bull queues; Socket.IO carries real-time messaging and live-stream events. One codebase serves the storefront, the admin console and mobile, branching on an X-Client-Type header — a flow that would hand a web user a reset link hands a mobile or admin caller a six-digit code instead.

Storefront & vendor dashboard

Next.js 16 · React 19 · React Query · Zustand

Customer shopping and the full vendor dashboard in one app, separated by route group. 29 self-contained feature modules, each owning its own axios service and React Query hooks rather than a central API directory, plus 17 Zustand stores for client state. Localized into five languages with next-intl behind a custom validator that catches missing keys, unparseable ICU strings and placeholder drift — three failure modes TypeScript, ESLint and next build all ignore, and all three had shipped to production before it existed. Middleware emits a per-request nonce-based CSP.

Admin console

Next.js 16 · 44 modules · TipTap

The operations surface: moderation queues, vendor verification and KYC review, wallet and payout approval, order and ticket management, analytics, and a blog/CMS on TipTap. Deliberately lighter than the storefront — one Axios file instead of a client class, React contexts instead of Zustand, and every backend endpoint declared in a single registry grouped by domain so URLs are never inlined at call sites.

AI platform layer

OpenAI · Gemini · Groq · Atlas Vector Search

A provider-agnostic capability layer, not a wrapper around one SDK. Providers declare separate priorities for text, vision, audio and embeddings, and every call walks the candidates in order until one answers, so a provider outage degrades quality instead of breaking the feature. Prompts live in a versioned central registry, responses cache on capability plus prompt version plus input hash, and every call is logged with provider, latency, cache hit, byte counts and how many providers were attempted. Roughly thirty environment flags gate the capabilities individually so each one ships dark and is switched on deliberately.

Wallet & escrow

Mongo transactions · Stripe · webhooks

Multi-currency wallets for customers and vendors behind a KYC gate, with a platform escrow wallet holding funds between checkout and payout. Each wallet is debited in its own currency rather than a single base currency, settlement reconciles against Stripe webhooks, and the escrow wallet's owner is set explicitly rather than inferred — the kind of thing that is obvious in review and expensive in production.

Key Highlights

  • Lead the engineering team: technical direction, architecture decisions, and code review across three repositories with no shared root to commit from
  • Built the AI layer as a capability-routed provider abstraction over OpenAI, Gemini and Groq — per-modality priority, automatic failover, a versioned prompt registry, response caching, and per-call telemetry for provider attribution and latency
  • Shipped tool-calling assistants on both sides of the marketplace: a vendor assistant that can check stock, draft an order and schedule a callback, and an admin operations assistant over fourteen read tools spanning revenue, orders, vendors, products, customers and tickets
  • Added semantic and image product search on MongoDB Atlas Vector Search, with a deliberately deterministic embedding-provider priority — vectors from two embedding models are not comparable, and a silent switch would leave one collection holding two incompatible vector spaces and make search quietly meaningless
  • Built the trust-and-safety stack: vendor risk scoring that combines signup age, posting velocity, payout patterns and moderation history into a 0-100 score, AML pattern detection, a fraud-ring graph over device fingerprints, and auction bid-pattern supervision for shill bidding and collusion
  • Shipped live-commerce AI — per-chunk stream captioning, viewer-sentiment ticks, automatic product tagging from sampled frames, and highlight extraction into Mux clips when a stream ends

Technical Challenges

The interesting problem was not getting models to work, it was shipping them into a marketplace that is already live and handling other people's money. Every capability sits behind its own flag, default off, and the flags are deliberately not shared: arming the vendor assistant's tools would simultaneously arm a write tool that creates draft orders, which is a different blast radius from a read-only admin assistant, so they are separate switches. Anything that could freeze a real business's funds — AML hits, fraud-ring membership, vendor risk scores — is advisory output for a human compliance reviewer, never an automated decision, because a false positive there is reportable. Automatic product tagging on live streams only matches against products the vendor actually attached to that stream; a confident match against an unrelated item would put the wrong buy-button in front of viewers, which is worse than tagging nothing at all.