Full products
AI SaaS
A complete multi-tenant SaaS with sign-up, billing, usage limits, and one strong AI feature, deployed and ready for real users.
Copy or download the full plan and paste it into your AI coding agent to build it.
Why build it
Almost every AI demo dies the moment a second user shows up: there is no login, no way to charge, and no limit on who can burn your API budget. A real product needs multi-tenancy (many separate customer accounts sharing one deployment, each seeing only its own data), authentication, metered usage, and a paywall. This is exactly the stack that turns a weekend AI toy into something a business will pay for, and it is the gap between people who can prototype and people companies actually hire. Building it once, end to end, teaches you the boring, load-bearing parts that no tutorial covers.
Who it's for: The developer who has built AI demos and wants to prove they can ship a whole product. You should be comfortable with a full-stack framework and a database before starting.
What you'll build
Core (MVP)
- Email and OAuth sign-up with sessions and password reset
- Multi-tenant data model so each account's data is fully isolated
- One strong AI feature: a document assistant that answers from each tenant's uploaded files (RAG)
- Stripe billing in test mode with a free tier and at least one paid plan
- Per-tenant usage metering (requests or tokens) enforced against plan limits
- A dashboard showing usage this period, current plan, and an upgrade button
- A hard paywall that blocks the AI feature once the limit is hit
- An account settings page to manage the subscription and API keys
Stretch
- Team accounts: invite members with roles (RBAC, role-based access control)
- Usage-based (metered) billing that charges per unit above the included quota
- A Stripe webhook that reconciles subscription state on every plan change
- Admin panel to view tenants, usage, and revenue
- Soft limits with email warnings before the hard cutoff
Step-by-step build
- 1
Model the tenant from day one
Design the schema so every table that holds customer data carries a tenantId (or organizationId), and nothing is ever queried without it. Multi-tenant means one deployment serves many isolated accounts, so this key is your security boundary. Getting it right now saves a painful rewrite later.
- 2
Add authentication
Wire up Auth.js with an email provider and at least one OAuth provider. On sign-up, create the user and a tenant record together, and attach the tenantId to the session. Every subsequent request reads the tenant from the session, never from user input.
- 3
Build the AI feature
Implement the document assistant as scoped RAG (retrieval-augmented generation): a tenant uploads files, you chunk and embed them, and store the vectors with the tenantId attached. On a question, you retrieve only that tenant's chunks and answer from them with Groq. This is the value users pay for, so build it well.
- 4
Meter usage
Every call to the AI feature increments a per-tenant counter in Redis keyed to the current billing period. Record enough to enforce a limit and to show a usage bar in the dashboard. Decide your unit up front (requests or tokens) and be consistent.
- 5
Wire up Stripe billing
Create products and prices in the Stripe test dashboard: a free tier and one paid plan. Use Stripe Checkout for upgrades and the customer portal for managing the subscription. Store the Stripe customer and subscription IDs on the tenant.
- 6
Enforce plan limits
Before running the AI feature, look up the tenant's plan and its usage this period. If they are over the included quota, return a clear paywall response instead of calling the model. This single check is what protects your API budget and creates the reason to upgrade.
- 7
Handle webhooks
Add a Stripe webhook endpoint that updates the tenant's plan when a subscription is created, changed, or canceled. Verify the webhook signature, make the handler idempotent, and treat the webhook as the source of truth for billing state, not the client.
- 8
Build the dashboard
One screen: usage this period against the limit, the current plan, an upgrade button, and the document assistant itself. Keep account and subscription management on a separate settings page. Users should understand their status in one glance.
- 9
Reset periods and test the edges
Add a scheduled job that resets usage counters when a billing period rolls over. Then test the hard cases: a canceled plan mid-period, a failed payment, a tenant trying to read another tenant's data, and the limit hit exactly at the boundary.
- 10
Deploy and document
Ship it live with real test-mode billing working end to end. Write a README with the live URL, a short demo showing sign-up through upgrade, and a paragraph on the tenant model. Recruiters read the README before the code.
Done when
- ✓Two separate accounts can sign up, and neither can see or query the other's documents.
- ✓A free-tier user hits the usage limit and is cleanly blocked until they upgrade.
- ✓Upgrading through Stripe Checkout raises the limit, and the webhook updates the plan without a page reload trick.
- ✓Canceling the subscription downgrades the tenant at the right time, verified against the Stripe portal.
- ✓The live URL works end to end for someone who is not you, from sign-up to a grounded AI answer.
Ship it
Deploy the Next.js app on Vercel with Postgres on Neon or Supabase and Redis on Upstash, all free tiers. Keep Stripe in test mode so anyone can try the full billing flow with a test card. Put the live URL, a demo of the sign-up-to-upgrade path, and a short note on the multi-tenant design at the top of the README.
What it proves: You can ship a real, production-shaped SaaS end to end: auth, multi-tenancy, billing, and usage limits around an AI feature, not just a demo. This is the exact shape of most AI startups.
Hand it to your AI agent
Paste this into Cursor, Claude, or ChatGPT and build it step by step.
You are my senior AI engineer pair. Help me build "AI SaaS", a complete multi-tenant AI product, step by step. Multi-tenant means one deployment serves many isolated customer accounts. Stack: Next.js (UI + API routes), Auth.js for authentication, Postgres + pgvector (Neon or Supabase free tier) with Prisma, Stripe in test mode for billing, Redis (Upstash) for usage counters, and Groq (free LLM API) for the AI feature. Requirements: 1. A tenant-scoped schema where every customer row carries a tenantId that is the security boundary. 2. Sign-up with email and OAuth that creates a user and tenant together and puts the tenantId in the session. 3. A document assistant using RAG (retrieval-augmented generation) scoped to each tenant's own uploaded files. 4. Per-tenant usage metering in Redis and a hard paywall when a plan limit is hit. 5. Stripe Checkout, the customer portal, and a signature-verified, idempotent webhook as the source of truth for plan state. 6. A dashboard showing usage, plan, and an upgrade button. Work in this order: schema and tenant model, then auth, then the AI feature, then metering, then Stripe, then the dashboard, then period resets and edge cases. STOP after each step so I can test. Do not write the whole app at once.
More in Full products
Real-time voice assistant
A low-latency voice assistant that listens, thinks, and speaks back in a stream so it feels like a live conversation, not a walkie-talkie.
Vertical copilot
A domain-specific copilot (pick legal, medical, sales, or support) that combines RAG over domain documents, tools, and guardrails into one focused, trustworthy assistant.
Building this? I post a new AI project plan on LinkedIn most weeks. Follow along and share what you ship.