My Apps Make $4.5M/Year With $0 Marketing
Target MVP (what we’re building)
Embedded Shopify app (admin UI) where merchants create bundle offers (e.g., “Buy 2 get 10% off”, “Buy X+Y get $ off”).
Theme App Extension that renders a bundle widget on product pages (or cart drawer).
Discount applied via Shopify Functions (Discounts) (preferred) or fallback to Draft Order (not ideal).
Basic analytics (bundle views, adds, conversions) + “value generated” number (for the monthly email idea).
Tech suggestion:
Shopify App Template (Remix + Node)
Prisma + Postgres
Shopify GraphQL Admin API
Theme App Extension
Shopify Functions (Discount)
Cursor prompt sequence (copy/paste in order)
0) Repo + architecture map
You are my senior Shopify app engineer. We are building a Shopify embedded app MVP called “BundleBoost”.
Goal: merchants create bundle offers and show a widget on product pages; discount is applied automatically at checkout using Shopify Functions (Discount).
Tech: Shopify Remix app template (Node), Prisma + Postgres, Shopify Admin GraphQL API, Theme App Extension, Shopify Functions discount.
Please output:
1) a concise architecture diagram (text)
2) data model (tables + key fields)
3) API routes we’ll need
4) UI pages/components list
5) milestones in order (MVP first).
Keep it implementation-oriented.
1) Generate Shopify app from template
Guide me to scaffold the project using the official Shopify Remix app template.
Assume I will run Shopify CLI commands locally.
Provide the exact commands, required environment variables, and what files to expect afterwards.
Also propose the folder structure we should use for bundles, analytics, and extensions.
2) Add Prisma + Postgres
Implement Prisma in this Remix Shopify app.
- Add prisma schema and migrations
- Use Postgres
- Add models: Shop, BundleOffer, BundleOfferItem, OfferMetricsDaily (or Event), Installation
- Add seed script for local dev
- Add a db.ts helper for Remix loaders/actions
Output the code changes as patch-style instructions with filenames and contents.
3) Shopify auth + shop persistence
Implement robust shop persistence:
- On app install/auth, upsert Shop record with shop domain, access token, installedAt, plan fields (free/paid)
- Create a helper getShopFromRequest(request) for loaders/actions
- Add a middleware-ish pattern so all protected routes require an authenticated shop
Show the exact code for Remix loaders/actions and any utility files.
4) Admin UI: offers list + create/edit
Build the admin UI using Polaris:
Pages:
- /app (dashboard)
- /app/offers (list offers, status toggles, search)
- /app/offers/new (create offer)
- /app/offers/:id (edit offer)
Offer fields:
- name
- status (active/inactive)
- trigger product(s) or collection
- bundle items (variant ids + quantity)
- discount type (percentage/fixed) + value
- placement (product page widget for MVP)
Implement Remix loaders/actions + form validation + optimistic UI.
Provide code files, components, and routes.
5) Product/variant picker integration
Add product + variant picking in the offer editor:
- Use Shopify App Bridge Resource Picker (or recommended modern equivalent) inside Remix
- Store selected variant IDs + quantities in BundleOfferItem
- Display selected items list with remove + quantity edit
Include code for the UI component and how it posts back to the Remix action.
6) Create Theme App Extension (widget)
Create a Shopify Theme App Extension that renders a “Bundle Offer” widget on product pages.
Requirements:
- Liquid block that mounts a small JS app (vanilla or tiny React) to fetch offers for the current product/variant
- Public endpoint: GET /api/offers?productId=... returning active offers for this shop and product
- Widget shows: offer title, bundle items, “Add bundle to cart” button
- When clicked: add all bundle items to cart via /cart/add.js (or Storefront API if needed)
Include:
- extension files (liquid, schema)
- JS code
- how to configure in Shopify CLI
- security considerations (shop isolation).
7) Public offers endpoint + shop isolation
Implement the public offers endpoint securely.
Constraints:
- Theme extension requests must be able to identify the shop (shop domain) safely
- Prevent leaking offers across shops
- Consider signing requests or using Shopify-provided app proxy.
Pick the simplest secure approach for an MVP (prefer Shopify App Proxy).
Implement:
- app proxy route in Remix
- verification
- GET offers by product/variant
Provide full code and Shopify admin configuration steps.
8) Discount application via Shopify Functions
Implement Shopify Functions discount for bundles.
Goal: if cart contains the required bundle items/quantities, apply the configured discount.
Steps:
- Create a discount function extension
- Define configuration schema so each BundleOffer maps to a function config (or use metafields)
- On offer save, sync configuration to Shopify (e.g., discount created/updated)
- Function logic: detect qualifying bundles and apply percentage/fixed discount
Provide:
- function extension code
- config strategy
- sync code in the app backend
- testing approach with sample carts.
9) Analytics events (views/adds/conversions)
Add lightweight analytics:
- Track widget view and “Add bundle” click events
- Store events in DB with offerId, shopId, type, createdAt
- Add daily aggregation job (can run on request for MVP) for dashboard metrics
Dashboard should show:
- total bundle adds
- estimated revenue influenced (use simple heuristic: discount or line totals)
- top offers
Provide implementation with minimal overhead.
10) “Monthly value” email (simple)
Implement monthly email summary (MVP):
- A Remix server route that can be triggered manually (and later by cron) to send emails to the merchant contact email
- Email includes: “Your bundles generated $X in added revenue” + ask for review
For MVP, just log email content and optionally send via SendGrid (feature-flag).
Provide code and a clean email template.
11) Free-first monetization toggle (later)
Add a simple monetization gate:
- Free plan allows 1 active offer
- Paid plan allows unlimited offers
- Keep UI friendly, show upgrade banner when limit reached
For now, store plan in DB and mock billing; leave Shopify Billing API integration as a TODO.
Implement the checks in loaders/actions.
Extra “quality + reviews” prompts (optional but aligned with the playbook)
These mirror the video’s focus on UX + support + review engine.
In-app review ask
Add an in-app review nudge:
- After merchant has at least 50 bundle adds (or 7 days installed), show a Polaris banner: “If BundleBoost helped, please leave a review”
- Provide deep link to Shopify app listing (placeholder for now)
Implement gating logic and dismiss state stored per shop.
Support-first flow
Add a “Support” page in the app:
- Show common FAQs
- Add “Contact support” form that creates a SupportTicket row in DB (MVP)
- Include quick diagnostics: shop domain, app version, recent errors
Provide UI + routes + schema.