How I'd build Referral AI
I'd reach for Next.js on the frontend with a FastAPI backend for the AI heavy lifting, Postgres for the relational data, and Stripe for billing. The tech is proven for multi-tenant SaaS. I'm estimating 400-450 hours to get this to launch-ready, which puts it right in the $28k ballpark if you're paying for a mix of senior and mid-level work.
Day-by-day plan
Day 1-2: Provision auth schema, multi-tenant data model, and org/workspace tables in Postgres. Wire up Next.js middleware for tenant isolation.
Day 3-4: Integrate Stripe. Build customer, subscription, and invoice models. Wire the three pricing tiers into the billing engine and set up trial logic.
Day 5-6: Build the onboarding flow: domain verification, Shopify connection scaffolding, and the first dashboard view showing referral metrics at a glance.
Day 7-8: Referral link generation and click tracking. Build the embed snippet that sites load to capture invites. Wire attribution to actual conversions.
Day 9-10: Shopify app skeleton. Use the official SDK, handle OAuth handshake, and build the admin panel UI so merchants can configure campaigns without leaving their store.
Day 11-12: Build the AI layer. Use Claude's API to score customer happiness from referral activity (engagement velocity, conversion rates, churn risk), and surface actionable recommendations. Scaffold the email templates for referral invites that the merchant can customize.
Day 13-14: Integration tests, Postgres connection pooling, rate limiting, and security review. Polish the dashboard, build the public docs, and prepare the Product Hunt launch post and Shopify app description.
What's hard about this build
The actual hard part is not the AI. It's attribution. Referral programs live in a forest of third-party trackers, cookie policies, and privacy regulations. You need to handle iOS App Tracking Transparency, GDPR consent flows, and the fact that a referrer clicks a link but doesn't convert for six months. You also can't pretend the AI differentiation is revolutionary. Happiness scoring built on engagement metrics feels clever until a competitor ships the same thing for less money. The real risk is that you build a solid product that solves a low-urgency problem. Founders don't wake up thinking about referral programs, and they'll churn if results don't show up in thirty days. That means your onboarding has to push them to a win immediately. You also need to think through what happens when a customer's referral program just doesn't work because their product isn't viral friendly.
What's fast because of AI
Claude compresses months of work into days here. I use it for boilerplate generation of the entire API layer, which saves a week of typing endpoints nobody wants to write by hand. Test generation is massive: I prompt with the data model and get back 80 percent of the happy-path and edge-case tests. Copy is another one. The UI needs dozens of microcopy strings, and I generate those all at once instead of bike-shedding them across three review rounds. Edge case enumeration saves huge amounts of whiteboard time: I ask Claude what can break in a multi-tenant billing system and get a checklist I might miss. Debugging gets faster too. When a query runs slow or I hit an off-by-one error in the attribution logic, I paste the code and logs and get a diagnosis in seconds, not hours.
How I'd hand it off
I'd ship a Loom walkthrough covering the onboarding flow, dashboard, and Shopify app setup. I'd write a runbook for the 30-day pager rotation: how to scale Postgres, handle rate limit breaches, and triage customer support issues. I'd transfer all credentials, environment variables, and Linear board access. You'd get source code in a clean Git history, database backups, and documentation for the Claude API integration so whoever maintains it understands what's being scored and why.