DEV Community

Bright Asare Bediako
Bright Asare Bediako

Posted on

I Built an AI That Spins Up a Full Dropshipping Store in 60 Seconds. Here's the Architecture.

 Most dropshipping "tools" import products. That's about 5% of the actual work. The other 95%, writing descriptions, setting prices, wiring suppliers, answering "where's my order," making ads, is the boring part nobody talks about, and it's exactly the part a machine should do.

So I built one that does. You type one sentence ("a store for minimalist desk gadgets"), and about 60 seconds later you have a live storefront with products, prices, copy, a logo, and a working checkout. This post is the honest engineering breakdown, including the parts that broke.

The constraint that shaped everything: zero budget

I built this solo with no runway, which forced a rule: every dependency has to have a real free tier or it doesn't ship. That single constraint dictated the whole architecture.

  • AI inference: Cloudflare Workers AI (Llama 3.3 70B) as the primary, with a fallback chain (Gemini, then others) behind it.
  • Hosting: a single small VM behind Cloudflare, nginx to Node.
  • Data: Postgres.
  • Payments: Stripe (only costs money when you make money).

The interesting problems weren't "how do I call an LLM." They were "how do I make an LLM-driven store reliable enough to take real payments on a free tier."

Problem 1: free AI providers rot

Free model endpoints change constantly. My fallback chain quietly decayed until one day the logs said All AI providers exhausted. Groq's model id had been retired, Gemini's gemini-2.0-flash was gone, and OpenRouter had killed its free tier, all at once.

Two lessons that now shape the code:

  1. Never hardcode a single model. Every provider is a function behind a common interface, and the id is env-configurable so a rotation is a config change, not a redeploy.
  2. The response shape drifts too. One provider moved from result.response to OpenAI-style result.choices[0].message.content overnight. The parser now accepts both. One ?? saved the entire engine.

Problem 2: the store has to run itself

A "store builder" that stops the moment you close the tab isn't automation, it's a form. The features that make it actually autonomous were the fun ones to build:

A self-optimising storefront. The store A/B-tests its own product titles and prices, and keeps the winner automatically. The brain is a plain two-proportion z-test over impressions and conversions: at 95% confidence (or after a two-week ceiling), it applies the winning variant to the live product and messages the owner "Variant B won, +23% conversion, applied for you." No dashboard babysitting.

function twoPropZ(c1, n1, c2, n2) {
  const p1 = c1 / n1, p2 = c2 / n2;
  const p = (c1 + c2) / (n1 + n2);
  const se = Math.sqrt(p * (1 - p) * (1 / n1 + 1 / n2));
  return se === 0 ? 0 : (p1 - p2) / se;
}
Enter fullscreen mode Exit fullscreen mode

Order-aware AI support. Every storefront has a chat widget, but the trick is grounding. When a shopper asks "where's my order," the model gets that customer's real order + tracking injected into the prompt, so it answers with the actual status instead of "a team member will follow up." Grounding beats a bigger model almost every time.

Auto-generated ad kits. Every product a merchant adds gets a ready-to-post ad: hook, caption, hashtags, a voiceover script, and a 9:16 card rendered server-side as an SVG (no ffmpeg, no render farm, no cost).

Problem 3: taking money on autopilot without leaking it

This is where "let AI handle it" gets dangerous. Discounts, gift cards, and loyalty points were all being trusted from the browser, which means a technical customer could POST any amount and get free product. The fix is boring and non-negotiable: the server re-derives every discount from its own data at checkout, and never trusts a number the client sends. Flash sales, bundles, and geo-pricing are all resolved server-side too. If you build commerce with an LLM in the loop, assume the client is hostile, because eventually one is.

What I'd tell someone starting this

  • A free tier is an architecture, not a discount. Design for provider rot and you get resilience for free.
  • Grounding > model size. Feed the model real data and a small free model is genuinely useful.
  • The 95% you automate is the boring 95%. That's the whole value.

If you want to poke at the thing itself, it's live and free to start at Nivroo — describe a store and watch it build one. And if you're building AI products on a shoestring, I'm documenting the whole thing in public, so say hi.

What would you have architected differently? I'd genuinely like to know.

Top comments (0)