Inspiration
This was a Deep End of the Pool experiment: could we vibe-code a complex, enterprise-grade, multi-value-prop AI ecommerce platform with no manual code fixes—only plugging AWS credentials?
Merchmatica is also inspired by Stephen Wolfram’s *A New Kind of Science.
Where Wolfram showed that *simple local rules in cellular automata can generate infinite complexity, here we ask:
What happens when simple licensing + payment rules generate an entire merch economy?
- A creator sets a royalty %
- A fan generates an AI design
- A store curates products
- A Stripe split propagates payouts
From these atomic rules emerges a new kind of commerce: unpredictable, generative, and computationally irreducible.
What it does
Merchmatica (aka Project cameo-ecosystem — named after my dog and AI design collaborator @corgi.cam) is a platform for an emergent merch ecosystem.
- Creators directly license and monetize their likeness for AI-downstream content creation that flows into physical merch.
- Fans can spin up their own stores, generating apparel, postcards, even 3D-printed figurines from licensed creator IP.
- Payments & fulfillment are handled through Stripe Connect and merch APIs, turning fan-inspired generated creations into tangible goods.
Instead of a top-down catalog, Merchmatica works like a commerce automaton: creators, fans, and stores play out simple rules that give rise to complex global markets.
How we built it
We started with a single prompt:
“Create Spec: Cameo Ecosystem: allow fans to generate brand-true images and products such as postcards, apparel and 3D printed figurines (2D/3D) from Creators, then sell products via stores.”
Then let the Kiro agent autopilot it through:
- Spec generation + architecture by Kiro
- Implementation assisted by VSCode Copilot
- Stack: Next.js SSR + AWS Amplify + Stripe Connect + FAL/Replicate for AI gen
- Multi-layered environment loader for secrets + debug endpoints for production validation
Like cellular automata rules encoded in Mathematica, Kiro’s “spec → system” process became its own rule-based generator of architecture and code.
Challenges we ran into
Deploying a Next.js SSR app on AWS Amplify exposed edge cases reminiscent of computational irreducibility—small rule-changes, big unpredictable outcomes:
-
process.env
proved unreliable for SSR/API routes → secrets vanished at runtime. -
Workarounds: multi-source loader pulling from
process.env
, static refs, AWS SSM, encrypted build artifacts, and.next/env.json
. - All sensitive ops forced into Node-only space to avoid leaking secrets.
- Added
/api/debug/env
+/api/debug/creators-direct
to confirm runtime connectivity. - Wrestled with URL-encoded secrets (
%24
vs$
) breaking database URLs.
Takeaway: Amplify + SSR = a nontrivial automaton; resilience requires layered env logic and runtime validation.
Accomplishments we’re proud of
- End-to-end emergent flow: licensing → AI generation → storefront → payment split → fulfillment.
- Royalty-aware Stripe Connect flow that mirrors conservation laws in physics: nothing lost, everything distributed.
- Debug + resilience infrastructure that exposed hidden rules of the system before users hit them.
- Building business-grade reliability entirely through rule-based AI orchestration.
What we learned
Conversation strategies with Kiro that worked like defining rules in an automaton:
-
Context-Rich Requests
- ❌ Bad: “Create a payment system”
- ✅ Good: “Build a Stripe Connect system where creators set royalty rates (0–50%), store owners curate products, fans purchase merchandise, and all parties get paid automatically with full audit trails.”
-
Constraint-Driven Development
- Must handle concurrency, real-time status, multi-currency, regulation compliance, and API failure recovery.
-
Integration-First Thinking
- Payments tied into licensing, catalog, webhook infra, and AWS monitoring from day one.
-
Iterative Refinement
- Started with working checkout → layered in watermark removal, email confirmations, retries, analytics.
💡 Why this worked:
- Kiro thinks in systems, not snippets.
- Operates with a production mindset: error handling, tests, edge cases.
- Tracks integration surfaces across the stack.
- Builds iteratively, carrying forward context like evolving states in a cellular automaton.
Like Wolfram’s NKS, the lesson is: simple rule-sets are enough to create worlds of complexity. Merchmatica is one such world—commerce as computation.
What’s next for Merchmatica
🚀 LAUNCH!
Top comments (0)