跳到正文
DEV Community· TaeYeong Jeong·· 2 小時前AI 評分52

如何在 Vercel 上推出採一次性付款、免帳戶的單用途 AI 相片應用

How I ship single-purpose AI photo apps on Vercel with one-time payments (no accounts)

AI 導讀

作者以 Sadana 應用為例,介紹如何在 Vercel 上部署單用途 AI 相片應用,並採用一次性付款及不設用戶帳戶的模式。付款後,Lemon Squeezy 會電郵授權碼,應用透過 /api 驗證授權碼和追蹤點數;上載相片只在記憶體處理並傳送至圖像模型供應商,不寫入磁碟、資料庫或儲存桶。

正文

I run the Sadana apps used as examples.

I build single-purpose AI photo apps (old-photo restoration, headshots, room redesign, product shots). Each one is a static site plus a few serverless functions on Vercel, and each is sold as a one-time payment with no user accounts. Here is the setup and what I learned.

1. Static HTML + serverless /api

The front end is plain static HTML, CSS and a little JS. No framework, so pages load fast and are easy to index. Anything that needs a secret (the model call, payment verification) lives in a serverless function under /api. The browser never sees an API key.

2. A license key is the "login"

No accounts, no passwords. After checkout, Lemon Squeezy emails a license key. The app asks for that key, and the /api function validates it against the Lemon Squeezy license API before doing any work. The key also tracks how many credits remain (for example 3 photos). That removes sign-up friction and means there is no user database to protect.

3. Don't store uploads

Photos are processed in memory and sent only to the image model provider for generation. We never write them to disk, a database or a bucket, and results go straight to the browser. State this plainly on the page; users care.

4. Failure policy: failed runs don't cost a credit

If a generation fails (no image comes back or the model errors), the credit is automatically returned and the user can retry for free. Failed generations, service errors and unused codes within 7 days are refunded; once a result is delivered, change-of-mind refunds aren't offered. Decide this before launch, because it drives the credit-accounting logic in the API.

5. Programmatic SEO pages + IndexNow

Single-purpose tools win on long-tail searches. I generate many small landing pages (one per use case) from a template and data file, then submit the new and changed URLs to IndexNow after each release (a small script batches and pings them), so Bing and others pick up changes quickly. Keep each page genuinely useful, not thin.

Takeaways

  • One job per app keeps the code and the support load small.
  • A license key replaces accounts, and no stored uploads replaces a privacy burden.
  • Decide the failure and refund policy up front (ours: failed runs return the credit).

If you want to see the apps behind these examples: Sadana

來源:DEV Community · dev.to