An electronics store 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 the country's biggest marketplace. Watch what competitors charge. Auto-delist anything that stops being profitable. Forward orders to the distributor for fulfillment. Off-the-shelf solutions covered maybe 30% of that. The rest was someone manually copying data between tabs, recalculating margins by hand, and hoping nothing fell through the gaps. I built the system that connects everything.
The platform runs on Medusa.js v2 with 15 custom modules. Each one handles a distinct piece of the business. The storefront covers browsing, Meilisearch-powered search, and checkout with local payment and delivery integrations. The admin dashboard is where the real work happens. 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 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.