An electronics retailer needed to sell online. Not just a storefront — the full operation. Import thousands of products from a B2B distributor. Set prices with margin rules. List on Poland's biggest marketplace. Watch competitor prices. Auto-delist anything unprofitable. Forward orders for fulfillment. The owner was doing most of it manually across multiple tabs, recalculating margins by hand, hoping nothing fell through the gaps. Off-the-shelf solutions covered maybe 30% of that workflow. I built the system that connects everything.
I started by mapping every manual step the owner was doing and asking which could be fully eliminated versus merely accelerated. The answer was almost all of them. The architecture decision followed directly from that: each manual workflow became an isolated module, connected through events, so a failure in one part wouldn't take down the rest.
"The marketplace doesn't give you competitor pricing through their API. Scraping is the only way to get it. But raw scraping returns garbage — you'd get listings for the same search term that have nothing to do with your product. I built Levenshtein-distance title matching on top of Scrapfly's proxy layer to verify that a scraped result actually matches the product before the price goes into the profitability calculation. Scrapfly handles anti-bot bypass. I handle the matching logic. Without both, the margin analysis would be wrong half the time."
Custom Medusa workflow bulk-imports products, technical specs, and imagery from the distributor CDN using exponential backoff.
Scrapfly fetches marketplace prices. System calculates Levenshtein title-similarity, runs margin rules, and automatically flags unprofitable offers for delisting.
Changes trigger an Event Bus subscriber. Meilisearch is updated instantly. Next.js storefront serves rapid data globally via App Router.
Customer placed orders fire a webhook. System maps courier rules and automatically back-orders the hardware directly with the B2B supplier.
The business logic here doesn't exist as a plugin anywhere. Category-scoped markup rules with price-range constraints. Automated profitability-gated marketplace listing management. SOAP API integration with a B2B distributor. There's no Shopify app for that combination. I needed full control over every module.
Medusa v2's architecture lets each concern live in isolation. The marketplace margin analyzer doesn't know the product seeder exists. The markup engine doesn't know about the scraper. They talk through events. One module catches fire, the rest keep running.
The marketplace doesn't expose competitor pricing through their API. Scraping is the only option. Scrapfly handles proxy rotation and anti-bot detection. The harder problem was matching — a search term returns dozens of results, most wrong. I built Levenshtein-distance title matching on top to verify that a scraped listing actually corresponds to the right product.
After markup and VAT, a laptop comes out to 4,847.32 PLN. Nobody buys a laptop priced at 4,847.32 PLN — not because they can't afford it, but because it looks like a machine spat it out. The pricing engine rounds to psychologically clean numbers as the last step.
The platform runs on Medusa.js v2 with 15 custom modules. Each one handles a distinct piece of the business. Product import pulls the full catalog from the distributor's SOAP API — descriptions, specs, images, wholesale prices. Markup rules set consumer prices automatically with psychological rounding and VAT baked in. The marketplace integration scrapes competitor prices, calculates commissions, runs profitability analysis, and manages listings — creating, updating, pausing, and delisting based on margin thresholds. All automated. One operator runs the entire product lifecycle from a single screen.
The operator went from manually syncing products across tabs to running the full product lifecycle from one screen. The time savings alone justified the build in the first month.