W03 / Case study
Search you can trust on a live-commerce platform
A lean search index kept consistent by domain events, a Shopify app moved off legacy serverless code, and dead fields removed only after proving they were unused.
- Client
- A multi-brand live-shopping platform, under NDA
- Role
- Senior full-stack engineer: platform API, search, event pipeline, Shopify app
- Period
- 2025 — now
- Stack
- NestJS
- Angular
- Shopify
- copied fields left in the search index to go stale
- 0
- test files I added across the platform
- 600+
- platform API behind the Shopify app, legacy code retired
- 1
01 / Context
Context
A multi-brand live-shopping platform: brands publish shoppable video content on their own storefronts and run live sessions with chat and an in-session cart. It ships a Shopify app and an embeddable SDK on top of a shared platform API.
02 / Problem
Problem
Search results drifted from the source data. The index carried copies of fields that changed elsewhere, such as display names, so renames left stale results behind. At the same time the Shopify app still ran on legacy serverless functions that duplicated platform logic.
03 / Architecture
Architecture
- Storefront apps — web app, embeddable SDK
- Shopify app — webhooks, catalog sync
- Platform API — NestJS
- Database — system of record
- Domain events — message bus
- Event processor — updates the index
- Search index — ranking, facets, totals
The index ranks and counts; the database holds the bodies. Events keep the two in step.
04 / Key decisions
Key decisions
05 / Hard problems
Hard problems
Two stores, one truth
Keeping a database and a search index consistent under renames, deletes and re-links, without a nightly rebuild.
Shopify edge cases
Shops with several domains and URL variants, and a billing change shipped as a one-shot migration with a runbook.
A safe backfill
Bringing every existing record into a new state model in one pass, without downtime or a temporary index.
06 / How it was built
How it was built
My own agent setup around the repo: an index-only CLAUDE.md that routes to per-area rules, a domain glossary, a legacy-versus-current flow map, custom builder and reviewer subagents, and written specs and plans with session handoffs. I also integrated the platform SDK, live sessions and cart sync into partner storefronts built with Next.js and React Native.