Skip to main content
Week 06 • Track 04 • The Vision

The
Gatekeeper.

Your app is free. People love it. Now it’s time to turn “free for all” into “pay to play.” One boolean. One gate. Your first dollar.

Pricing Toggle Demo

$0/mo

Free Plan

  • Up to 3 projects
  • Basic analytics
  • Community support

Toggle to Pro. Click Subscribe. Watch the gate open.

The Mental Model

Your app is the club.

Some areas are open to everyone—the lobby. Some areas require a wristband—the VIP section. The gatekeeper checks the wristband. That's it. That's monetization.

Free Tier = The Lobby

Everyone walks in. Core features, onboarding, the hook.

Paywall = The Velvet Rope

A single check: do you have a wristband? Yes or no.

Premium Tier = The VIP Section

Advanced features, higher limits, priority treatment.

Revenue = The Door Fee

Your first dollar. The proof that your app has real value.

middleware.ts

export function gatekeeper(req) {

const user = await getUser(req);

// The entire paywall:

if (!user.isPro) {

return redirect('/pricing');

}

// Welcome to VIP

return next();

}

What to Gate

F

Always Free

Users need to love your app before they pay. The free tier is the hook. Make it genuinely useful.

01Core value proposition—the thing that makes your app useful
02Onboarding flow—new users must experience the magic
03Basic CRUD—create, read, update, delete the essentials
04Authentication—users should always be able to sign in
05Basic support—docs, FAQ, community forums
P

Premium

Premium features are the “more”—more power, more convenience, more everything. Gate the extras, not the essentials.

01Advanced features—AI, exports, integrations
02Higher limits—more projects, more storage, more API calls
03Priority support—faster response times, direct access
04Remove branding—white-label, custom domains
05Team features—collaboration, roles, shared workspaces

The Stripe Flow

From “Upgrade” button to money in your account. Six steps. Stripe handles the hard parts.

1

User clicks “Upgrade”

Your pricing page

2

Create Checkout Session

Your API route calls Stripe

3

Payment processed

Stripe handles everything

4

Webhook fires

Stripe pings your endpoint

5

DB updates user

isPro = true

6

Premium unlocked

User sees VIP content

You only build steps 1, 2, 4, 5, and 6. Stripe owns step 3—the scary part.

The Database Flag

Monetization is simpler than you think.

At its core, the entire paywall is one boolean on a user record. Everything else is just checking that boolean.

schema.prisma

model User {

id String @id

email String @unique

name String

isPro Boolean @default(false)

}

pro-gate.ts

export async function

requirePro(userId) {

const user =

await db.user

.findUnique({userId});

if (!user.isPro)

throw PaywallError;

}

dashboard.tsx

{user.isPro ? (

<ProDashboard />

) : (

<FreeDashboard>

<UpgradePrompt />

</FreeDashboard>

)}

Common Patterns

Monetization Traps

"Gate everything from day one"

Users leave before they even understand the value. Let them fall in love first.

"Charge before delivering value"

Nobody pays for a promise. Prove the product works, then ask for money.

"Offer 5 pricing tiers"

Complexity kills conversion. Choice overload is real. Keep it simple.

"No free tier at all"

The free tier is your marketing. It's how people discover and trust your app.

The Clean Gate

Free tier that hooks

Make the free version genuinely good. Users should think “I want more of this.”

One premium tier to start

Free and Pro. That's it. You can add Enterprise later when you have enterprise customers.

Gate features, not content

Premium unlocks capabilities (AI, exports, limits). Don't lock content behind a wall.

Let Stripe handle billing

Don't build a billing system. Use Stripe Checkout, Stripe Portal, Stripe Webhooks. Done.

The Exercises

Earn your first dollar.

01

The Pricing Page

Design

  • Design a Free vs Pro pricing page
  • Use Tailwind for layout and styling
  • Include feature comparison and CTA buttons
Goal: A clean, simple pricing page
02

The Gate Check

Logic

  • Add an isPro flag to your user model
  • Create a gate-check helper function
  • Conditionally render premium content
Goal: Free and Pro users see different UIs
03

The First Dollar

Stripe

  • Set up Stripe in test mode
  • Create a Checkout Session via API route
  • Process a $1 test payment end-to-end
Goal: A successful test payment in Stripe

📋 Quick Reference

The Gate

if (!user.isPro) redirect('/pricing')

The Flow

Button → Stripe → Webhook → isPro = true
End of Week 06Return to Studio