Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

SaaS Starter Simple

A minimal SaaS app with Clerk auth, Stripe payments, and Resend email — all provisioned by vibe-provision.

Architecture

User → Clerk Auth → Next.js
  ├── /pricing          → Stripe Checkout
  ├── /dashboard        → Protected page
  └── /api/webhooks/stripe → Stripe signature verification
                              ├── checkout.session.completed → Resend welcome email
                              ├── customer.subscription.updated → Update plan
                              └── customer.subscription.deleted → Downgrade

Setup (3 steps)

# 1. Provision all services
npx vp auth     # One-time: paste API keys for Clerk, Stripe, Resend
npx vp up       # Creates Stripe product/price/webhook, generates .env

# 2. Install dependencies
npm install

# 3. Run
npm run dev      # http://localhost:3000

That's it. Clerk auth, Stripe checkout, and webhook handling are all wired up.

What vibe-provision creates

Running npx vp up with the included vibe.yaml:

Service What's created .env vars
Clerk Auth config NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY, CLERK_SECRET_KEY, sign-in/up URLs
Stripe Pro Plan ($19/mo), Webhook endpoint STRIPE_SECRET_KEY, STRIPE_PUBLISHABLE_KEY, STRIPE_PRO_PLAN_MONTH_PRICE_ID, STRIPE_WEBHOOK_SECRET
Resend Email domain RESEND_API_KEY

Pages

Route Auth Description
/ Public Landing page with sign-in
/pricing Public Pricing page with checkout button
/sign-in Public Clerk sign-in
/sign-up Public Clerk sign-up
/dashboard Protected User dashboard
/api/checkout Protected Creates Stripe Checkout session
/api/webhooks/stripe Public Stripe webhook handler

Webhook URL の設定

vibe.yamlwebhooks.url にはプレースホルダー (https://YOUR_DOMAIN/api/webhooks/stripe) が設定されています。

  • ローカル開発: そのままで OK。npx vp up 実行時に Stripe CLI 経由のローカル転送用エンドポイントが自動設定されます。
  • 本番デプロイ時: デプロイ先のドメインに書き換えてから npx vp up を再実行してください。
# vibe.yaml — 本番用の例
webhooks:
  url: https://app.example.com/api/webhooks/stripe

Testing webhooks locally

Use Stripe CLI to forward webhooks:

stripe listen --forward-to localhost:3000/api/webhooks/stripe

Or trigger a test event:

stripe trigger checkout.session.completed