How to Build a Subscription App
A subscription app is a product with a meter attached. Decide what each plan allows, check it on the server, and let Stripe run the billing calendar.

Key takeaways
- Write plans as entitlements (what each plan allows) in one table, and have every gated action check it on the server.
- A trial is just a subscription with a status and an end date. Decide up front whether it asks for a card.
- Most early churn is involuntary: expired cards and failed payments. Payment retries and a clear update-card prompt recover a large share of it.
To build a subscription app, define a small set of plans and what each one allows, store each customer's current plan and billing status in your database, let a billing provider such as Stripe charge cards on schedule and report changes by webhook, and check the plan on the server every time someone uses a paid feature. Add a trial with a clear end, a way to recover failed payments, and two or three churn numbers you look at weekly. That is the whole machine; the product inside it is what people actually pay for.
Turn plans into entitlements
Marketing pages describe plans in adjectives. Your code needs numbers and switches. Before building, write each plan as a short list of entitlements:
- Limits: projects allowed, seats, exports per month, storage in megabytes, AI generations per month.
- Switches: custom branding on or off, API access, priority support, team roles.
- Windows: how far back history goes (30 days on Free, unlimited on Pro).
Store that in a plans table with one row per plan and one column (or one JSON field) per entitlement. When you change what Pro includes, you edit a row, not twenty screens. Keep the matching Stripe price ids on the same row, monthly and yearly.
The rest of the data model
- accounts: the thing that subscribes. For a solo tool it is the user; for anything a team might share, make it an organization from the start, even if every organization has one member at first. Converting later is painful.
- subscriptions: account id, plan id, status (trialing, active, past_due, cancelled, paused), Stripe customer and subscription ids, current period end, trial end, and cancel-at-period-end.
- usage_counters: account id, metric (exports, generations), period start, count. One row per metric per billing period.
- billing_events: a log of every webhook received with its type and the raw payload id. When a customer says "I was charged twice", this is where you look.
Enforcing limits without annoying people
Every gated action does the same three things on the server: read the account's plan, compare against the counter or switch, and either proceed (incrementing the counter) or return a clear "limit reached" answer. The browser can show the limit, but it must not be the thing that enforces it.
How you say no matters as much as the check. Show usage before people hit the wall ("8 of 10 exports this month"), let them finish the thing they were doing, and make the upgrade prompt name the exact entitlement they need. A blocked user who sees "Upgrade to Pro for unlimited exports" converts; one who sees "Error 402" leaves.
Trials: pick one shape and stick to it
- 01No-card trial: anyone can try the paid plan for 7 or 14 days. More people start, fewer convert, and you need a clear "trial ended" screen that drops them to Free.
- 02Card-up-front trial: Stripe collects a card and starts charging when the trial ends unless they cancel. Fewer starts, more conversions, and you must remind people before the first charge.
- 03Freemium instead of a trial: a permanent free plan with tight limits. Best when the product gets better with use (stored history, saved projects) so people grow into paying.
Whichever you choose, send an email three days before a trial ends, saying what happens next and when. It reduces refund requests and chargebacks, and in some places reminders for auto-renewing trials are a legal expectation. On Startbase Cloud, a scheduled job can find trials ending in three days and send that email each morning; see Jobs.
Billing plumbing with Stripe
Startbase connects payments to your own Stripe account (Stripe Connect from the Backend tab, or your own keys), so money lands with you and Startbase adds no fee. The Payments docs explain both setups. For subscriptions, ask the agent for this shape:
- A server function that creates a subscription checkout for a chosen plan and price, tied to the account id.
- A webhook handler that verifies Stripe's signature, logs the event to billing_events, and updates the subscriptions row. It is the only writer of that row.
- A Manage billing button that opens Stripe's customer portal for card changes, plan switches, invoices and cancellation.
- Handling for the same webhook arriving twice. Stripe can retry deliveries, so processing must be safe to repeat.
Churn basics you can act on
Churn is the share of paying customers who stop paying in a period. There are two kinds, and they need different fixes:
- Involuntary churn: the card expired or was declined. Fix it with automatic payment retries (Stripe does these), an in-app banner while status is past_due, and an email with a direct link to update the card. Keep access during the retry window.
- Voluntary churn: they chose to leave. Ask one optional question on the way out (too expensive, missing a feature, not using it, switching tools) and read every answer for the first few months. Offer pause for seasonal users and a cheaper plan if price is the reason.
Three numbers are enough at the start: monthly recurring revenue, the share of trials that convert, and monthly churn. Build a small admin page that shows them from your own tables. Fancy cohort charts can wait until you have cohorts.
A note on mobile subscriptions
If your subscription app is a phone app distributed through the App Store or Google Play, the stores generally require digital subscriptions bought inside the app to go through their own billing, with their commission. That is a different integration from web billing with Stripe. Startbase builds Expo apps that run on your phone through Expo Go, but App Store and Play Store builds are not available from Startbase right now, so a web app with Stripe billing is the practical route here. The comparison of web apps and mobile apps covers that tradeoff in more depth.
Leave these out of v1
- Usage-based pricing that bills per unit. Start with plans and limits; metered billing adds invoice disputes.
- More than three plans. Free, one paid plan and maybe a team plan cover most early products.
- Annual contracts, invoices by bank transfer and custom enterprise quotes. Handle the first few by hand.
- Your own dunning email sequence. Use Stripe's retries and one clear in-app prompt first.
Paste-ready brief
Build a subscription web app for a social media caption tool. Accounts are organizations so teams can share later. Plans table with entitlements: Free (20 captions a month, 1 brand profile, 30 days of history), Pro at $15 a month or $150 a year (500 captions, 5 brand profiles, unlimited history, export to CSV). Every caption generation checks the plan and a per-period usage counter on the server and returns a friendly limit message with an upgrade button. 14-day Pro trial with no card; on day 11 a scheduled job emails a reminder, and when it ends the account drops to Free without losing data. Billing through my connected Stripe account: subscription checkout, a signature-checked webhook that logs every event and is the only writer of the subscriptions table, safe to receive the same event twice, and a Manage billing button for the Stripe customer portal. Show a banner when a payment fails and keep access for 7 days. Add an admin page with MRR, trial conversion and monthly churn from our own tables.
For the wider product side of building a paid tool, read how to build a SaaS without developers. How to price your app helps pick the plan prices.
Frequently asked questions
Should my free trial ask for a credit card?
It depends on what you want more of. No-card trials bring more signups and fewer conversions; card-up-front trials bring fewer signups and more paying customers. Either way, remind people a few days before the trial ends.
What is a good churn rate for a new subscription app?
There is no single good number; it varies widely by price and audience. Track it monthly, separate failed payments from cancellations, and focus on the trend rather than a benchmark.
How does my app know someone cancelled?
Stripe sends a webhook when a subscription changes or ends. A server function receives it and updates the subscription record, and your app checks that record before allowing paid features.
Can I build a subscription app without a backend?
No. Plans, usage counters and billing webhooks need a database and server code, and limits must be enforced on the server. On Startbase that backend is Startbase Cloud.
