Skip to content
AI-powered appsNewChat, vision, voice, generationBookings & schedulingAppointments that book themselvesShops & sellingA storefront in every pocketClient & businessRun the operation from one placeCommunities & clubsA home that is not a group chat
Health & wellnessHabits, tracking and calmGames2D, 3D and multiplayerPersonal & toolsThe tool you wish existedInternal toolsThe tool ops never had time for
See all use cases
ArcadeNewPricingSecurity
EngineThe game engine and World EditorHow it worksFrom one sentence to a live productDocsGuides for building and publishingBlogStories, guides and newsChangelogWhat shipped latelyStatusUptime of every serviceSupportGet help from the team
AI-powered appsBookings & schedulingShops & sellingClient & businessCommunities & clubsHealth & wellnessGamesPersonal & toolsInternal tools
See all use cases
ArcadeNewPricingSecurity
EngineHow it worksDocsBlogChangelogStatusSupport
Language
Blog
GuidesNovember 22, 20266 min read

How to Build a Membership Site

A membership site is a promise: pay, and you get in. Keeping it means locking content in the database, not hiding it in the page, and letting Stripe tell you who has paid.

Startbase Team
Editorial ink illustration of a heavy wooden door with three brass keys on a ring beside it, the smallest key in ember orange

Key takeaways

  • Members-only content must live in the database behind access rules. Anything shipped in the page code can be read by anyone who opens developer tools.
  • Store a membership row per person with tier and status, and let Stripe webhooks be the only thing that changes it.
  • Two tiers and one free level are plenty for launch. Every extra tier multiplies the access rules you have to test.

A membership site needs three working parts: sign-in so you know who is visiting, a membership record that says which tier each person has paid for and whether that payment is current, and content stored where the server checks that record before handing anything over. Billing runs through a payment processor such as Stripe, which charges the card every month and tells your app when a payment succeeds, fails or is cancelled. Build those three parts carefully and the pages on top are the easy bit.

Decide what the membership actually is

Membership sites look alike from the outside but sell different things, and the thing you sell shapes the build:

  • A content library: articles, videos, templates, recipes or lessons released over time. The core is a catalog with a lock on each item.
  • Access to people: a private community, office hours, a monthly call. The core is a members directory, a calendar and a discussion space.
  • Perks and discounts: a club card for a gym, a cafe or a local business. The core is a member card with a code or QR and a staff check screen.
  • A mix: most real memberships blend a library with one live element. Pick the one that carries the price and build that first.

The data model in plain words

  • profiles: one per signed-in person, with display name and avatar.
  • tiers: name (Free, Member, Patron), monthly and yearly price, the matching Stripe price ids, a rank number (0, 1, 2) and a short perks list.
  • memberships: user id, tier id, status (active, trialing, past_due, cancelled), the Stripe customer id and subscription id, and the date the current paid period ends.
  • content_items: title, type (post, video, download, event), body or file path, published date, and minimum tier rank needed to open it.
  • progress (optional): user id, content id, completed at. Useful for course-style libraries.

The ranked tier is the trick that keeps rules simple. Instead of "Gold can see A, B and C; Silver can see A and B", each item has a minimum rank, and a member can open anything at or below their own. One comparison covers every case.

Gating content for real

This is where most first membership sites leak. Hiding a lesson behind an "Upgrade to watch" overlay in the page does nothing if the lesson text is already inside the JavaScript the browser downloaded. Published Startbase web apps are static sites: everything in the code is public. So:

  1. 01Keep premium text in the database, not in page files. The page asks for an item, and the database decides whether to return the body.
  2. 02Use row level security on content_items: the body is readable only when the reader's active membership rank is at least the item's minimum rank. Startbase Cloud gives every new table row level security by default, and the agent writes policies that match your sign-in. See the Database docs for how policies look.
  3. 03Keep the teaser public. Title, cover image and a short summary can be readable by everyone, so the locked page still sells the upgrade.
  4. 04Put files in a private bucket and hand members a signed link valid for an hour, created by server code after it checks the membership.

Tip

Test it the suspicious way: sign in as a free user in the preview and ask the agent to try reading a premium item directly from the database as that user. If anything comes back, a policy is missing.

Billing: let Stripe be the source of truth

Recurring billing is Stripe's job: it stores cards, charges them on schedule, retries failed payments, and offers a hosted customer portal where members change cards, switch plans or cancel. Your app's job is to listen. On Startbase, payments run on your own Stripe account (connected from the Backend tab), money lands with you directly and Startbase adds no fee. The Payments docs cover both ways to connect.

The flow to ask for:

  • Join: the member picks a tier, server code creates a Stripe subscription checkout for that tier's price and links it to their user id.
  • Webhook: when Stripe reports the subscription created, renewed, failed or cancelled, a server function updates the memberships row. Nothing else writes to that table.
  • Manage: a Manage billing button opens Stripe's customer portal. You do not build card forms or cancellation screens.
  • Grace: when a payment fails, status becomes past_due. Keep access for a few days while Stripe retries, show a gentle banner, and only drop access when Stripe gives up.

Never grant access from the success page alone. The success page is a browser redirect; people close tabs. The webhook is the receipt.

Screens for the first version

  1. 01Public home: what members get, the tiers side by side, and a sample of locked content with real titles.
  2. 02Pricing and join: monthly and yearly toggle, one highlighted tier, a Join button per tier.
  3. 03Sign-in: email magic link is the least friction for members who visit once a week.
  4. 04Library: the content grid, with lock badges on items above the member's tier and an upgrade prompt on click.
  5. 05Item page: the content itself, with a Mark complete button if it is a course.
  6. 06Account: current tier, renewal date, and Manage billing.
  7. 07Admin: create and schedule content, set each item's minimum tier, and see a member list with tier and status.

Hard parts worth planning for

  • Upgrades and downgrades mid-period: Stripe handles proration. Your webhook just updates the tier when Stripe says the change took effect.
  • Video: big video files are better on a dedicated video host with privacy controls, embedded in the item page. File uploads in the Backend tab are capped at 15 MB each.
  • Shared logins: you cannot fully stop a member sharing a password. Magic links and showing recent sign-ins on the account page discourage casual sharing; do not build heavy device limits in v1.
  • Email: welcome, receipt and "new this week" digests. A scheduled job can send a weekly digest of new items to active members.

What to leave out at launch

Coupons, gift memberships, lifetime deals, team seats, affiliate payouts and a forum. Each one is a real feature with its own edge cases, and none of them matters until a few dozen people pay you. A single free tier plus one paid tier (with a yearly option) is the classic launch shape; a third tier can come once you know what your best members want more of.

The brief

Build a membership site for a woodworking teacher. Tiers: Free (rank 0) and Member (rank 1, $12 a month or $120 a year). Content items are video lessons and PDF plans, each with a title, cover, summary, body and a minimum tier rank; titles, covers and summaries are public, bodies and files are only readable by members whose active membership rank is high enough, enforced with row level security. Plans are PDFs in a private bucket served through short-lived signed links. Sign-in with email magic link. Billing through my connected Stripe account: subscription checkout per tier, a webhook that is the only writer of the memberships table, and a Manage billing button that opens the Stripe customer portal. Keep access for 5 days when a payment fails. Pages: public home with sample lessons, pricing, library with lock badges, lesson page, account page, and an admin area to publish lessons. Weekly email digest of new lessons to active members every Monday at 9am.

If you are still deciding whether people will pay, run the cheap version first: a public page, a waitlist and a handful of manual invites. The guide to validating an idea in a weekend walks through that. Membership sites also sit close to communities; the communities use case shows what people build there. For the billing side, accepting payments in your app covers Stripe, and how to price your app helps set the tiers.

Frequently asked questions

Can people see my members-only content in the page source?

Only if it is in the page code. Store premium content in the database behind row level security and serve files through signed links, and the browser only receives what the signed-in member is allowed to see.

How do members cancel or change their card?

Through Stripe's hosted customer portal, opened from a Manage billing button in your app. Stripe then tells your app about the change by webhook, and the membership record updates.

Should I offer a yearly plan?

Usually yes. A yearly option at roughly two months free is a common pattern, it improves cash flow and members who choose it tend to stay longer. Test the price, not just the discount.

Do I need a backend for a membership site?

Yes. Sign-in, membership records, locked content and payment webhooks all need one. On Startbase that is Startbase Cloud, which the agent offers to enable when your request needs accounts or a database.

On this page

  • Decide what the membership actually is
  • The data model in plain words
  • Gating content for real
  • Billing: let Stripe be the source of truth
  • Screens for the first version
  • Hard parts worth planning for
  • What to leave out at launch
  • The brief

Keep reading

More in Guides
Editorial ink illustration of a kitchen scale with an apple on its pan beside a notepad and a spoon, the apple in ember orange
GuidesNovember 22, 2026

How to Build a Calorie Tracker App

Calorie tracking fails when logging is slow or the numbers are wrong. Get reliable food data, make repeat meals one tap, and be honest that every number is an estimate.

6 min read
Editorial ink illustration of two tin-can telephones joined by a string across a garden fence, the knot in the string in ember orange
GuidesNovember 22, 2026

How to Build a Chat App

Chat looks simple and hides four hard problems: delivering messages live, knowing who is online, tracking who has read what, and keeping strangers from abusing it.

6 min read

Read less. Ship more.

Everything in this post is one prompt away. Describe your app and watch it build.

Start building

Apps, games, backends and publishing from one conversation.

Product

  • Features
  • Use cases
  • Pricing
  • Changelog

Resources

  • Blog
  • Docs
  • Support
  • Status
  • Security

Contact

  • w@startbase.ai
  • X / Twitter
  • LinkedIn
  • Instagram

Legal

  • Terms
  • Privacy

© 2026 Startbase. All rights reserved.